developers / API reference
Shares API
The Shares API: find a share by its code, read and edit share links, with every endpoint's fields, who may call it, its rate limit and a curl example.
This page as MarkdownGet a single share by ID
get/shares/:shareId
- Needs
- Session token
- The token from signing in, in the Authorization header.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- shares:read
- What an app's token or an API key needs.
Path parameters
shareIdrequiredThe share's id.
Response
Returns a Share.
curl 'https://api.hematite.gg/v1/shares/1' \
-H "Authorization: $HEMATITE_TOKEN"{
"id": 1,
"code": "x7Kp2QmA",
"referenceType": "Image",
"referenceId": 1,
"updatedAt": "2026-11-10T18:24:00.000Z",
"reference": {
"id": 1,
"userId": 1,
"createdAt": "2026-11-10T18:24:00.000Z",
"updatedAt": "2026-11-10T18:24:00.000Z",
"title": "Clutch on Ascent",
"description": "1v4 on the last round",
"visibility": "Unlisted",
"folderId": 1,
"views": 0,
"downloads": 0,
"favorite": false,
"application": "VALORANT",
"filename": "a1b2c3d4e5f6.png",
"size": 2457600,
"width": 1920,
"height": 1080,
"nsfw": false,
"storageId": 1,
"autoDeleteAt": null,
"hideUser": false,
"shield": false,
"nsfwLockedAt": "2026-11-10T18:24:00.000Z",
"privateLockedAt": "2026-11-10T18:24:00.000Z",
"offlineAt": "2026-11-10T18:24:00.000Z",
"storage": {
"key": "images/a1b2c3d4e5f6.png"
},
"shareId": 1,
"shareCode": "x7Kp2QmA",
"likeCount": 0,
"commentCount": 0,
"meta": {
"id": 1,
"blurHash": "string",
"dominantColor": "string",
"palette": null,
"hasAlpha": false,
"animated": false,
"orientation": 0
},
"treatment": "string",
"burn": {
"secondsPerView": 0,
"viewsEach": 0,
"viewsInAll": 0,
"then": "Blur",
"viewsUsed": 0,
"burnedAt": "string"
}
}
}Edit a share
patch/shares/:shareId
- Needs
- Session token
- The token from signing in, in the Authorization header.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- shares:write
- What an app's token or an API key needs.
Path parameters
shareIdrequiredThe share's id.
Body
codestringrequiredThe new share code: 4 to 64 characters, letters, digits, - and _, or the emoji style's emoji alone (an emoji is one character). Not one hematite keeps (its own pages and files, hosts, staff, payment and sign-in words, brands, offensive words: SHARE_CODE_KEPT), nor one another share has in any case (Nova is taken while nova exists) or had in the last year (SHARE_CODE_TAKEN); this share's own in another case is fine. Only this exact code opens it, and the old one is kept from everyone for a year. Ten changes an hour.
4 to 128 characters
Response
Returns a Share.
curl -X PATCH 'https://api.hematite.gg/v1/shares/1' \
-H "Authorization: $HEMATITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"x7Kp2QmA"}'{
"id": 1,
"code": "x7Kp2QmA",
"referenceType": "Image",
"referenceId": 1,
"updatedAt": "2026-11-10T18:24:00.000Z",
"reference": {
"id": 1,
"userId": 1,
"createdAt": "2026-11-10T18:24:00.000Z",
"updatedAt": "2026-11-10T18:24:00.000Z",
"title": "Clutch on Ascent",
"description": "1v4 on the last round",
"visibility": "Unlisted",
"folderId": 1,
"views": 0,
"downloads": 0,
"favorite": false,
"application": "VALORANT",
"filename": "a1b2c3d4e5f6.png",
"size": 2457600,
"width": 1920,
"height": 1080,
"nsfw": false,
"storageId": 1,
"autoDeleteAt": null,
"hideUser": false,
"shield": false,
"nsfwLockedAt": "2026-11-10T18:24:00.000Z",
"privateLockedAt": "2026-11-10T18:24:00.000Z",
"offlineAt": "2026-11-10T18:24:00.000Z",
"storage": {
"key": "images/a1b2c3d4e5f6.png"
},
"shareId": 1,
"shareCode": "x7Kp2QmA",
"likeCount": 0,
"commentCount": 0,
"meta": {
"id": 1,
"blurHash": "string",
"dominantColor": "string",
"palette": null,
"hasAlpha": false,
"animated": false,
"orientation": 0
},
"treatment": "string",
"burn": {
"secondsPerView": 0,
"viewsEach": 0,
"viewsInAll": 0,
"then": "Blur",
"viewsUsed": 0,
"burnedAt": "string"
}
}
}Get a share by code
get/shares/by-code
- Needs
- No token needed
- Anyone may call it.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- shares:read
- What an app's token or an API key needs.
Query
codestringrequiredThe share code
At least 1 characters
Response
Returns an object with these fields:
idintegercodestringreferenceTypeenumOne of
UserImageFilePasteShortBioFolderCommentreferenceIdintegerupdatedAtdate-timereferenceobject or FolderidintegeruserIdnumber | nullWho uploaded it; null when it hides its uploader (hideUser) and you aren't them. Its folderId is null then too: a folder names its owner.
createdAtdate-timeupdatedAtdate-timetitlestringdescriptionstringvisibilityenumOne of
UnlistedPublicPrivatefolderIdinteger | nullviewsintegerdownloadsintegerfavoritebooleanapplicationstring | nullfilenamestringsizenumberwidthintegerheightintegernsfwbooleanstorageIdintegerautoDeleteAtdate-time | nullhideUserbooleanshieldbooleannsfwLockedAtdate-time | nullprivateLockedAtdate-time | nullofflineAtdate-time | nullstorageobjectkeystring
shareIdnumbershareCodestringlikeCountnumbercommentCountnumbermetaobject | nulloptionalidnumberblurHashstring | nulldominantColorstring | nullThe colour the picture has most of: # and six hex digits, lowercase. Null until it's worked out, just after the upload, or when it can't be.
palettehasAlphaboolean | nullanimatedboolean | nullorientationnumber | null
treatmentstring | nullHow the picture is served where others see it: its owner's watermark, as a token for the cdn's t parameter (image.url() in the sdk adds it). Null when nothing is drawn on it. Without it the cdn serves the picture as it's stored.
burnobject | nullBurn's limits, on a shielded image (shield); null without them.
secondsPerViewnumber | nullThe seconds each view shows the picture; null for no limit.
viewsEachnumber | nullThe views each person gets (signed in by account, a guest by browser); null for no limit.
viewsInAllnumber | nullThe views it has in all, by anyone but its owner; null for no limit.
thenenumWhat happens once the views in all are used: Blur (burned for everyone but its owner), Private, or Delete (gone for everyone but its owner).
One of
BlurPrivateDeleteviewsUsednumberoptionalThe views in all used so far. Only its owner gets it.
burnedAtstring | nulloptionalWhen its last view in all was given; null until then. Only its owner gets it.
curl 'https://api.hematite.gg/v1/shares/by-code?code=x7Kp2QmA'{
"id": 1,
"code": "x7Kp2QmA",
"referenceType": "Image",
"referenceId": 1,
"updatedAt": "2026-11-10T18:24:00.000Z",
"reference": {
"id": 1,
"userId": 1,
"createdAt": "2026-11-10T18:24:00.000Z",
"updatedAt": "2026-11-10T18:24:00.000Z",
"title": "Clutch on Ascent",
"description": "1v4 on the last round",
"visibility": "Unlisted",
"folderId": 1,
"views": 0,
"downloads": 0,
"favorite": false,
"application": "VALORANT",
"filename": "a1b2c3d4e5f6.png",
"size": 2457600,
"width": 1920,
"height": 1080,
"nsfw": false,
"storageId": 1,
"autoDeleteAt": "2026-11-10T18:24:00.000Z",
"hideUser": false,
"shield": false,
"nsfwLockedAt": "2026-11-10T18:24:00.000Z",
"privateLockedAt": "2026-11-10T18:24:00.000Z",
"offlineAt": "2026-11-10T18:24:00.000Z",
"storage": {
"key": "images/a1b2c3d4e5f6.png"
},
"shareId": 1,
"shareCode": "x7Kp2QmA",
"likeCount": 0,
"commentCount": 0,
"meta": {
"id": 1,
"blurHash": "string",
"dominantColor": "string",
"palette": null,
"hasAlpha": false,
"animated": false,
"orientation": 0
},
"treatment": "string",
"burn": {
"secondsPerView": 0,
"viewsEach": 0,
"viewsInAll": 0,
"then": "Blur",
"viewsUsed": 0,
"burnedAt": "string"
}
}
}Get what a share's link shows where it's pasted (Discord, X, Slack and the rest): its card, as hematite serves it in the share page's tags and its oEmbed answer
get/shares/by-code/embed
The same for everyone, its owner included, as for someone signed out who holds the link: an image marked NSFW or shielded shows no picture, an image that hides its uploader names nobody, and a folder shows up to four of the pictures its cover may show.
- Needs
- No token needed
- Anyone may call it.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- shares:read
- What an app's token or an API key needs.
Query
codestringrequiredThe share code
At least 1 characters
Response
Returns an Embed.
Errors of its own
403404There's no share with this code
curl 'https://api.hematite.gg/v1/shares/by-code/embed?code=x7Kp2QmA'{
"title": "Clutch on Ascent",
"description": "1v4 on the last round",
"site": {
"name": "Ranked",
"url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
},
"author": {
"name": "Ranked",
"url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
},
"color": "#c4d4e0",
"layout": "large",
"pictures": [
{
"url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png",
"width": 1920,
"height": 1080,
"alt": "string",
"type": "image/jpeg",
"animated": false
}
],
"publishedAt": "string",
"indexable": false
}