Start free trial

API

API authentication

How API keys work. Send a key in the x-api-key header. Create, name and revoke keys in Settings. Keys are shown once, so keep them on your server.

On this page

Every API request carries an API key in the x-api-key header.

curl "$POSTCHAMP_API_URL/api/v1/credits" -H "x-api-key: $POSTCHAMP_API_KEY"

Keys

  • A key starts with pc_live_ followed by random characters.
  • You create keys in Settings → API keys. Owners create and revoke keys. Admins can open the page and read it.
  • A key is shown once, right after you create it. PostChamp stores only a hash and the last characters, so it cannot show the key again.
  • Give each key a name that says where it is used. You can rename a key, and you can revoke it at any time. A revoked key stops working within seconds.
  • Your organization can have a limited number of live keys: 50.

Keys are available on: Studio.

What a key can do

A key acts as the person who created it, with that person's current role. If the person leaves the organization, the key stops working. It spends the organization's credits, and every call is recorded in the audit log.

Errors you may get

  • api_key_required: the x-api-key header is missing.
  • api_key_invalid: the key is unknown, revoked or expired, or its creator left the organization.
  • plan_limit: your plan does not include the API.

See Errors for the full list.

What you may see in Settings

  • A locked page. Your plan does not include the API. The lock names the plan.
  • A read-only page. You are an admin. Ask an owner to create or revoke keys.
  • No keys page on a client domain. On a white label domain, keys are handled by your agency.

Questions

I lost my key. Can I see it again?

No. A key is shown once, when you create it. Revoke it and create a new one.

Can I use an API key with the MCP connection?

No. AI assistants connect with a browser sign-in and need no key. API keys are for the REST API only.

  • API overview: Create drafts, schedule posts, build carousels and infographics from your own tools with a REST API and an API key. Base URL, conventions and a first request.
  • API errors: Every API error has the same JSON shape with a stable code. The list of status codes and error codes, and how to handle each one.
  • API rate limits: How many API requests a key and a workspace can make each minute, the headers that show what is left, and how to back off when you get a 429.

Last updated