Brand kit
GET /api/v1/brand-kit
Every brand kit item of the user, in their order: id, slug, name, text in full and images (with kept_from_auto_delete true: the media library's cleanup never deletes it; an image whose file was deleted is available false with neither it nor a url). Free.
- Scope
postory:read - Limit class
READ - Success
200
Example
curl https://postory.io/api/v1/brand-kit \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"items": [
{
"id": "<item_id>",
"slug": "our-product",
"name": "Our product",
"text": "Acme, a scheduling app for small teams",
"images": [
{
"asset_id": "<asset_id>",
"url": "https://media.example.com/logo.png",
"width": 1024,
"height": 1024,
"alt_text": "Acme logo",
"available": true,
"kept_from_auto_delete": true
}
]
}
],
"count": 1,
"limit": 100,
"brand_kit_url": "https://postory.io/settings/brand-kit",
"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/brand-kit
Create a brand kit item: a text, up to 3 library images, or both (100 items at most: 409 conflict with limit; a slug the user already has: 409 conflict with slug; a file that is no image of the user's library: 404 media_not_found). Idempotency-Key replays the first answer for 24 hours, so a retry makes no second item.
- 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 |
|---|---|---|
asset_ids | string[] | Images' ids from |
namerequired | string | What the user calls it. Up to 80 characters |
slug | string | Kebab-case, a letter first ( |
text | string | What |
Example
curl https://postory.io/api/v1/brand-kit \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Our product",
"slug": "our-product",
"text": "Acme, a scheduling app for small teams",
"asset_ids": ["<image id from media library>"]
}'{
"item": {
"id": "<item_id>",
"slug": "our-product",
"name": "Our product",
"text": "Acme, a scheduling app for small teams",
"images": [
{
"asset_id": "<asset_id>",
"url": "https://media.example.com/logo.png",
"width": 1024,
"height": 1024,
"alt_text": "Acme logo",
"available": true,
"kept_from_auto_delete": true
}
]
},
"created": true,
"brand_kit_url": "https://postory.io/settings/brand-kit",
"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
GET /api/v1/brand-kit/{item}
One item by its id or slug, with the same fields. 404 not_found lists the user's items (id, slug, name). Free.
- Scope
postory:read - Limit class
READ - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
itemrequired | path | string | An item's |
Example
curl "https://postory.io/api/v1/brand-kit/<item>" \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"item": {
"id": "<item_id>",
"slug": "our-product",
"name": "Our product",
"text": "Acme, a scheduling app for small teams",
"images": [
{
"asset_id": "<asset_id>",
"url": "https://media.example.com/logo.png",
"width": 1024,
"height": 1024,
"alt_text": "Acme logo",
"available": true,
"kept_from_auto_delete": true
}
]
},
"brand_kit_url": "https://postory.io/settings/brand-kit",
"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
PATCH /api/v1/brand-kit/{item}
Change an item's name, slug, text or images; only what is sent changes. An image the item already holds may stay after its file was deleted.
- Scope
postory:drafts - Limit class
WRITE - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
itemrequired | path | string | An item's |
Request body
| Field | Type | Description |
|---|---|---|
asset_ids | string[] | Images' ids from |
name | string | What the user calls it. Up to 80 characters |
slug | string | Kebab-case, a letter first ( |
text | string | What |
Example
curl -X PATCH "https://postory.io/api/v1/brand-kit/<item>" \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset_ids": ["<asset_ids>"]}'{
"item": {
"id": "<item_id>",
"slug": "our-product",
"name": "Our product",
"text": "Acme, the scheduling app for teams of five",
"images": [
{
"asset_id": "<asset_id>",
"url": "https://media.example.com/logo.png",
"width": 1024,
"height": 1024,
"alt_text": "Acme logo",
"available": true,
"kept_from_auto_delete": true
}
]
},
"created": false,
"brand_kit_url": "https://postory.io/settings/brand-kit",
"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/brand-kit/{item}
Delete an item, permanently; its images stay in the media library.
- Scope
postory:drafts - Limit class
DELETE - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
itemrequired | path | string | An item's |
Example
curl -X DELETE "https://postory.io/api/v1/brand-kit/<item>" \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"id": "<item_id>",
"slug": "our-product",
"name": "Our product",
"deleted": 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
404Not found, or not this user's
422A request parameter is not valid
429Rate limit spent; see Retry-After