---
title: "Upload a source map"
method: POST
path: "/api/apm/sourcemaps"
tags: ["APM sourcemaps"]
---

# Upload a source map

`POST /api/apm/sourcemaps`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/apm/sourcemaps</span></div>

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. You must have `all` Kibana privileges for the APM and User Experience feature.
The maximum payload size is `1mb`. If you attempt to upload a source map that exceeds the maximum payload size, you will get a 413 error. Before uploading source maps that exceed this default, change the maximum payload size allowed by Kibana with the `server.maxPayload` variable.

## Headers

- `elastic-api-version` '2023-10-31', required
- `kbn-xsrf` string, required

## Response `200`

Successful response

- APMUIUploadSourceMapsResponse
  - `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

## Other responses

- `400` — Bad Request response
- `401` — Unauthorized response
- `403` — Forbidden response
- `500` — Internal Server Error response
- `501` — Not Implemented response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
