Skip to content

Uploading source maps

Honeybadger can automatically un-minify your JavaScript code if you provide a source map along with your minified files. Use the Source Map Upload API to upload your source maps to Honeybadger. See Using Source Maps to learn more.

To upload your source map files to Honeybadger, POST them to https://api.honeybadger.io/v1/source_maps with the following parameters:

ParamRequiredDescription
api_keyRequiredThe API key of your Honeybadger project (see the API Key tab in project settings).
minified_urlRequiredThe URL of your minified JavaScript file in production. * can be used as a wildcard. Must be an absolute URL (query strings are ignored).
minified_fileRequiredThe minified file itself.
source_mapRequiredThe source map for your minified file.
revisionOptional, default: masterThe deploy revision (i.e. commit sha) that your source map applies to. This could also be a code version. For best results, set it to something unique every time your code changes. The revision option must also be configured in honeybadger.js.
<additional source files>OptionalOne or more additional source files which may be referenced by your source map. The name should be the URL that would normally be used to access the file, and the value should be the file itself. Many source map generators include the sources in the sourcesContent key inside the source map, so you may not need to send these. * in the name can be used as a wildcard.

Here’s an example using curl:

Terminal window
curl https://api.honeybadger.io/v1/source_maps \
-F api_key=Your project API key \
-F revision=dcc69529edf375c72df39b0e9195d60d59db18ff \
-F minified_url=https://example.com/assets/application.min.js \
-F source_map=@path/to/application.js.map \
-F minified_file=@path/to/application.min.js \
-F http://example.com/assets/application.js=@path/to/application.js \
-F http://example.com/assets/utils.js=@path/to/utils.js

The /v1/source_maps API endpoint responds with the following codes:

CodeStatusDescription
201CreatedThe files were uploaded successfully.
400Bad RequestYou’re missing a required parameter or have exceeded the maximum file size of 80MB per file (check the error message).
401UnauthorizedYour API key is invalid.

In some cases you may want to upload the same source map for different URLs—for instance, if you serve your files from multiple subdomains, or via both HTTP and HTTPS.

An asterisk (*) can be used in URLs to perform a wildcard match. For example, the following example will match both the http:// and

https:// version of the URL:

http*://example.com/assets/application.min.js

…matches the following URLs:

http://example.com/assets/application.min.js
https://example.com/assets/application.min.js

Wildcards are not supported in file names:

// invalid (will be an exact match):
https://example.com/assets/*.min.js