Skip to main content
Authenticate your requests to the Bastion API by obtaining an API key from the Bastion dashboard and passing it in the Authorization HTTP header.

API environments

Bastion provides two environments:

Obtain an API key

Contact our sales team at sales@bastion.com to gain access to the Bastion platform. Our team will review your request and respond with access credentials along with additional instructions and terms of use. Once you have dashboard access, you can create API keys directly from the Bastion dashboard:
  1. Navigate to the API keys tab in the left sidebar.
    Bastion sandbox dashboard
  2. Select Create new API Key and enter a name for the key.
    Create new API key dialog in the sandbox dashboard
  3. Copy and securely store the generated secret key — it won’t be retrievable after this step.
    Newly created secret API key shown in the sandbox dashboard
Your API key is unique to your organization. Do not share it with unauthorized individuals or expose it in client-side code, public repositories, or configuration files.

Pass the API key in request headers

Once you have obtained your API key, include it in the HTTP request headers for every API call:
  1. Set the Authorization header in your HTTP requests.
  2. Use the Bearer scheme followed by a space and your API key:
  3. Replace <your-api-key> with the actual key provided to you.

Example requests

A successful authenticated request returns a 200 response. If your key is missing or invalid, you’ll receive a 401 Unauthorized response.

Next steps

  • Explore the Sandbox access page for details on the sandbox environment and dashboard
  • Browse the API reference to see available endpoints