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 https://api.atatus.com/api/browser/sourcemap \ -F admin_api_key="YOUR_ADMIN_API_KEY_HERE" \ -F url=http://www.acme.com/js/main.min.js \ -F sourcemap=@js/main.min.js.map \ -F version=version_string_hereSample Request
curl https://api.atatus.com/api/browser/sourcemap \ -F admin_api_key="79769089efbb4767a542e0696448e34c" \ -F url=http://www.acme.com/js/main.min.js \ -F sourcemap=@js/main.min.js.map \ -F version=1.0.0Parameters
|admin_api_key Required||The Admin API Key associated with the project. You can find it in your project settings.|
|url Required||The full URL of the minified file. Should start with http: or https:, which we'll strip off.|
|sourcemap Required||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.|
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.
|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
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 https://api.atatus.com/api/browser/sourcemap?olderThan=1M \ -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"
curl -XDELETE https://api.atatus.com/api/browser/sourcemap?versions=1.0.0,2.0.0 \ -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"
curl -XDELETE https://api.atatus.com/api/browser/sourcemap?all=true \ -H "Authorization: token YOUR_ADMIN_API_KEY_HERE"Parameters
You have to specify one of the below parameter. But you cannot specify all them at once.
|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: