# Likes API

The Likes API: like and unlike images, folders and comments, with every endpoint's fields, who may call it, its rate limit and a curl example.

## Create a like

`POST /likes`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `likes:write` scope.

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `referenceType` | `enum` | required | One of `Image`, `Folder`, `Comment`. |
| `referenceId` | `number` | required |  |
| `shareCode` | `string` |  | Send exactly one of `shareCode` and `verifier`. |
| `verifier` | `string` |  | Send exactly one of `shareCode` and `verifier`. |

### Response

Returns a [Like](https://hematite.gg/docs/developers/models/like).

```bash
curl -X POST 'https://api.hematite.gg/v1/likes' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"referenceType":"Image","referenceId":1,"shareCode":"x7Kp2QmA"}'
```

Example `data`:

```json
{
  "id": 1,
  "userId": 1,
  "createdAt": "2026-11-10T18:24:00.000Z",
  "referenceType": "Image",
  "referenceId": 1
}
```

## Get a single like by ID

`GET /likes/:likeId`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `likes:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `likeId` | `any` | required | The like's id. |

### Response

Returns a [Like](https://hematite.gg/docs/developers/models/like).

```bash
curl 'https://api.hematite.gg/v1/likes/1' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "id": 1,
  "userId": 1,
  "createdAt": "2026-11-10T18:24:00.000Z",
  "referenceType": "Image",
  "referenceId": 1
}
```

## Delete a like

`DELETE /likes/:likeId`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `likes:write` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `likeId` | `any` | required | The like's id. |

### Response

`data` is empty.

```bash
curl -X DELETE 'https://api.hematite.gg/v1/likes/1' \
  -H "Authorization: $HEMATITE_TOKEN"
```
