---
title: Upload source maps
description: Upload source maps, symbol files, and mapping files to Datadog for error deobfuscation.
breadcrumbs: Documentación > API > Upload source maps
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/llms.txt).

# Upload source maps

## v2 (latest)

{% alert level="warning" %}
This endpoint is in Preview and may introduce breaking changes.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                  |
| ----------------- | ------------------------------------------------------------- |
| app.datadoghq.com | POST https://sourcemap-intake.datadoghq.com/api/v2/srcmap     |
| us3.datadoghq.com | POST https://sourcemap-intake.us3.datadoghq.com/api/v2/srcmap |
| us5.datadoghq.com | POST https://sourcemap-intake.us5.datadoghq.com/api/v2/srcmap |
| app.datadoghq.eu  | POST https://sourcemap-intake.datadoghq.eu/api/v2/srcmap      |
| ap1.datadoghq.com | POST https://sourcemap-intake.ap1.datadoghq.com/api/v2/srcmap |
| ap2.datadoghq.com | POST https://sourcemap-intake.ap2.datadoghq.com/api/v2/srcmap |
| app.ddog-gov.com  | POST https://sourcemap-intake.ddog-gov.com/api/v2/srcmap      |
| uk1.datadoghq.com | POST Not supported in the UK1 region                          |
| us2.ddog-gov.com  | POST Not supported in the US2-FED region                      |

### Overview

Upload source maps, symbol files, and mapping files to Datadog for error deobfuscation.
This endpoint enables you to upload various types of debug symbols for RUM Error Tracking,
allowing Datadog to display readable stack traces instead of minified or obfuscated code.

**Request format:**

Each request is a `multipart/form-data` upload containing two parts:

1. `event` — a JSON-encoded string with the upload metadata (type, service, version, etc.)
1. One or more binary file fields (for example, `source_map`, `symbols_archive`)

**Supported upload types** (set via `event.type`):

- `js_sourcemap`: JavaScript source maps for browser applications
- `react_native_sourcemap`: React Native source maps for mobile applications
- `jvm_mapping_file`: ProGuard/R8 mapping files for Android crash deobfuscation
- `ios_symbols`: dSYM files for iOS crash symbolication
- `flutter_symbol_file`: Flutter symbol files
- `ndk_symbol_file`: Android NDK symbol files for native crashes
- `il2cpp_mapping_file`: IL2CPP mapping files for Unity
- `elf_symbol_file`: ELF symbol files for Linux/Unix
- `pe_symbol_file`: PE/PDB symbol files for Windows
- `repository`: Repository metadata for source code linking

**Limits:**

- Maximum file size: 500 MB

**Note:** For most use cases, Datadog recommends using the
[Datadog CLI (datadog-ci)](https://github.com/DataDog/datadog-ci/tree/master/src/commands/sourcemaps)
which provides a simplified interface for uploading source maps.

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                            | Type    | Description                                                                                     |
| ------------ | -------------------------------- | ------- | ----------------------------------------------------------------------------------------------- |
|              | Option 1                         | object  | Multipart form data for uploading JavaScript source maps for browser RUM applications.          |
| Option 1     | event [*required*]               | object  | Metadata for a JavaScript source map upload, sent as a JSON-encoded `event` field.              |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | git_commit_sha                   | string  | Git commit SHA (40 lowercase hex characters).                                                   |
| event        | git_repository_url               | string  | Git repository URL (max 2048 characters).                                                       |
| event        | minified_url [*required*]        | string  | URL of the minified JavaScript file (1-2048 characters).                                        |
| event        | overwrite                        | boolean | Whether to overwrite existing source map. Default: `false`.                                     |
| event        | project_path                     | string  | Path to the project root (max 500 characters).                                                  |
| event        | service [*required*]             | string  | Service name (1-200 characters).                                                                |
| event        | type [*required*]                | enum    | Must be `js_sourcemap`. Allowed enum values: `js_sourcemap`.                                    |
| event        | version [*required*]             | string  | Version of the service (1-200 characters).                                                      |
| Option 1     | minified_file [*required*]       | binary  | The minified JavaScript file.                                                                   |
| Option 1     | repository                       | binary  | Repository metadata file (optional).                                                            |
| Option 1     | source_map [*required*]          | binary  | The source map file.                                                                            |
|              | Option 2                         | object  | Multipart form data for uploading React Native source maps for mobile applications.             |
| Option 2     | event [*required*]               | object  | Metadata for a React Native source map upload, sent as a JSON-encoded `event` field.            |
| event        | build_number                     | string  | Build number (max 200 characters).                                                              |
| event        | bundle_name [*required*]         | string  | Name of the JavaScript bundle (1-200 characters).                                               |
| event        | bundle_version                   | string  | Bundle version (max 200 characters).                                                            |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | debug_id                         | string  | Debug identifier for the source map file.                                                       |
| event        | platform [*required*]            | enum    | Target platform for mobile source maps. Allowed enum values: `android`, `ios`.                  |
| event        | project_path                     | string  | Path to the project root (max 500 characters).                                                  |
| event        | service [*required*]             | string  | Service name (1-200 characters).                                                                |
| event        | type [*required*]                | enum    | Must be `react_native_sourcemap`. Allowed enum values: `react_native_sourcemap`.                |
| event        | version [*required*]             | string  | Version of the service (1-200 characters).                                                      |
| Option 2     | minified_file                    | binary  | The minified JavaScript bundle (optional).                                                      |
| Option 2     | repository                       | binary  | Repository metadata file (optional).                                                            |
| Option 2     | source_map [*required*]          | binary  | The source map file.                                                                            |
|              | Option 3                         | object  | Multipart form data for uploading ProGuard or R8 mapping files for Android crash deobfuscation. |
| Option 3     | event [*required*]               | object  | Metadata for a ProGuard or R8 mapping file upload, sent as a JSON-encoded `event` field.        |
| event        | build_id                         | string  | Build identifier for the mapping file.                                                          |
| event        | overwrite                        | boolean | Whether to overwrite existing mapping file. Default: `false`.                                   |
| event        | service [*required*]             | string  | Service name (1-200 characters).                                                                |
| event        | type [*required*]                | enum    | Must be `jvm_mapping_file`. Allowed enum values: `jvm_mapping_file`.                            |
| event        | variant                          | string  | Build variant (max 200 characters).                                                             |
| event        | version [*required*]             | string  | Version of the service (1-200 characters).                                                      |
| Option 3     | jvm_mapping_file [*required*]    | binary  | The ProGuard/R8 mapping file.                                                                   |
| Option 3     | repository                       | binary  | Repository metadata file (optional).                                                            |
|              | Option 4                         | object  | Multipart form data for uploading dSYM files for iOS crash symbolication.                       |
| Option 4     | event [*required*]               | object  | Metadata for an iOS dSYM file upload, sent as a JSON-encoded `event` field.                     |
| event        | type [*required*]                | enum    | Must be `ios_symbols`. Allowed enum values: `ios_symbols`.                                      |
| event        | uuids [*required*]               | string  | Comma-separated list of dSYM UUIDs (min 1 character).                                           |
| Option 4     | symbols_archive [*required*]     | binary  | The dSYM archive file (.zip).                                                                   |
|              | Option 5                         | object  | Multipart form data for uploading Flutter symbol files for crash symbolication.                 |
| Option 5     | event [*required*]               | object  | Metadata for a Flutter symbol file upload, sent as a JSON-encoded `event` field.                |
| event        | arch [*required*]                | string  | CPU architecture (1-200 characters).                                                            |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | platform [*required*]            | string  | Target platform (1-200 characters).                                                             |
| event        | service [*required*]             | string  | Service name (1-200 characters).                                                                |
| event        | type [*required*]                | enum    | Must be `flutter_symbol_file`. Allowed enum values: `flutter_symbol_file`.                      |
| event        | variant [*required*]             | string  | Build variant (1-200 characters).                                                               |
| event        | version [*required*]             | string  | Version of the service (1-200 characters).                                                      |
| Option 5     | flutter_symbol_file [*required*] | binary  | The Flutter symbol file.                                                                        |
|              | Option 6                         | object  | Multipart form data for uploading Android NDK symbol files for native crash symbolication.      |
| Option 6     | event [*required*]               | object  | Metadata for an Android NDK symbol file upload, sent as a JSON-encoded `event` field.           |
| event        | arch [*required*]                | string  | CPU architecture (1-200 characters).                                                            |
| event        | build_id [*required*]            | string  | Build ID (1-200 characters).                                                                    |
| event        | filename                         | string  | Original filename (max 500 characters).                                                         |
| event        | type [*required*]                | enum    | Must be `ndk_symbol_file`. Allowed enum values: `ndk_symbol_file`.                              |
| Option 6     | ndk_symbol_file [*required*]     | binary  | The NDK symbol file.                                                                            |
|              | Option 7                         | object  | Multipart form data for uploading IL2CPP mapping files for Unity crash symbolication.           |
| Option 7     | event [*required*]               | object  | Metadata for a Unity IL2CPP mapping file upload, sent as a JSON-encoded `event` field.          |
| event        | build_id [*required*]            | string  | Build ID (1-200 characters).                                                                    |
| event        | type [*required*]                | enum    | Must be `il2cpp_mapping_file`. Allowed enum values: `il2cpp_mapping_file`.                      |
| Option 7     | il2cpp_mapping_file [*required*] | binary  | The IL2CPP mapping file.                                                                        |
|              | Option 8                         | object  | Multipart form data for uploading ELF symbol files for Linux/Unix crash symbolication.          |
| Option 8     | elf_symbol_file [*required*]     | binary  | The ELF symbol file.                                                                            |
| Option 8     | event [*required*]               | object  | Metadata for an ELF symbol file upload, sent as a JSON-encoded `event` field.                   |
| event        | arch                             | string  | CPU architecture (max 200 characters).                                                          |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | file_hash                        | string  | File hash (32 hex characters, or empty).                                                        |
| event        | filename                         | string  | Original filename (max 500 characters).                                                         |
| event        | gnu_build_id                     | string  | GNU Build ID (16+ hex characters, or empty).                                                    |
| event        | go_build_id                      | string  | Go Build ID (or redacted, or empty).                                                            |
| event        | origin                           | string  | Origin identifier (max 200 characters).                                                         |
| event        | origin_version                   | string  | Origin version (max 200 characters).                                                            |
| event        | overwrite                        | boolean | Whether to overwrite existing symbol file. Default: `false`.                                    |
| event        | symbol_source                    | string  | Symbol source (max 200 characters).                                                             |
| event        | type [*required*]                | enum    | Must be `elf_symbol_file`. Allowed enum values: `elf_symbol_file`.                              |
|              | Option 9                         | object  | Multipart form data for uploading PE/PDB symbol files for Windows crash symbolication.          |
| Option 9     | event [*required*]               | object  | Metadata for a PE/PDB symbol file upload, sent as a JSON-encoded `event` field.                 |
| event        | arch [*required*]                | string  | CPU architecture (1-200 characters).                                                            |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | filename                         | string  | Original filename (max 500 characters).                                                         |
| event        | origin                           | string  | Origin identifier (max 200 characters).                                                         |
| event        | origin_version                   | string  | Origin version (max 200 characters).                                                            |
| event        | overwrite                        | boolean | Whether to overwrite existing symbol file. Default: `false`.                                    |
| event        | pdb_age [*required*]             | int64   | PDB age (>= 0).                                                                                 |
| event        | pdb_sig [*required*]             | string  | PDB signature GUID.                                                                             |
| event        | type [*required*]                | enum    | Must be `pe_symbol_file`. Allowed enum values: `pe_symbol_file`.                                |
| Option 9     | pe_symbol_file [*required*]      | binary  | The PDB symbol file.                                                                            |
|              | Option 10                        | object  | Multipart form data for uploading repository metadata for source code linking.                  |
| Option 10    | event [*required*]               | object  | Metadata for a repository upload, sent as a JSON-encoded `event` field.                         |
| event        | cli_version                      | string  | Version of the CLI used for upload (max 50 characters).                                         |
| event        | git_commit_sha [*required*]      | string  | Git commit SHA (40 lowercase hex characters).                                                   |
| event        | git_repository_url [*required*]  | string  | Git repository URL (max 2048 characters).                                                       |
| event        | type [*required*]                | enum    | Must be `repository`. Allowed enum values: `repository`.                                        |
| Option 10    | repository [*required*]          | binary  | Repository metadata file.                                                                       |
{% /tab %}

{% tab label="Example" %}
**JavaScript Source Map Upload**

```bash
-F 'event={"git_commit_sha":"a1b2c3d4e5f6789012345678901234567890abcd","git_repository_url":"https://github.com/myorg/my-web-app","minified_url":"https://example.com/static/js/main.min.js","service":"my-web-app","type":"js_sourcemap","version":"1.2.3"};type=application/json'
-F 'minified_file=@main.min.js'
-F 'source_map=@main.min.js.map'
```

**ELF Symbol File Upload**

```bash
-F 'elf_symbol_file=@libmyapp.so'
-F 'event={"arch":"x86_64","gnu_build_id":"abcdef1234567890abcdef1234567890","type":"elf_symbol_file"};type=application/json'
```

**Flutter Symbol File Upload**

```bash
-F 'event={"arch":"arm64","platform":"android","service":"my-flutter-app","type":"flutter_symbol_file","variant":"release","version":"1.0.0"};type=application/json'
-F 'flutter_symbol_file=@app.symbols'
```

**Unity IL2CPP Mapping File Upload**

```bash
-F 'event={"build_id":"unity-build-12345","type":"il2cpp_mapping_file"};type=application/json'
-F 'il2cpp_mapping_file=@il2cpp_data.dat'
```

**iOS dSYM Upload**

```bash
-F 'event={"type":"ios_symbols","uuids":"A1B2C3D4-E5F6-7890-ABCD-EF1234567890"};type=application/json'
-F 'symbols_archive=@MyApp.dSYM.zip'
```

**ProGuard/R8 Mapping File Upload**

```bash
-F 'event={"service":"my-android-app","type":"jvm_mapping_file","variant":"release","version":"3.1.0"};type=application/json'
-F 'jvm_mapping_file=@mapping.txt'
```

**Android NDK Symbol File Upload**

```bash
-F 'event={"arch":"arm64-v8a","build_id":"abc123def456","type":"ndk_symbol_file"};type=application/json'
-F 'ndk_symbol_file=@libnative.so'
```

**Windows PE/PDB Symbol File Upload**

```bash
-F 'event={"arch":"x64","pdb_age":1,"pdb_sig":"A1B2C3D4-E5F6-7890-ABCD-EF1234567890","type":"pe_symbol_file"};type=application/json'
-F 'pe_symbol_file=@myapp.pdb'
```

**React Native Source Map Upload**

```bash
-F 'event={"build_number":"100","bundle_name":"main.jsbundle","platform":"ios","service":"my-mobile-app","type":"react_native_sourcemap","version":"2.0.0"};type=application/json'
-F 'source_map=@main.jsbundle.map'
```

**Repository Metadata Upload**

```bash
-F 'event={"git_commit_sha":"a1b2c3d4e5f6789012345678901234567890abcd","git_repository_url":"https://github.com/myorg/my-web-app","type":"repository"};type=application/json'
-F 'repository=@repository.json'
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response for source map upload.

| Parent field | Field | Type   | Description                                                    |
| ------------ | ----- | ------ | -------------------------------------------------------------- |
|              | data  | object | Data envelope for source map upload response.                  |
| data         | id    | string | Unique identifier for the uploaded source map.                 |
| data         | type  | enum   | Type of the response. Allowed enum values: `sourcemap_upload`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "id": "sourcemap-upload-id",
    "type": "sourcemap_upload"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="202" %}
Accepted - the request has been accepted for processing.

{% tabs %}
{% tab label="Model" %}
Response for source map upload.

| Parent field | Field | Type   | Description                                                    |
| ------------ | ----- | ------ | -------------------------------------------------------------- |
|              | data  | object | Data envelope for source map upload response.                  |
| data         | id    | string | Unique identifier for the uploaded source map.                 |
| data         | type  | enum   | Type of the response. Allowed enum values: `sourcemap_upload`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "id": "sourcemap-upload-id",
    "type": "sourcemap_upload"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request - Invalid request body or missing required fields.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized - Invalid or missing API key.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden - Insufficient permissions.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found - The requested resource was not found.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="408" %}
Request Timeout - The request took too long to complete.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="413" %}
Payload Too Large - File size exceeds the 500 MB limit.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too Many Requests - Rate limit exceeded.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="503" %}
Service Unavailable - The service is temporarily unavailable.

{% tabs %}
{% tab label="Model" %}
Error response for source map upload.

| Field  | Type     | Description       |
| ------ | -------- | ----------------- |
| errors | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Missing required field: service"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, ddog-gov.com
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"
```
{% /tab %}
{% /tabs %}
