# Authentication and scopes

> The Seller API isn’t open to every seller yet. You can read the docs now; API keys and the Claude connector work once the API is turned on for your account. To ask for access, contact us: https://gathermark.com/help

Every request carries a seller API key as a Bearer token:

```http
Authorization: Bearer gm_live_your_key_here
```

```bash
curl "https://api.gathermark.com/v1/me" \
  -H "Authorization: Bearer $GATHERMARK_API_KEY"
```

The same key works for the REST API (`https://api.gathermark.com/v1/...`) and the MCP server (`https://api.gathermark.com/mcp`).

The Claude connector doesn't use a key: it signs in with your Gathermark account (OAuth) and you approve it on a consent page. See [Use with Claude](https://gathermark.com/developers/use-with-claude). Apps connected that way are listed under **Connected apps** on the API keys page, where you can revoke them.

## API keys

- Create and revoke keys in **Dashboard › Settings › API keys**, once the Seller API is turned on for your account.
- The full key is shown **once**, when you create it. Gathermark stores only a hash, so nobody (including our support team) can show it to you again. If you lose it, revoke it and create a new one.
- You can have up to **5 active keys**. Give each one a name that says where it is used, so you know which one to revoke.
- The dashboard shows each key's first characters, last four characters, when it was last used and when it expires. Keys nobody has used for 90 days or more are flagged so you can revoke them.

## Key expiry

Every key has an expiry, chosen when you create it: **30, 60, 90 or 180 days, 1 year, or never**. The default is 90 days. The expiry can't be changed later: when a key is about to expire, create a new key, switch your script over, then revoke the old one.

An expired key stops working straight away. Requests with it get `401` `key_expired`:

```json
{
  "error": {
    "code": "key_expired",
    "message": "This API key has expired. Create a new key in Settings > API keys on Gathermark."
  }
}
```

Expired keys don't count towards the 5 active keys. Keys created before expiry was introduced never expire.

## Key prefixes

| Prefix | Where it works |
|---|---|
| `gm_live_` | Production (gathermark.com) |
| `gm_test_` | Staging and test environments |

A key used against the wrong environment is rejected with `401`.

## Scopes

| Scope | Allows |
|---|---|
| `listings:read` | `GET` endpoints: your account, vocabulary, communities, your listings |
| `listings:write` | Creating, changing and deleting **drafts** |
| `shipping:read` | `GET /v1/shipping-profiles`: your shipping profiles (a draft needs one to be publishable) |
| `shipping:write` | Creating, changing and deleting shipping profiles |

New keys get `listings:read`, `listings:write` and `shipping:read` unless you untick one. Every other scope is off until you tick it. A key for a read-only reporting script only needs `listings:read`. Keys made before `shipping:read` existed were given it automatically if they had `listings:read`.

Some things are never available through the API, whatever the scopes: refunds, payouts, account and PayPal settings, deleting your account, and creating API keys.

There is no publish scope: publishing always happens on the site.

## What the status codes mean

| Status | Meaning |
|---|---|
| `401` `unauthorized` | The key is missing, malformed, revoked, or from another environment. Check the header is exactly `Authorization: Bearer <key>`. |
| `401` `key_expired` | The key has passed its expiry date. Create a new key and revoke the old one. |
| `403` `insufficient_scope` | The key is valid but does not have the scope this endpoint needs. |
| `403` `api_access_suspended` | API access is suspended for your account. [Contact Gathermark support](https://gathermark.com/help#contact). |
| `404` `not_found` | The resource does not exist **or belongs to another seller**. Gathermark never confirms that another seller's listing exists. If the API itself is not enabled for your account, every endpoint returns `404`. |

## Keeping keys safe

- Do not commit keys to source control or paste them into shared documents.
- Use one key per script or tool, so revoking one does not break the others.
- Revoke a key straight away if it might have leaked.
- Pick the shortest expiry that suits the job, and revoke keys you no longer use.
