---
type: api
title: Upload source map
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-uploadsourcemap
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-uploadsourcemap
products:
  - Kibana
---

# Upload source map

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

## Paths

- `POST` `/api/apm/sourcemaps`
- `POST` `/s/{space_id}/api/apm/sourcemaps`

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

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Upload a source map for a specific service and version.

## Request Body

`multipart/form-data`

- `bundle_filepath` (string) — required
  The absolute path of the final bundle as used in the web application.
- `service_name` (string) — required
  The name of the service that the service map should apply to.
- `service_version` (string) — required
  The version of the service that the service map should apply to.
- `sourcemap` (string) — required
  The source map. String or file upload. It must follow the
[source map revision 3 proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k).

## Responses

#### `200`

Successful response

`application/json`

- `body` (string)
- `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
#### `403`

Forbidden 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

#### Console

```console
POST /api/apm/sourcemaps
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/apm/sourcemaps" \
  -H "elastic-api-version: string" \
  -H "kbn-xsrf: true"
```

