Personal API keys

Call the Linky Hub API as yourself, and register and manage OAuth apps from code, with a personal API key.

Embed
Preview of the card
<a href="https://linkyhub.net/docs/api-keys"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/05a600b2-0b0d-4f2b-bcb3-0a6e6cdfbccc/social-card.svg?v=3e7ae33eec8b" alt="Personal API keys" width="600" height="315"></a>

A personal API key is a long-lived secret that acts as one Linky Hub account, with only the permissions it was given. Use one to script your own account, or hand one to the developer building your app so they can register and manage its OAuth clients without your password.

An OAuth app acts for other creators who connect it. A personal key acts for you. Keys start with ak_. Build an app end to end shows a key and an app working together.

Create a key

Dashboard → Developers → API keys:

  1. Give the key a name you will recognise later, such as the developer's name or the machine it lives on.

  2. Tick its permissions. apps:read and apps:write (managing your OAuth apps) are ticked for you; add any other scope, such as products:read, if the key should call the rest of the API too.

  3. Choose when it expires. Shorter is safer.

The key is shown once. Copy it then: Linky Hub does not keep it and cannot show it again. If you lose it, revoke it and create another. An account can hold 10 keys at a time.

apps:read and apps:write are only ever granted to personal keys. No OAuth app can ask for them.

Call the API

Send the key as a bearer token, exactly where an OAuth access token would go:

curl "$LINKHUB_URL/api/v3/apps" -H "Authorization: Bearer $LINKHUB_API_KEY"

Everything in Call the API applies: the same errors, the same 600 requests a minute, and a 403 insufficient_scope that names the scope a call needs. A revoked or expired key gets 401 invalid_token.

The MCP server takes OAuth tokens only.

Register an OAuth app

POST /api/v3/apps registers an app owned by the key's account. It needs apps:write and a confirmed email address on that account.

curl -X POST "$LINKHUB_URL/api/v3/apps" \
  -H "Authorization: Bearer $LINKHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Stock sync",
    "slug": "stock-sync",
    "tagline": "Keeps stock in step across your shops",
    "homepageUrl": "https://stocksync.example",
    "redirectUris": ["https://stocksync.example/callback"],
    "scopes": ["products:read", "inventory:write"],
    "acceptTerms": true
  }'
{ "id": "clx…", "clientId": "…", "clientSecret": "…" }

clientSecret is in this response only. Store it in your secret manager straight away.

Field

name

Up to 60 characters. Required.

slug

3–40 lowercase letters, numbers and single hyphens. Fixed once registered. Required.

homepageUrl

https, on a public host. Required.

redirectUris

1 to 5, matched exactly. Required.

scopes

What the app will ask creators for, from the scope list. Required.

acceptTerms

Must be true: you accept the developer terms. Required.

tagline, description

Shown in the directory.

widgetUrl

https; framed on the pages of creators who connect the app. Leave it out for an API-only app.

category

music, video, commerce, community, productivity, analytics or other.

isPublic

true for an app with no server (mobile, desktop, CLI): no secret, PKCE or the device flow. Fixed once registered.

The app starts in development, as described in Register an app. When it is ready, ask for review:

curl -X POST "$LINKHUB_URL/api/v3/apps/$APP_ID/submit" -H "Authorization: Bearer $LINKHUB_API_KEY"

GET /api/v3/apps lists your apps and GET /api/v3/apps/{id} reads one. PATCH /api/v3/apps/{id} changes only the fields you send; redirectUris and scopes replace the whole list. An approved app cannot add scopes.

Rotate and delete

Rotate an app's client secret. The new secret is in the response, once, and the old one keeps working for 24 hours so you can redeploy:

curl -X POST "$LINKHUB_URL/api/v3/apps/$APP_ID/rotate-secret" -H "Authorization: Bearer $LINKHUB_API_KEY"

Delete an app. Every token it holds stops working and every creator who connected it is disconnected:

curl -X DELETE "$LINKHUB_URL/api/v3/apps/$APP_ID" -H "Authorization: Bearer $LINKHUB_API_KEY"

To retire a key itself, revoke it from Dashboard → Developers → API keys. It stops working within a minute.

Keep keys safe

  • A key is as powerful as the permissions you ticked, for as long as it lives. Tick only what the job needs and set an expiry.

  • One key per person or machine, so you can revoke one without breaking the others.

  • Keep keys on servers and in secret managers. Never put one in a browser, a mobile app or a git repository.

  • If a key leaks, revoke it at once and create another. Rotate the client secret of any app it could have read.

  • Every change a key makes is recorded against your account in the audit log.

Updated