Skip to content
Dashboard

developers / API reference

API keys API

The API keys API: make personal API keys, cut child keys and turn them off, with every endpoint's fields, who may call it, its rate limit and a curl example.

This page as Markdown

Make a personal API key (`hmk_…`) for your own scripts, bots and the SDK, holding only the scopes you choose: the same ones apps ask for, and `keys:write` for a key that cuts child keys from itself

post/keys

The response is the only time its token is shown: hematite keeps just a keyed hash of its secret. It works until `expiresAt`, in the future and at most 366 days away, or 90 days when left out. An account has at most 10 API keys, each with at most 10 child keys. Only a person signed in to hematite makes one: no API key, app or upload token can. With two-step sign-in on, it asks for a fresh step-up first (401 `REAUTH_REQUIRED`, `POST /auth/reauth`).

Needs
Session token
The token from signing in, in the Authorization header.
Rate limit
10 a minute
Per address, for this endpoint.
App scope
Not open to apps
API keys are made, listed and turned off by their user, signed in to hematite. Nor to API keys.

Body

  • notestringrequired

    Its name, 1 to 40 characters: what it's for, as Settings → API keys lists it

    1 to 40 characters

  • scopesenum[]required

    What it may do: at least one scope, each once

    One ofimages:readimages:writefolders:readfolders:writeshares:readshares:writecomments:readcomments:writelikes:readlikes:writenotifications:readnotifications:writeusers:readusers:writeemailkeys:write

    At least 1 items

  • expiresAtdate-time
  • constraintsobject

    What narrows it further. Left out, it works from anywhere, as often as the api's limits allow, until it expires

Response

Returns an ApiKey, plus this field:

  • tokenstring

    The key (hmk_…), shown only now: hematite keeps just a keyed hash of its secret

Errors of its own

  • 403

  • 409

Request
curl -X POST 'https://api.hematite.gg/v1/keys' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"ShareX","scopes":["images:read"]}'
Example data
{
  "publicId": "m0plGGtn67kMZy6D",
  "note": "ShareX",
  "scopes": [
    "images:read"
  ],
  "constraints": {
    "ips": [
      "203.0.113.7"
    ],
    "perMinute": 0,
    "folderId": 1,
    "visibility": "Unlisted"
  },
  "usesLeft": 0,
  "parent": "string",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "usedAt": "2026-11-10T18:24:00.000Z",
  "expiresAt": "2026-11-10T18:24:00.000Z",
  "token": "hms_live_m0plGGtn67kMZy6D_…"
}

Turn an API key off: it stops working at once, and every child key cut from it with it

delete/keys/:publicId

Signed in, any of your keys; an API key with `keys:write`, only the children it cut. Never asks for your password again: stopping access is always one request.

Needs
Session token
The token from signing in, in the Authorization header.
Rate limit
120 a minute
Per address, for this endpoint.
App scope
Not open to apps
API keys are made, listed and turned off by their user, signed in to hematite. An API key with keys:write may, for its own child keys.

Path parameters

  • publicIdstringrequired

Response

data is empty: the status says it worked.

Errors of its own

  • 403

  • 404No API key of yours with this public id works

Request
curl -X DELETE 'https://api.hematite.gg/v1/keys/m0plGGtn67kMZy6D' \
  -H "Authorization: $HEMATITE_TOKEN"

Cut a child key from an API key (concept 22 §7.2): never wider than its parent

post/keys/:publicId/children

Its scopes are among the parent's (`keys:write` never: children are one level deep), it ends no later, works from the parent's addresses or fewer, has no more uses than the parent has left (and each of its uses is the parent's too), no higher a rate, and uploads where the parent uploads; what it doesn't name it takes from the parent. It ends when its parent does. Signed in, from any of your keys, with a fresh step-up for a child that writes when two-step sign-in is on (401 `REAUTH_REQUIRED`); an API key with `keys:write`, from itself only. A field that would make it wider answers 400 with that field's issue. At most 10 children a key. The response is the only time its token is shown.

Needs
Session token
The token from signing in, in the Authorization header.
Rate limit
30 a minute
Per address, for this endpoint.
App scope
Not open to apps
API keys are made, listed and turned off by their user, signed in to hematite. An API key with keys:write may, for its own child keys.

Path parameters

  • publicIdstringrequired

Body

  • notestringrequired

    Its name, 1 to 40 characters: what it's for, as Settings → API keys lists it

    1 to 40 characters

  • scopesenum[]required

    What it may do: at least one scope, each once

    One ofimages:readimages:writefolders:readfolders:writeshares:readshares:writecomments:readcomments:writelikes:readlikes:writenotifications:readnotifications:writeusers:readusers:writeemailkeys:write

    At least 1 items

  • expiresAtdate-time
  • constraintsobject

    What narrows it further. Left out, it works from anywhere, as often as the api's limits allow, until it expires

Response

Returns an ApiKey, plus this field:

  • tokenstring

    The key (hmk_…), shown only now: hematite keeps just a keyed hash of its secret

Errors of its own

  • 400

  • 403

  • 404No API key of yours with this public id works

  • 409

Request
curl -X POST 'https://api.hematite.gg/v1/keys/m0plGGtn67kMZy6D/children' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"ShareX","scopes":["images:read"]}'
Example data
{
  "publicId": "m0plGGtn67kMZy6D",
  "note": "ShareX",
  "scopes": [
    "images:read"
  ],
  "constraints": {
    "ips": [
      "203.0.113.7"
    ],
    "perMinute": 0,
    "folderId": 1,
    "visibility": "Unlisted"
  },
  "usesLeft": 0,
  "parent": "string",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "usedAt": "2026-11-10T18:24:00.000Z",
  "expiresAt": "2026-11-10T18:24:00.000Z",
  "token": "hms_live_m0plGGtn67kMZy6D_…"
}