Skip to content
UGC API

Authentication

Every request to https://ugcapi.dev/v1 needs an API key. Keys belong to your UGC API account and can act on all of its connected accounts, posts and credits.

Updated

API keys

  • Create keys in the dashboard. Live keys start with ugc_live_.
  • The full key is shown once, when you create it. We store only a hash, so we can't show it again.
  • Name each key by where it runs, like prod-backend or n8n, so you know which one to revoke.
  • You can have several keys at once and revoke any of them from the dashboard.

Sending the key

Send the key in the Authorization header as a Bearer token. Query string keys are not accepted.

bash
curl https://ugcapi.dev/v1/usage \
  -H "Authorization: Bearer ugc_live_..."
javascript
const res = await fetch("https://ugcapi.dev/v1/usage", {
  headers: { "Authorization": "Bearer " + process.env.UGCAPI_KEY },
});
const usage = await res.json();

GET /v1/usage is a good first call to test a key. It returns your credits left and posts this month.

Errors

A missing, malformed or revoked key returns HTTP 401:

json
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Common causes: no Bearer prefix, whitespace or a newline copied with the key, or a key that was revoked. See errors for all codes.

Keeping keys safe

  1. Call the API from your server only. Never ship a key in a browser bundle or mobile app.
  2. Store keys in environment variables or your platform's secret store, not in code.
  3. Use a separate key per environment and per integration.
  4. Rotate by creating a new key, deploying it, then revoking the old one. There's no downtime.
  5. If a key leaks, revoke it in the dashboard right away. A leaked key can spend your credits and post to your connected accounts.

Dashboard sessions

The dashboard uses its own session login, separate from API keys. API keys can't sign in to the dashboard, and dashboard sessions can't call /v1. To post from a no-code tool, see n8n and Make. To get started, follow the quickstart.

Teams

Invite teammates from Team in the dashboard. They sign in with their own email and work in your workspace: the same connected accounts, posts, campaigns, stats, credits, API keys and webhook. Seats are free, up to 50 people per team.

RoleCan
OwnerEverything. Changes roles and removes admins. Can't leave their own team.
AdminEverything a member can, plus inviting people and removing members.
MemberConnect accounts, post, schedule, cancel, see stats, create and revoke API keys, buy credits.
  • Invites go by email and expire after 14 days. You can also copy the invite link and send it yourself.
  • Each person keeps their own workspace too. People on more than one team switch between them from the menu next to Dashboard.
  • API keys belong to the workspace, not the person who made them, so they keep working when someone leaves. Revoke a departing teammate's keys if they had a copy.
  • An AI app connected through MCP gets the workspace that was open when it was approved, and stops working if that teammate is removed.

FAQ

Can I see my API key again after creating it?

No. We store only a hash. Create a new key and revoke the old one if you lose it.

Can I limit a key to certain accounts?

Keys have access to everything in their workspace. Use separate workspaces if you need hard separation; a teammate can belong to several.

Can I call the API from the browser?

Don't. The key would be visible to anyone. Call it from your backend.

Related