Skip to content

REST API keys, OpenAPI and rate limits

Create a scoped API token, call /api/v1 with the OpenAPI spec, submit jobs with an Idempotency-Key, and stay within the rate limits.

Last updated

On this page

The REST API gives scripts and tools like Make or Zapier the same capabilities as MCP, with the same review-then-apply safety.

Create an API token

  1. Open Connect › MCP & CLI (/connect/mcp) in AdMassy.
  2. Under Automation tokens, choose:
    • Token access: Read only or Read and write (uploads, builds, reviewed launches) (the default),
    • optionally the manage checkbox, which lets a write token pause/resume existing Meta objects and edit existing ad copy,
    • Automation token duration: 30, 60 or 90 days,
    • Performance automation access: No performance access, Read reports, rules and activity, or Read, refresh and manage rules (write tokens only).
  3. Click Create N-day automation token.
  4. Copy the secret. It starts with ads_ and is shown only once.

Tokens can only be created from the signed-in app, and never get more rights than your own role. Treat a token like a password and Revoke it in Your automation tokens if it leaks. The Activate API button in Settings › Profile is a shortcut to token setup.

Call the API

Base path: https://app.admassy.com/api/v1

curl https://app.admassy.com/api/v1/... \
  -H "Authorization: Bearer ads_…"

OAuth access tokens (from an MCP client) are accepted too.

The full specification is public:

  • OpenAPI 3.1: https://app.admassy.com/api/v1/openapi.json. Each operation lists x-mcp-tools (the matching MCP tools), x-required-scope and x-mutates.
  • LLM summary: https://app.admassy.com/llms.txt.

Submit jobs

Write endpoints follow the reviewed-writes flow:

  1. Call the preview endpoint. You get a previewId and the exact Meta requests.
  2. Submit with the previewId and an Idempotency-Key header (8–200 characters). The response is 202 with a job ID.
  3. Poll the job until it finishes.

Reuse the same Idempotency-Key with the same body after a timeout; you get the original job back instead of a duplicate.

Rate limits

Per credential (token or OAuth client):

TypeLimit
Read requests600 per 60 seconds
Write requests300 per 60 seconds

Responses carry X-RateLimit-* headers. Over the limit you get 429 with Retry-After (seconds). Meta's own limits are separate and are handled by the job queue; see Troubleshooting.

OAuth for your own app

Apps that act for other users can use OAuth 2.1 instead of tokens: authorize at /oauth/authorize, exchange at /api/oauth/token, with PKCE (S256) and dynamic client registration. Access tokens last 1 hour; refresh tokens 30 days and rotate.

Make and Zapier

Use an HTTP module with the Bearer token for calls, and a workspace webhook for triggers. See Make, Zapier and webhooks.

Was this article helpful?