---
title: ソースマップのアップロード
description: エラーの難読化を解除するために、ソースマップ、シンボルファイル、およびマッピングファイルを Datadog にアップロードします。 このエンドポイントを使用すると、RUM Error Tracking 用のさまざまな種類のデバッグシンボルをアップロードできます。 これにより、Datadog…
breadcrumbs: ドキュメント > API > ソースマップのアップロード
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# ソースマップのアップロード

## 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

エラーの難読化を解除するために、ソースマップ、シンボルファイル、およびマッピングファイルを Datadog にアップロードします。
このエンドポイントを使用すると、RUM Error Tracking 用のさまざまな種類のデバッグシンボルをアップロードできます。
これにより、Datadog は縮小または難読化されたコードの代わりに、読み取り可能なスタックトレースを表示できるようになります。

**リクエスト形式:**

各リクエストは、以下の 2 つのパートを含む「multipart/form-data」アップロードです。

1.「event」— アップロードメタデータ (タイプ、サービス、バージョンなど) を含む JSON エンコードされたイベント文字列
2. 1 つ以上のバイナリファイルフィールド (例:「source_map」、「symbols_archive」)

**サポートされているアップロードタイプ** (「event.type」で設定):
-「js_sourcemap」: ブラウザアプリケーション用 JavaScript ソースマップ
-「react_native_sourcemap」: モバイルアプリケーション用 React Native ソースマップ
-「jvm_mapping_file」: Android クラッシュの難読化解除用 ProGuard/R8 マッピングファイル
-「ios_symbols」: iOS クラッシュのシンボリケーション用 dSYM ファイル
-「flutter_symbol_file」: Flutter シンボルファイル
-「ndk_symbol_file」: ネイティブクラッシュ用 Android NDK シンボルファイル
-「il2cpp_mapping_file」: Unity 用 IL2CPP マッピングファイル
-「elf_symbol_file」: Linux/Unix 用 ELF シンボルファイル
-「pe_symbol_file」: Windows 用 PE/PDB シンボルファイル
-「repository」: ソースコードリンク用のリポジトリメタデータ

**制限:**

- 最大ファイルサイズ: 500 MB

**注:** ほとんどのユースケースでは、Datadog では以下の使用を推奨しています。
[Datadog CLI (datadog-ci)](https://github.com/DataDog/datadog-ci/tree/master/src/commands/sourcemaps)
ソースマップをアップロードするための簡略化されたインターフェースを提供します。

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field               | Field                            | Type    | Description                                                                                     |
| -------------------------- | -------------------------------- | ------- | ----------------------------------------------------------------------------------------------- |
|                            | JavaScript Source Map            | object  | ソースマップ、シンボルファイル、またはマッピングファイルをアップロードするためのマルチパートフォームデータ。                                          |
| JavaScript Source Map      | 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).                                                      |
| JavaScript Source Map      | minified_file [*required*]       | binary  | The minified JavaScript file.                                                                   |
| JavaScript Source Map      | repository                       | binary  | Repository metadata file (optional).                                                            |
| JavaScript Source Map      | source_map [*required*]          | binary  | The source map file.                                                                            |
|                            | React Native Source Map          | object  | Multipart form data for uploading React Native source maps for mobile applications.             |
| React Native Source Map    | 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).                                                      |
| React Native Source Map    | minified_file                    | binary  | The minified JavaScript bundle (optional).                                                      |
| React Native Source Map    | repository                       | binary  | Repository metadata file (optional).                                                            |
| React Native Source Map    | source_map [*required*]          | binary  | The source map file.                                                                            |
|                            | ProGuard/R8 Mapping File         | object  | Multipart form data for uploading ProGuard or R8 mapping files for Android crash deobfuscation. |
| ProGuard/R8 Mapping File   | 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).                                                      |
| ProGuard/R8 Mapping File   | jvm_mapping_file [*required*]    | binary  | The ProGuard/R8 mapping file.                                                                   |
| ProGuard/R8 Mapping File   | repository                       | binary  | Repository metadata file (optional).                                                            |
|                            | iOS dSYM Archive                 | object  | Multipart form data for uploading dSYM files for iOS crash symbolication.                       |
| iOS dSYM Archive           | 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).                                           |
| iOS dSYM Archive           | symbols_archive [*required*]     | binary  | The dSYM archive file (.zip).                                                                   |
|                            | Flutter Symbol File              | object  | Multipart form data for uploading Flutter symbol files for crash symbolication.                 |
| Flutter Symbol File        | 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).                                                      |
| Flutter Symbol File        | flutter_symbol_file [*required*] | binary  | The Flutter symbol file.                                                                        |
|                            | Android NDK Symbol File          | object  | Multipart form data for uploading Android NDK symbol files for native crash symbolication.      |
| Android NDK Symbol File    | 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`.                              |
| Android NDK Symbol File    | ndk_symbol_file [*required*]     | binary  | The NDK symbol file.                                                                            |
|                            | Unity IL2CPP Mapping File        | object  | Multipart form data for uploading IL2CPP mapping files for Unity crash symbolication.           |
| Unity IL2CPP Mapping File  | 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`.                      |
| Unity IL2CPP Mapping File  | il2cpp_mapping_file [*required*] | binary  | The IL2CPP mapping file.                                                                        |
|                            | ELF Symbol File                  | object  | Multipart form data for uploading ELF symbol files for Linux/Unix crash symbolication.          |
| ELF Symbol File            | elf_symbol_file [*required*]     | binary  | The ELF symbol file.                                                                            |
| ELF Symbol File            | 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`.                              |
|                            | Windows PE/PDB Symbol File       | object  | Multipart form data for uploading PE/PDB symbol files for Windows crash symbolication.          |
| Windows PE/PDB Symbol File | 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`.                                |
| Windows PE/PDB Symbol File | pe_symbol_file [*required*]      | binary  | The PDB symbol file.                                                                            |
|                            | Repository Metadata              | object  | Multipart form data for uploading repository metadata for source code linking.                  |
| Repository Metadata        | 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`.                                        |
| Repository Metadata        | 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 %}
