---
title: "Authorization"
description: "Every request to the Stablegate API carries your API key in the X-Api-Key header. Requests go to https://api.stablegate.com."
canonical_url: "https://docs.stablegate.com/docs/apiref/auth"
---
# Authorization

> Every request to the Stablegate API carries your API key in the X-Api-Key header. Requests go to https://api.stablegate.com.

Every request to the Stablegate API carries your API key in the `X-Api-Key` header. Requests go to `https://api.stablegate.com`.

Generate the key in the :dev-portal-link{label="Developers"} section of the Stablegate app. The partner API does not require request signing.

::code-switcher{method="GET" path="/v1/bank-providers/"}
```bash
curl https://api.stablegate.com/v1/bank-providers/ \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

## Error responses

A missing or invalid key is answered with `401`; a key without access to the requested resource, or without the Partner API enabled for the account, with `403`. Both use the common error envelope:

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      <code>
        error_code
      </code>
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        401
      </code>
    </td>
    
    <td>
      <code>
        devapi_unauthorized_error
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        403
      </code>
    </td>
    
    <td>
      <code>
        devapi_forbidden_error
      </code>
    </td>
  </tr>
</tbody>
</table>

```json
{
  "trace_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "error_code": "devapi_unauthorized_error",
  "message": "<reason>",
  "detail": "<reason>"
}
```

`message` explains the reason in plain text and its wording can change, so branch on `error_code`. The `detail` key is still returned for now and will be removed in a later release.

See [Authentication](https://docs.stablegate.com/docs/guide/getting-started/authentication) in the guide for creating keys, key rotation and code examples.


## Sitemap

See the full [sitemap](https://docs.stablegate.com/sitemap.md) for all pages.
