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 MarkdownMake 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
notestringrequiredIts name, 1 to 40 characters: what it's for, as Settings → API keys lists it
1 to 40 characters
scopesenum[]requiredWhat it may do: at least one scope, each once
One of
images:readimages:writefolders:readfolders:writeshares:readshares:writecomments:readcomments:writelikes:readlikes:writenotifications:readnotifications:writeusers:readusers:writeemailkeys:writeAt least 1 items
expiresAtdate-timeconstraintsobjectWhat narrows it further. Left out, it works from anywhere, as often as the api's limits allow, until it expires
ipsstring[]Where it works from: up to 16 single addresses or CIDR ranges, IPv4 or IPv6. A request from anywhere else is refused as if the key were wrong
1 to 16 items
perMinuteintegerAt most this many requests a minute, across every endpoint, 1 to 120; a 429 past it
1 to 120
usesLeftintegerHow many requests it makes before it ends by itself, each request one
1 to 1000000
folderIdnumber | nullA folder of yours: every image the key uploads goes into it, whatever the upload says. Needs images:write; null for none
visibilityenumEvery image the key uploads gets this visibility, whatever the upload says. Needs images:write
One of
UnlistedPublicPrivate
Response
Returns an ApiKey, plus this field:
tokenstringThe key (hmk_…), shown only now: hematite keeps just a keyed hash of its secret
Errors of its own
403409
curl -X POST 'https://api.hematite.gg/v1/keys' \
-H "Authorization: $HEMATITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"note":"ShareX","scopes":["images:read"]}'{
"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
403404No API key of yours with this public id works
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
notestringrequiredIts name, 1 to 40 characters: what it's for, as Settings → API keys lists it
1 to 40 characters
scopesenum[]requiredWhat it may do: at least one scope, each once
One of
images:readimages:writefolders:readfolders:writeshares:readshares:writecomments:readcomments:writelikes:readlikes:writenotifications:readnotifications:writeusers:readusers:writeemailkeys:writeAt least 1 items
expiresAtdate-timeconstraintsobjectWhat narrows it further. Left out, it works from anywhere, as often as the api's limits allow, until it expires
ipsstring[]Where it works from: up to 16 single addresses or CIDR ranges, IPv4 or IPv6. A request from anywhere else is refused as if the key were wrong
1 to 16 items
perMinuteintegerAt most this many requests a minute, across every endpoint, 1 to 120; a 429 past it
1 to 120
usesLeftintegerHow many requests it makes before it ends by itself, each request one
1 to 1000000
folderIdnumber | nullA folder of yours: every image the key uploads goes into it, whatever the upload says. Needs images:write; null for none
visibilityenumEvery image the key uploads gets this visibility, whatever the upload says. Needs images:write
One of
UnlistedPublicPrivate
Response
Returns an ApiKey, plus this field:
tokenstringThe key (hmk_…), shown only now: hematite keeps just a keyed hash of its secret
Errors of its own
400403404No API key of yours with this public id works409
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"]}'{
"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_…"
}