Skip to content

Labelers

Manage external labeler subscriptions. See the Labelers guide for background.

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };
POST /admin/labelers

Requires labelers:create permission.

const response = await fetch("http://127.0.0.1:3000/admin/labelers", {
method: "POST",
headers: {
...headers,
"Content-Type": "application/json",
},
body: JSON.stringify({ did: "did:plc:ar7c4by46qjdydhdevvrndac" }),
});
FieldTypeRequiredDescription
didstringyesThe labeler’s atproto DID. HappyView stores it as given, without checking it

Response: 201 Created (empty body). Adding a labeler that’s already listed sets it back to active.

GET /admin/labelers

Requires labelers:read permission.

interface Labeler {
did: string;
status: string;
cursor: number | null;
created_at: string;
updated_at: string;
declared: boolean;
}
const response = await fetch("http://127.0.0.1:3000/admin/labelers", {
headers,
});
const data: Labeler[] = await response.json();

Response: 200 OK

[
{
"did": "did:plc:ar7c4by46qjdydhdevvrndac",
"declared": false,
"status": "active",
"cursor": 1234,
"created_at": "2026-03-15T00:00:00Z",
"updated_at": "2026-03-15T00:00:00Z"
}
]
FieldTypeDescription
didstringThe labeler’s DID
declaredbooleanWhether the project’s happyview.toml subscribes to it under [labels] subscribe
statusstringactive or paused
cursornumber|nullLast processed event cursor (null if never synced)
created_atstringISO 8601 creation timestamp
updated_atstringLast-updated timestamp. ISO 8601 once the subscription has been changed; before that, the database’s own default format
PATCH /admin/labelers/{did}

Requires labelers:create permission.

const response = await fetch(
"http://127.0.0.1:3000/admin/labelers/did:plc:ar7c4by46qjdydhdevvrndac",
{
method: "PATCH",
headers: {
...headers,
"Content-Type": "application/json",
},
body: JSON.stringify({ status: "paused" }),
},
);
FieldTypeRequiredDescription
statusstringyesNew status: active or paused. The value isn’t checked, and HappyView consumes only labelers whose status is active

Response: 204 No Content. Returns 404 Not Found for an unknown labeler.

DELETE /admin/labelers/{did}

Requires labelers:delete permission. Removes the subscription and all labels emitted by this labeler.

Deleting a labeler with declared: true returns 409 Conflict; remove it from [labels] subscribe in happyview.toml instead. An unknown labeler returns 404 Not Found.

const response = await fetch(
"http://127.0.0.1:3000/admin/labelers/did:plc:ar7c4by46qjdydhdevvrndac",
{
method: "DELETE",
headers,
},
);

Response: 204 No Content