Skip to content
Dashboard

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 Markdown

Get 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

  • shareIdrequired

    The share's id.

Response

Returns a Share.

Request
curl 'https://api.hematite.gg/v1/shares/1' \
  -H "Authorization: $HEMATITE_TOKEN"
Example data
{
  "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

  • shareIdrequired

    The share's id.

Body

  • codestringrequired

    The 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.

Request
curl -X PATCH 'https://api.hematite.gg/v1/shares/1' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"x7Kp2QmA"}'
Example data
{
  "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

  • codestringrequired

    The share code

    At least 1 characters

Response

Returns an object with these fields:

  • idinteger
  • codestring
  • referenceTypeenum

    One ofUserImageFilePasteShortBioFolderComment

  • referenceIdinteger
  • updatedAtdate-time
  • referenceobject or Folder
Request
curl 'https://api.hematite.gg/v1/shares/by-code?code=x7Kp2QmA'
Example data
{
  "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

  • codestringrequired

    The share code

    At least 1 characters

Response

Returns an Embed.

Errors of its own

  • 403

  • 404There's no share with this code

Request
curl 'https://api.hematite.gg/v1/shares/by-code/embed?code=x7Kp2QmA'
Example data
{
  "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
}