Skip to content
MothershipDevelopers

GuidesTracking a shipment

Setting up authentication

Create a sandbox token and send it with every tracking request.

1 min read

As outlined in the authentication reference docs, the Mothership API handles authenticating requests via a Bearer token in the request's Authorization header.

For the purposes of this guide, use a sandbox token from the API settings page in the dashboard and put it in an environment variable.

export MOTHERSHIP_API_TOKEN="your sandbox token"

Every request you make in the sandbox environment must include this token in the Authorization header.

Authorization: Bearer {API_TOKEN_GOES_HERE}

For production requests, create a production token on the same page. If the API page isn't in your dashboard settings, contact developers@mothership.com to request API access.