Skip to content

Authentication

DocuStack uses API keys for authentication. Include your key in the Authorization header of every request.

Terminal window
curl https://api.docustack.com/v1/documents \
-H "Authorization: Bearer dk_live_your_api_key_here"

DocuStack will provide two types of API keys:

Key TypePrefixUsage
Livedk_live_Production requests
Testdk_test_Development and testing

Test keys operate against a sandboxed environment and will not affect your production data.

API keys will be available from the Settings > API section of your DocuStack dashboard once the API launches.

  • Never expose keys in client-side code. API keys should only be used in server-side applications.
  • Rotate keys periodically. You will be able to generate new keys and revoke old ones from the dashboard.
  • Use environment variables. Store keys in environment variables rather than hardcoding them.
Terminal window
export DOCUSTACK_API_KEY="dk_live_your_api_key_here"

Authentication failures return a 401 Unauthorized status:

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}