Post labels
GET /api/v1/labels
The user's post labels (the app's tags), by name: id, name, color, with the palette (colors, default_color) and limit. Free.
- Scope
postory:read - Limit class
READ - Success
200
Example
curl https://postory.io/api/v1/labels \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"labels": [{"id": "<label_id>", "name": "Launch", "color": "spot"}],
"count": 1,
"colors": [
"idle",
"ink",
"spot",
"spot-2",
"run",
"wait",
"block",
"surface-lavender",
"surface-mint",
"surface-sage",
"surface-blush"
],
"default_color": "idle",
"limit": 50,
"acting_as": {"postory": "[email protected]", "plan": "free"}
}Other responses
401No API key, or an invalid or revoked one
403The key lacks the scope, or access is paused
422A request parameter is not valid
429Rate limit spent; see Retry-After
POST /api/v1/labels
Create a label (50 at most: 409 label_limit_reached; a name the user already has: 409 label_name_taken with that label's label_id). Idempotency-Key replays the first answer for 24 hours.
- Scope
postory:drafts - Limit class
WRITE - Success
201
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Any unique string (1-255 characters). The first answer for this key is replayed for 24 hours ( |
Request body
| Field | Type | Description |
|---|---|---|
color | "idle" | "ink" | "spot" | "spot-2" | "run" | "wait" | "block" | "surface-lavender" | "surface-mint" | "surface-sage" | "surface-blush" | A palette token: |
namerequired | string | 1 to 40 characters, unique among the user's labels (any case). Up to 40 characters |
Example
curl https://postory.io/api/v1/labels \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{"name": "Launch", "color": "spot"}'{
"label": {"id": "<label_id>", "name": "Launch", "color": "spot"},
"created": true,
"acting_as": {"postory": "[email protected]", "plan": "free"}
}Other responses
401No API key, or an invalid or revoked one
403The key lacks the scope, or access is paused
409The state does not allow it now (already scheduled, changed, needs a choice…); branch on
code422A request parameter is not valid
429Rate limit spent; see Retry-After
PATCH /api/v1/labels/{label}
Rename and/or recolour a label; only what is sent changes. Unknown: 404 not_found listing the user's labels.
- Scope
postory:drafts - Limit class
WRITE - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
labelrequired | path | string | A label's |
Request body
| Field | Type | Description |
|---|---|---|
color | "idle" | "ink" | "spot" | "spot-2" | "run" | "wait" | "block" | "surface-lavender" | "surface-mint" | "surface-sage" | "surface-blush" | A palette token: |
name | string | 1 to 40 characters, unique among the user's labels (any case). Up to 40 characters |
Example
curl -X PATCH "https://postory.io/api/v1/labels/<label>" \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"color": "idle"}'{
"label": {"id": "<label_id>", "name": "Launch week", "color": "run"},
"created": false,
"acting_as": {"postory": "[email protected]", "plan": "free"}
}Other responses
401No API key, or an invalid or revoked one
403The key lacks the scope, or access is paused
404Not found, or not this user's
409The state does not allow it now (already scheduled, changed, needs a choice…); branch on
code422A request parameter is not valid
429Rate limit spent; see Retry-After
DELETE /api/v1/labels/{label}
Delete a label: it leaves every post that carried it (removed_from_posts counts them); the posts stay.
- Scope
postory:drafts - Limit class
DELETE - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
labelrequired | path | string | A label's |
Example
curl -X DELETE "https://postory.io/api/v1/labels/<label>" \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"id": "<label_id>",
"name": "Launch",
"color": "spot",
"deleted": true,
"removed_from_posts": 3,
"acting_as": {"postory": "[email protected]", "plan": "free"}
}Other responses
401No API key, or an invalid or revoked one
403The key lacks the scope, or access is paused
404Not found, or not this user's
422A request parameter is not valid
429Rate limit spent; see Retry-After