# REST API reference

> Base URL, authentication, response shape, pagination, every endpoint under /api/v1 with curl examples, and the OpenAPI document.

URL: https://heyorbitapp.vercel.app/docs/developers/rest-api
Last updated: 2026-11-21

Developers · [Documentation](https://heyorbitapp.vercel.app/docs)

## Basics

- **Base URL:** https://app.heyorbit.app/api/v1 (self-hosted: https://your-domain/api/v1)
- **Auth:** Authorization: Bearer orb_… ([API keys](https://heyorbitapp.vercel.app/docs/developers/api-keys))
- **Workspace:** x-workspace: {workspaceId} header, or workspaceId in the query or body; defaults to your first workspace
- **Content type:** application/json; media uploads use multipart/form-data
- **Dates:** ISO 8601 strings; always include an offset or Z
- **IDs:** cuids
- **CORS:** enabled, so you can call the API from a browser app with a key
- **OpenAPI:** GET /api/v1/openapi.json (OpenAPI 3.1, no auth needed). Import it into Postman, Insomnia or a Custom GPT action.

## Response shape

~~~json
{ "ok": true, "data": { "...": "..." } }
~~~

~~~json
{ "ok": false, "error": "That time is in the past. Pick a future time or use Publish now.", "code": "PAST_DATE" }
~~~

Common codes: UNAUTHENTICATED (401), FORBIDDEN (403), NOT_FOUND (404), VALIDATION (422), PLAN_LIMIT (402, something you haven't paid for yet, such as AI tools without the AI Studio add-on), RATE_LIMITED (429), NOT_CONFIGURED (501, something isn't set up on this HeyOrbit).

## Pagination

List endpoints accept limit (default 50, max 200) and cursor, and return { items, nextCursor }. Pass nextCursor as cursor to get the next page.

~~~bash
curl "https://app.heyorbit.app/api/v1/posts?status=SCHEDULED&limit=50" \
  -H "Authorization: Bearer orb_xxx" -H "x-workspace: ws_123"
~~~

## Endpoints

| Method | Path | Purpose |
|---|---|---|
| GET | /me | The key's user, plan, limits and AI usage |
| GET | /workspaces | Workspaces you can access, with your role and their accounts |
| GET | /accounts | Connected social accounts; filters platform, status |
| GET | /posts | List posts; filters status, from, to, platform, accountId, labelId, q |
| POST | /posts | Create a post (draft, schedule or publish) |
| GET | /posts/{id} | One post with its targets, media, labels and approvals |
| PATCH | /posts/{id} | Update caption, targets, media, time, labels, or move it with action |
| DELETE | /posts/{id} | Delete (doesn't remove anything already published) |
| POST | /posts/{id}/publish | Publish now and return per-platform results |
| GET | /posts/{id}/versions | The post's versions, newest first: what was sent each time, approver decisions with reasons, what changed |
| GET | /media | Media library; filters type, folderId, q |
| POST | /media | Upload a file (multipart) or import from a URL ({ "url": "…" }) |
| GET | /labels | Labels |
| GET | /hashtag-sets | Hashtag sets |
| GET | /analytics/overview | Workspace analytics; range (7d, 14d, 30d, 90d) or from and to, accountIds |
| GET | /analytics/accounts/{id} | One account's analytics |
| GET | /inbox | Inbox items; filters type (comments or messages), unread, status, accountId, sentiment, q |
| POST | /inbox/{id}/reply | Reply to a comment, message or review |
| GET | /reports | Reports with their share URLs |
| POST | /reports | Generate a report ({ title?, from, to, compare?, accountIds? }) |
| GET | /openapi.json | The OpenAPI document |

Creating, changing, publishing, uploading, replying and generating reports need the Editor role or above in the workspace.

## Create a post

~~~bash
curl -X POST https://app.heyorbit.app/api/v1/posts \
  -H "Authorization: Bearer orb_xxx" \
  -H "x-workspace: ws_123" \
  -H "Content-Type: application/json" \
  -d '{
    "caption": "New single-origin from Huila. Plum, cocoa, long finish.",
    "sameCaption": false,
    "scheduledAt": "2026-10-14T08:10:00-04:00",
    "timezone": "America/New_York",
    "targets": [
      { "socialAccountId": "acc_ig", "caption": "New single-origin from Huila. Plum, cocoa, long finish.", "settings": { "postType": "post", "firstComment": "#specialtycoffee #huila" } },
      { "socialAccountId": "acc_li", "caption": "Why we moved to a lighter roast for Huila, and what changed in the cup." }
    ],
    "mediaIds": ["med_123"],
    "labelIds": ["lbl_product"],
    "approverIds": ["usr_dana"],
    "action": "schedule"
  }'
~~~

The response is the post, with status SCHEDULED, or PENDING_APPROVAL when it has approvers. action can be draft (the default), schedule or publish. Every account is checked against its platform's rules first ([limits](https://heyorbitapp.vercel.app/docs/publishing/platform-settings-and-limits)), and problems come back as a 422 that names the account. For a repeating post, add "recurrence": { "freq": "daily" } or { "freq": "weekly" } ([recurring posts](https://heyorbitapp.vercel.app/docs/publishing/recurring-posts)).

## Upload media

~~~bash
curl -X POST https://app.heyorbit.app/api/v1/media \
  -H "Authorization: Bearer orb_xxx" -H "x-workspace: ws_123" \
  -F "file=@huila-bag.jpg" -F "alt=Bag of Huila single-origin on a wooden counter"
~~~

Or send JSON { "url": "https://…", "alt": "…" } to import a public file. Uploads count toward your storage.

## Analytics

~~~bash
curl "https://app.heyorbit.app/api/v1/analytics/overview?range=30d" \
  -H "Authorization: Bearer orb_xxx" -H "x-workspace: ws_123"
~~~

Returns totals with changes against the previous period, per-account rows, a per-platform breakdown, a daily series and top posts.

## Reply in the inbox

~~~bash
curl -X POST https://app.heyorbit.app/api/v1/inbox/inb_456/reply \
  -H "Authorization: Bearer orb_xxx" -H "Content-Type: application/json" \
  -d '{ "text": "Thanks! The Huila is back in stock Friday." }'
~~~

## Plan features

What you've paid for applies through the API too: AI tools need the optional AI Studio add-on ([pricing](https://heyorbitapp.vercel.app/docs/account-billing/plans-and-limits)). Reports and share links are included ([reports](https://heyorbitapp.vercel.app/docs/analytics/reports)).

## Importing many posts

For migrations and scripts, the [bulk import API](https://heyorbitapp.vercel.app/docs/developers/bulk-import-api) takes a CSV or JSON rows and schedules up to 200 posts per request.

## Limits

120 requests per minute per key ([rate limits](https://heyorbitapp.vercel.app/docs/developers/rate-limits)).
