# Authentication

> How to send your API key, and how to replace it.

Every request carries your API key. Vink looks up your company from the key; no route takes a customer number or company as a parameter.

## Send the key in a header

Use the `Authorization` header with the `Bearer` scheme:

```http
GET /catalog/json HTTP/1.1
Host: api.prod.myvink.be
Authorization: Bearer <your key>
```

The `X-Api-Key` header works as well:

```sh
curl -H "X-Api-Key: $VINK_API_KEY" https://api.prod.myvink.be/catalog/json
```

Send one key per request. When a request carries two different keys, for example one in `Authorization` and another in `X-Api-Key`, it is refused with `400 AMBIGUOUS_KEY`.

## Why not in the URL

The catalog endpoint still accepts the key in the query string (`?key=`) for older systems that cannot set a header. Do not use it for new integrations: URLs end up in proxy logs, server logs and browser history, and so does the key. The [MCP server](/mcp/) does not read a key from the URL at all.

## One key per purpose

A catalog key only works on the catalog endpoint and an MCP key only on the MCP server. A key of the wrong kind gets `401 UNAUTHORIZED`.

## Replacing a key

Replace a key when someone who knew it leaves, when it may have leaked, or on a fixed schedule.

1. Create a new key in MyVink under **Connections**, or ask your contact person for a new catalog key.
2. Put the new key in your systems.
3. Revoke the old key in MyVink.

A revoked or paused key stops working within a few minutes and then gets `401 UNAUTHORIZED`.
