# Authentication & tokens

Every request needs a personal access token. Create named, scoped tokens in your workspace under **Settings → API Key** — each app gets its own token with only the permissions it needs, and you can revoke any of them at any time.

## Permissions

| Permission | Allows |
|---|---|
| `account:read` | View your account details |
| `items:read` | List and view your items |
| `sales:read` | List your sales (amounts and buyers, without purchase codes) |
| `sales:codes` | Include buyers' purchase codes in your sales — they activate licences, grant only to tools you fully trust |
| `purchases:validate` | Verify purchase codes of your buyers |
| `purchases:read` | List your own purchases (as a buyer), including your purchase codes |
| `balance:read` | View your wallet balances and earnings |
| `catalog:read` | Browse and search the public item catalog |
| `updates:read` | Check for and download updates of items you bought (SellMyCode Toolkit) |
| `items:write` | Change your items: name, description, version, tags, demo link, changelog and images (goes through review like the web form) |
| `items:price` | Change the prices of your items — a move of more than 30% waits for your confirmation by email |
| `items:upload` | Upload new versions of your items' files and new images (goes through review like the web form) |
| `tickets:read` | Read the support tickets buyers open about your items, with every message |
| `tickets:reply` | Reply to support tickets of your items and close or reopen them — replies are sent to the buyer as you |
| `tickets:note` | Add internal notes to support tickets — only you see them, never the buyer |


> **Warning:** A token is a password, not a public key. Never put one in front-end JavaScript, a mobile app bundle or a public repository — whoever holds it acts as you within its permissions. Purchase codes are secrets too: they activate licences, so `sales:read` leaves them out and only a token that also has `sales:codes` receives them. `account:read` returns your balance only together with `balance:read`. Creating a token asks for your password again, and resetting your password revokes every token and the legacy key.

Write permissions (`items:write`, `items:price`, `items:upload`) need a scoped token — the old single API key can read but never write — and come with the [Author API policy](https://sellmycode.net/api-docs/policy.md).

## Sending the token

Send the token in the `Authorization` header (recommended). The `X-Api-Key` header works too. Tokens are **not** accepted in the query string or the request body: keys in URLs end up in proxy and CDN logs. The old single "API key" from the account page was retired on 2026-10-31 — every integration uses a scoped token.
```bash
curl https://sellmycode.net/api/account/details \
  -H "Authorization: Bearer YOUR_API_KEY"
```
```bash
curl https://sellmycode.net/api/account/details \
  -H "X-Api-Key: YOUR_API_KEY"
```
## Keep tokens out of code

Store the token in a file only you can read, and have your scripts read it from there:

```bash
mkdir -p ~/.config/sellmycode && chmod 700 ~/.config/sellmycode
printf '%s' 'smc_YOUR_TOKEN' > ~/.config/sellmycode/token && chmod 600 ~/.config/sellmycode/token
```

---
Source: https://sellmycode.net/api-docs/authentication
