Brands
Group each business's accounts and publish as that brand.
A brand is one business: its own TikTok, its own Instagram, and so on. Pass brand_id when you publish or schedule. With one brand you never need it. When the same network is connected in two brands and no brand_id is sent, PostWire refuses (409 ambiguous_brand) instead of guessing.
GET /api/brands: List brands and the networks connected to eachPOST /api/brands: Create a brandGET /api/brands/{id}: One brand and its connected accountsPATCH /api/brands/{id}: Rename a brandDELETE /api/brands/{id}: Delete a brand and disconnect its networks (an account keeps at least one brand)
List brands and the networks connected to each
/api/brandsA brand groups one business's accounts. Use a brand's id as `brand_id` when publishing.
Needs an API key: Authorization: Bearer pw_live_….
Responses
| Status | Means |
|---|---|
200 | { brands: [{ id, name, platforms[], accounts: [{ platform, label, handle, display_name, avatar_url, profile_url, connected_at, needs }] }], limit, plan } — handle, display name and picture are what the network itself reports for that account. |
curl "https://postwire.io/api/brands" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/brands", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/brands",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Create a brand
/api/brandsA brand groups one business's connected accounts. The plan sets how many brands an account has (Free 1, Starter 3, Pro 10, Agency 50, Scale 200); one more answers 400 brand_limit_reached with an upgrade link.
Needs an API key: Authorization: Bearer pw_live_….
Body (JSON)
| Field | Type | Description |
|---|---|---|
name required | string |
Responses
| Status | Means |
|---|---|
200 | { ok, brand: { id, name } } |
400 | name required, or code brand_limit_reached { brands_used, brands_allowed, upgrade } |
curl -X POST "https://postwire.io/api/brands" \
-H "Authorization: Bearer $POSTWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Corner Café"
}'const res = await fetch("https://postwire.io/api/brands", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Corner Café"
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.post(
"https://postwire.io/api/brands",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
json={
"name": "Corner Café",
},
)
print(r.status_code, r.json())One brand and its connected accounts
/api/brands/{id}Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
id required | path, string |
Responses
| Status | Means |
|---|---|
200 | { brand: { id, name, platforms[], accounts[] } } |
404 | brand_not_found |
curl "https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Rename a brand
/api/brands/{id}Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
id required | path, string |
Body (JSON)
| Field | Type | Description |
|---|---|---|
name required | string |
Responses
| Status | Means |
|---|---|
200 | { ok, brand } |
404 | brand not found |
curl -X PATCH "https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
-H "Authorization: Bearer $POSTWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Corner Café Miraflores"
}'const res = await fetch("https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c", {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Corner Café Miraflores"
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.patch(
"https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
json={
"name": "Corner Café Miraflores",
},
)
print(r.status_code, r.json())Delete a brand and disconnect its networks (an account keeps at least one brand)
/api/brands/{id}Deleting a brand also turns off its active client links (the client page stops working at once), disconnects its networks and drops its scheduled posts. A brand with active client links is only deleted with `confirm=1`; without it the answer is 409 `brand_has_client_links` with `would_delete`, and nothing is deleted. `dry_run=1` answers `would_delete` ({ client_links, networks, scheduled_posts }) and deletes nothing.
Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
id required | path, string | |
confirm | query, string | Required when the brand has active client links: they are turned off with the brand. |
dry_run | query, string | Answer what would be deleted (would_delete) without deleting anything. |
Responses
| Status | Means |
|---|---|
200 | { ok, deleted: { client_links, networks, scheduled_posts } } — with dry_run=1: { ok, dry_run, would_delete, can_delete } |
400 | the last brand (code last_brand) |
404 | brand not found |
409 | brand_has_client_links: the brand has active client links; repeat with confirm=1. Nothing was deleted. |
curl -X DELETE "https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.delete(
"https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())