Logo of AppSignal

Menu
Documentation navigation

Sourcemaps API

Sourcemaps are used to get the original line and column number from a minified backtrace.

This API provides an easy way to upload private sourcemaps for use with frontend errors.

Table of Contents

Sourcemap create

This endpoint enables the creation of private sourcemaps.

Endpoint /api/sourcemaps
Request method POST
Content-Type multipart/form-data
Requires authentication? Yes (Push API key)
Response formats JSON

Parameters

All parameters, except for file can be sent either in the POST body or as GET parameters. All parameters are required.

Parameter Type Description
push_api_key String Your organization's Push API key.
app_name String Name of application in AppSignal the sourcemap is meant for.
environment String Environment of application in AppSignal the sourcemap is meant for.
revision String Deploy marker revision reference.
name Array of Strings List of filenames that the sourcemap covers. This should be a full URL to the minified JavaScript file.
file File Sourcemap to upload.

Responses

  • The API will return a 201 HTTP status code if successful.
  • The API will return a 400 HTTP status code with a JSON response when a validation error has occurred.
  • The API will return a 404 HTTP status code if none of the referenced objects can be found.

400 response body example:

1
{ "errors": ["The following errors were found: Name can't be empty"] }

Example

1
2
3
4
5
curl -k -X POST -H 'Content-Type: multipart/form-data' \
  -F 'name[]=https://localhost:3000/application.min.js' \
  -F 'revision=abcdef' \
  -F 'file=@/~project/application.js.map' \
  'https://appsignal.com/api/sourcemaps?push_api_key=xxx&app_name=MyApp&environment=development'

We'd like to set cookies, read why.