developers / API reference
Sessions API
The Sessions API: make upload tokens for uploaders and delete sessions, with every endpoint's fields, who may call it, its rate limit and a curl example.
This page as MarkdownCreate an upload token
post/sessions
The response is the only time its token is shown: hematite keeps just its hash. It works until expiresAt, which is in the future and at most 366 days away.
- 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
- Signing in, sessions and upload tokens are the account's own. Nor to API keys.
Body
type"Upload"requiredexpiresAtdate-timerequired
Response
Returns a Session, plus this field:
tokenstringThe session's token (hms_… for a sign-in, hmu_… for an upload key). Shown only now; hematite keeps just a keyed hash of its secret.
curl -X POST 'https://api.hematite.gg/v1/sessions' \
-H "Authorization: $HEMATITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type":"Upload","expiresAt":"2026-11-10T18:24:00.000Z"}'{
"id": 1,
"userId": 1,
"type": "Upload",
"publicId": "m0plGGtn67kMZy6D",
"createdAt": "2026-11-10T18:24:00.000Z",
"usedAt": "2026-11-10T18:24:00.000Z",
"expiresAt": "2027-11-10T18:24:00.000Z",
"ip": "203.0.113.7",
"device": "Mozilla/5.0",
"note": "ShareX",
"token": "hms_live_m0plGGtn67kMZy6D_…"
}Delete a session
delete/sessions/:sessionId
- 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
- Signing in, sessions and upload tokens are the account's own. Nor to API keys.
Path parameters
sessionIdnumberrequired
Response
data is empty: the status says it worked.
curl -X DELETE 'https://api.hematite.gg/v1/sessions/1' \
-H "Authorization: $HEMATITE_TOKEN"