Brands

Group each business's accounts and publish as that brand.

View as MarkdownOpenAPIBase URL https://postwire.io

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.

List brands and the networks connected to each

GET/api/brands

A 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

StatusMeans
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
curl "https://postwire.io/api/brands" \
  -H "Authorization: Bearer $POSTWIRE_API_KEY"
Node
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());
Python
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

POST/api/brands

A 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)

FieldTypeDescription
name requiredstring

Responses

StatusMeans
200{ ok, brand: { id, name } }
400name required, or code brand_limit_reached { brands_used, brands_allowed, upgrade }
curl
curl -X POST "https://postwire.io/api/brands" \
  -H "Authorization: Bearer $POSTWIRE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Corner Café"
}'
Node
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());
Python
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

GET/api/brands/{id}

Needs an API key: Authorization: Bearer pw_live_….

Parameters

FieldTypeDescription
id requiredpath, string

Responses

StatusMeans
200{ brand: { id, name, platforms[], accounts[] } }
404brand_not_found
curl
curl "https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
  -H "Authorization: Bearer $POSTWIRE_API_KEY"
Node
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());
Python
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

PATCH/api/brands/{id}

Needs an API key: Authorization: Bearer pw_live_….

Parameters

FieldTypeDescription
id requiredpath, string

Body (JSON)

FieldTypeDescription
name requiredstring

Responses

StatusMeans
200{ ok, brand }
404brand not found
curl
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"
}'
Node
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());
Python
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)

DELETE/api/brands/{id}

Needs an API key: Authorization: Bearer pw_live_….

Parameters

FieldTypeDescription
id requiredpath, string

Responses

StatusMeans
200{ ok }
400the last brand
404brand not found
curl
curl -X DELETE "https://postwire.io/api/brands/b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
  -H "Authorization: Bearer $POSTWIRE_API_KEY"
Node
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());
Python
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())