Upload a source map

POST /api/apm/sourcemaps

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 string Required

    The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

multipart/form-data

Body Required

  • 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(binary) Required

    The source map. It can be a string or file upload. It must follow the source map format specification.

Responses

  • 200 application/json

    Successful response

    Hide response attributes Show response attributes object
    • 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 application/json

    Bad Request response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 401 application/json

    Unauthorized response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 403 application/json

    Forbidden response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 500 application/json

    Internal Server Error response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 501 application/json

    Not Implemented response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

POST /api/apm/sourcemaps
curl -X POST "http://localhost:5601/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${YOUR_API_KEY}' \
-F 'service_name="foo"' \
-F 'service_version="1.0.0"' \
-F 'bundle_filepath="/test/e2e/general-usecase/bundle.js"' \
-F 'sourcemap="{\"version\":3,\"file\":\"static/js/main.chunk.js\",\"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\"],\"mappings\":\"mapping\",\"sourceRoot\":\"\"}"' 
Response examples (200)
A successful response from `POST /api/apm/sourcemaps`.
{
  "id": "apm:foo-1.0.0-644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
  "body": "eJyFkL1OwzAUhd/Fc+MbYMuCEBIbHRjKgBgc96R16tiWr1OQqr47NwqJxEK3q/PzWccXxchnZ7E1A1SjuhjVZtF2yOxiEPlO17oWox3D3uPFeSRTjmJQARfCPeiAgGx8NTKsYdAc1T3rwaSJGcds8Sp3c1HnhfywUZ3QhMTFFGepZxqMC9oex3CS9tpk1XyozgOlmoVKuJX1DqEQZ0su7PGtLU+V/3JPKc3cL7TJ2FNDRPov4bFta3MDM4f7W69lpJjLO9qdK8bzVPhcJz3HUCQ4LbO/p5hCSC4cZPByrp/wFqOklbpefwAhzpqI",
  "type": "sourcemap",
  "created": "2021-07-09T20:47:44.812Z",
  "identifier": "foo-1.0.0",
  "decodedSize": 441,
  "encodedSize": 237,
  "packageName": "apm",
  "relative_url": "/api/fleet/artifacts/foo-1.0.0/644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
  "decodedSha256": "644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
  "encodedSha256": "024c72749c3e3dd411b103f7040ae62633558608f480bce4b108cf5b2275bd24",
  "encryptionAlgorithm": "none",
  "compressionAlgorithm": "zlib"
}