Source Maps API

Source Maps API helps you to upload and delete source maps.

Upload source maps

If you don't want to expose your source map or code to the public web, you can upload them directly to Atatus. At the beginning of your deploy script (before the new code is in production), you can upload a source map via our API.

curl \
  -H "Authorization: token YOUR_ADMIN_API_KEY_HERE" \
  -F url= \
  -F sourcemap=@js/ \
  -F version=version_string_here
Name Description
url The full URL of the minified file. Should start with http: or https:, which we'll strip off.
sourcemap The contents of the source map, as a multipart file upload.
version (optional) A string identifying what version of your code this source map is for. It is optional.

Heads up!
Version number is necessary only if the script file name(url) is same across all deployments. You can read When you should use version number. If you set a version number in source map, you must set version in atatus snippet too and vice versa. atatus.setVersion('version_string_here');.

Response Codes
Status Code Meaning
200 Ok - Uploaded successfully
422 Unprocessable Entity - There was an error validating the upload.

You can find Admin API Key in your project settings. We store the source map by project+minified URL+version. If you upload it more than once, each subsequent upload will overwrite the previous data.

You can read more about source maps here

Delete source maps

You can delete your older source maps through Delete API. With this API, you can delete either all source maps or specific versions of source maps or older than specific days.

curl -XDELETE \
  -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"
curl -XDELETE,2.0.0 \
  -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"
curl -XDELETE \
  -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"

You have to specify one of the below parameter. But you cannot specify all them at once.

Name Description
olderThan The time duration. The source maps older than specified time duration will be deleted. Eg: 1d, 2d, 3d, 7d, 14d, 1M, 2M, 3M
versions The comma separated version numbers of the source map to be deleted
all Delete all source maps. It must be set to true. Eg: all=true
Document Sections