> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.dyspach.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Create an organisation API key and use it on every request.

Every request is authenticated with an **organisation API key**, sent in the
`x-api-key` header.

```bash theme={null}
curl https://api.dyspach.com/v1/org/quote/getQuote \
  -H "x-api-key: dzk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

## Creating a key

<Steps>
  <Step title="Open Settings → API Keys">
    In the Dyspach portal, go to **Settings → API Keys** and choose **Create new key**.
  </Step>

  <Step title="Copy the key immediately">
    The full key (`dzk_live_…`) is shown **once**, at creation. Copy it and store
    it in your secrets manager right away.

    <Warning>
      For security, only a hashed form of the key is retained — the full key
      cannot be retrieved after creation. If it is lost or compromised, revoke it
      and issue a replacement.
    </Warning>
  </Step>

  <Step title="Use it as x-api-key">
    Send the key in the `x-api-key` header on every request.
  </Step>
</Steps>

## Key handling

<CardGroup cols={2}>
  <Card title="Shown once" icon="eye-slash">
    Only the key's prefix (e.g. `dzk_live_7fe18dc`) is shown afterward, for
    identification.
  </Card>

  <Card title="Hashed at rest" icon="lock">
    The server stores only a SHA-256 hash of the key.
  </Card>

  <Card title="Multiple keys" icon="layer-group">
    Create several keys (e.g. per integration) and revoke individually.
  </Card>

  <Card title="Revocable" icon="ban">
    Revoke a key from **Settings → API Keys** at any time; it stops working immediately.
  </Card>
</CardGroup>

## Errors

<ResponseField name="401 Unauthorized" type="Missing or invalid key">
  Sent when the `x-api-key` header is absent or does not match an active key.
  Make sure you copied the **full** key, not the prefix.
</ResponseField>

See [Errors](/guides/errors) for the full list.
