---
type: api
title: Get source maps
description: Get an array of Fleet artifacts, including source map uploads. You must have `read` or `all` Kibana privileges for the APM and User Experience feature.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-getsourcemaps
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-getsourcemaps
products:
  - Kibana
---

# Get source maps

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/apm/sourcemaps`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#basicauth)

## Description

Get an array of Fleet artifacts, including source map uploads. You must have `read` or `all` Kibana privileges for the APM and User Experience feature.

## Query String Parameters

- `page` (number)
  Page number
- `perPage` (number)
  Number of records per page

## Responses

#### `200`

Successful response

`application/json`

- `artifacts` ([] object)
  Artifacts
  - `body` (object)
    - `bundleFilepath` (string)
    - `serviceName` (string)
    - `serviceVersion` (string)
    - `sourceMap` (object)
      - `file` (string)
      - `mappings` (string)
      - `sourceRoot` (string)
      - `sources` ([] string)
      - `sourcesContent` ([] string)
      - `version` (number)
  - `compressionAlgorithm` (string)
    Compression Algorithm
  - `created` (string)
    Created date
  - `decodedSha256` (string)
    Decoded SHA-256
  - `decodedSize` (number)
    Decoded size
  - `encodedSha256` (string)
    Encoded SHA-256
  - `encodedSize` (number)
    Encoded size
  - `encryptionAlgorithm` (string)
    Encryption Algorithm
  - `id` (string)
    Identifier
  - `identifier` (string)
    Identifier
  - `packageName` (string)
    Package name
  - `relative_url` (string)
    Relative URL
  - `type` (string)
    Type
#### `400`

Bad Request response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `401`

Unauthorized response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `500`

Internal Server Error response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `501`

Not Implemented response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
## Code Examples

#### curl

```curl
curl -X GET "http://localhost:5601/api/apm/sourcemaps" \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${YOUR_API_KEY}'
```

## Response Examples

#### Get source maps response1

A successful response from `GET /api/apm/sourcemaps`.

```json
{
  "artifacts": [
    {
      "body": {
        "bundleFilepath": "/test/e2e/general-usecase/bundle.js",
        "serviceName": "foo",
        "serviceVersion": "1.0.0",
        "sourceMap": {
          "file": "static/js/main.chunk.js",
          "mappings": "mapping",
          "sourceRoot": "",
          "sources": [
            "fleet-source-map-client/src/index.css",
            "fleet-source-map-client/src/App.js",
            "webpack:///./src/index.css?bb0a",
            "fleet-source-map-client/src/index.js",
            "fleet-source-map-client/src/reportWebVitals.js"
          ],
          "sourcesContent": [
            "content"
          ],
          "version": 3
        }
      },
      "compressionAlgorithm": "zlib",
      "created": "2021-07-09T20:47:44.812Z",
      "decodedSha256": "644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
      "decodedSize": 441,
      "encodedSha256": "024c72749c3e3dd411b103f7040ae62633558608f480bce4b108cf5b2275bd24",
      "encodedSize": 237,
      "encryptionAlgorithm": "none",
      "id": "apm:foo-1.0.0-644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
      "identifier": "foo-1.0.0",
      "packageName": "apm",
      "relative_url": "/api/fleet/artifacts/foo-1.0.0/644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
      "type": "sourcemap"
    }
  ]
}
```

#### Bad request

An example of a 400 Bad Request response, returned when the request payload or query parameters fail validation.

```json
{
  "error": "Bad Request",
  "message": "[request body]: expected value of type [string] but got [undefined]",
  "statusCode": 400
}
```

#### Unauthorized

An example of a 401 Unauthorized response, returned when the request is missing valid authentication credentials.

```json
{
  "error": "Unauthorized",
  "message": "[security_exception]: missing authentication credentials for REST request",
  "statusCode": 401
}
```

#### Internal server error

An example of a 500 Internal Server Error response, returned when an unexpected error occurs while processing the request.

```json
{
  "error": "Internal Server Error",
  "message": "An internal server error occurred. Check the Kibana server logs for details.",
  "statusCode": 500
}
```

#### Not implemented

An example of a 501 Not Implemented response, returned when the source map feature is not available on the current deployment.

```json
{
  "error": "Not Implemented",
  "message": "Not Implemented",
  "statusCode": 501
}
```

