Hayyvn

Developers

Hayyvn API

Publish posts, read stats, and work your comments and DMs from your own scripts and AI agents.

Overview

The API is served from https://app.hayyvn.com and speaks JSON. The full reference is below and as an OpenAPI 3.1 document: openapi.json (also at https://app.hayyvn.com/openapi.json). It is generated from the code that serves the API, so it lists exactly the endpoints an API key can call.

curl https://app.hayyvn.com/api/api-keys/self \
  -H "Authorization: Bearer $HAVYYN_API_KEY"

curl "https://app.hayyvn.com/api/workspaces/YOUR_WORKSPACE_ID/connections" \
  -H "Authorization: Bearer $HAVYYN_API_KEY"

Authentication

Every request carries a workspace API key: Authorization: Bearer hvn_…. Workspace admins create keys in Settings → Workspace → Advanced → API keys; creating one asks for your second factor, and the key is shown once. Hayyvn stores only a hash of it.

  • A key belongs to one workspace. GET /api/api-keys/self tells you which, plus its scopes, reply mode, role and expiry.
  • A key acts as the member who created it, with the lower of that member’s role and moderator. It can never manage the workspace, its members, billing, settings or other keys; those endpoints answer 403 api_key_not_allowed.
  • Keys expire after 30, 90 (default) or 365 days, or never, chosen when the key is made. An expired key gets 401 api_key_expired. A workspace can have up to 10 active keys.
  • A key can be limited to some account groups. It then sees only those groups’ accounts, and never more than the member who created it.
  • A key can cancel, reschedule, edit and retry only posts it scheduled, and schedule or delete only drafts it created.

When keys stop working

Hayyvn revokes a key on its own, for good, when:

  • the member who created it changes their password, turns two-factor authentication on or off, or has it reset;
  • that member is removed from the workspace or leaves it;
  • that member deletes their Hayyvn account.

Revoking a key, automatically or by hand, cancels the posts it scheduled that haven’t started publishing and dismisses its reply drafts. If the member’s seat is paused or their role is lowered, the key is only suspended and works again when the seat or role comes back.

Scopes

Each key has a set of scopes, chosen when it is made and editable later. Write scopes include their read scope, and the post scopes are a ladder: posts:publish includes posts:schedule, which includes posts:draft. Where one endpoint both schedules and publishes, the post time decides which scope the call needs. A call without the scope it needs gets 403 api_key_missing_scope, naming the scope. New keys start with posts:read, posts:draft and insights:read — they can’t publish until someone adds a higher post scope.

ScopeAllows
posts:readConnected accounts, drafts, scheduled and published posts.GET …/account-groups · GET …/composes · GET …/connections · GET …/library · GET …/media/{mediaId}/captions · GET …/media/{mediaId}/playlists · GET …/posting-schedules · GET …/scheduled-posts · GET …/scheduled-posts/{postId} · GET …/tasks · GET …/tiktok/creator-info
posts:draftUpload media; create, edit and delete the key’s own drafts. Nothing goes public.POST /api/uploads · POST /api/uploads/multipart · PUT /api/uploads/multipart · GET …/accounts/{accountId}/youtube/playlists · POST …/composes · DELETE …/composes/{composeId}
posts:scheduleEverything in posts:draft, plus schedule posts at least 5 minutes ahead, and reschedule, edit, retry and cancel the key’s own scheduled posts.POST …/accounts/{accountId}/youtube/playlists · DELETE …/media/{mediaId}/captions · POST …/media/{mediaId}/captions · PATCH …/media/{mediaId}/details · POST …/media/{mediaId}/playlists · DELETE …/media/{mediaId}/playlists/{playlistId} · PATCH …/media/{mediaId}/thumbnail · PATCH …/media/{mediaId}/visibility · POST …/posting-schedules/{scheduleId}/pending/{composeId}/schedule · POST …/posting-schedules/{scheduleId}/pending/{composeId}/skip · POST …/publish-jobs/{jobId} · DELETE …/publish-jobs/{jobId}/dismiss · POST …/publish-jobs/{jobId}/dismiss · PATCH …/scheduled-posts/{postId} · POST …/scheduled-posts/{postId}/cancel · POST …/scheduled-posts/{postId}/reschedule
posts:publishEverything in posts:schedule, plus publish now: a publishAt less than 5 minutes away on POST …/composes, PATCH/reschedule, and retrying a post that was published that way.
posts:writeDeprecated: the same as posts:publish. Keys that have it keep working; new keys use the three scopes above.
insights:readPer-post stats, the briefing, top fans, media kits (with their public links) and affiliate link clicks.GET …/account-groups · GET …/affiliate-links · GET …/affiliate-links/stats · GET …/briefing · GET …/competitors · GET …/insights · GET …/media · GET …/media-kit · GET …/media-stats · GET …/posting-times · GET …/rate-cards · GET …/superfans · GET …/tasks
comments:readComments, comment threads, reply drafts waiting for approval, ghost blocks and moderation rules (read only).GET …/account-groups · GET …/assist-level · GET …/block-suggestions · GET …/comments · GET …/comments/{commentId}/notes · GET …/comments/{commentId}/notes/mentionables · GET …/comments/{commentId}/thread · POST …/comments/bulk-action · GET …/engage-queue · GET …/engage-queue/expired · GET …/faqs · GET …/ghost-block · GET …/media/{mediaId}/first-comment · GET …/mentions · GET …/mentions/{mentionId}/notes · GET …/mentions/{mentionId}/notes/mentionables · GET …/moderation-audit · GET …/people/{platform}/{userId} · GET …/personas · GET …/review-queue · POST …/review-queue/bulk-resolve · GET …/review-queue/expired · GET …/rule-suggestions · GET …/rules · POST …/rules/preview · GET …/standing · GET …/tasks · GET …/trusted
comments:moderateHide, unhide, hold for review, block and unblock (through the moderate-comments endpoint).DELETE …/block-suggestions/{suggestionId} · POST …/block-suggestions/{suggestionId}/accept · POST …/comments/{commentId}/notes · POST …/comments/hold-negatives · POST …/mentions/{mentionId}/notes · POST …/review-queue/expired · POST …/standing · DELETE …/standing/{standingId}
comments:deleteDelete comments (same endpoint, action: "delete").
comments:replyReply to comments, as a draft or directly, per the key’s reply mode.POST …/comments/{commentId}/react · POST …/comments/{commentId}/reply · POST …/engage-queue/{entryId} · POST …/engage-queue/expired · POST …/media/{mediaId}/first-comment · PATCH …/mentions · POST …/mentions/{mentionId}/reply
dms:readDM conversations, the opportunity pipeline, DM reply drafts and auto-DM campaigns (read only).GET …/account-groups · GET …/auto-dm · GET …/dms · GET …/dms/{conversationId} · GET …/dms/{conversationId}/notes · GET …/dms/{conversationId}/notes/mentionables · GET …/engage-queue · GET …/engage-queue/expired · GET …/faqs · GET …/offers · GET …/opportunities · GET …/opportunities/{oppId} · GET …/opportunities/{oppId}/notes/mentionables · GET …/rate-cards · GET …/tasks
dms:replyReply to Instagram DMs, as a draft or directly, per the key’s reply mode.PATCH …/dms/{conversationId} · POST …/dms/{conversationId}/ai-pause · POST …/dms/{conversationId}/notes · POST …/dms/{conversationId}/reply · POST …/engage-queue/{entryId} · POST …/engage-queue/expired

Replies follow the key’s reply mode. In draft mode (the default) a reply waits in the workspace’s Engage queue until a person sends or dismisses it. In send mode it goes out directly. Replies an agent writes are never used to learn the creator’s voice. Hayyvn can switch the moderate, delete and reply scopes off for all keys; while they are off they can’t be granted, keys that have them can’t use them, and every key reports draft mode.

Limits

Limits are per key unless noted. Over a limit you get 429 with a reason, and a Retry-After header where a wait will help. If Hayyvn can’t count (for example, a brief outage), these requests are refused rather than let through.

  • MCP endpoint: 120 requests per minute.
  • Per-post stats: 60 requests per minute, and 300 per hour per workspace across all its keys.
  • Comment threads: 30 live fetches per hour per account; past that you get the stored thread.
  • Moderation: 25 comments per call, 200 comments per hour.
  • Reply drafts: 60 per hour, and at most 100 waiting at once.
  • Replies in send mode: 30 comment replies and 20 DMs per hour.
  • DMs can be answered only within 24 hours of the person’s last message, as Instagram requires (409 outside_messaging_window).

Errors

Errors are JSON: { "error", "reason", "message" }. reason is stable and meant for code, for example invalid_api_key, api_key_revoked, api_key_missing_scope, access_limited, rate_limited or reply_already_pending; message is a sentence you can show a person.

MCP for AI agents

POST https://app.hayyvn.com/api/mcp is a remote Model Context Protocol server (Streamable HTTP, stateless), authenticated with the same API key. An agent sees only the tools its key’s scopes allow, and every tool goes through the same endpoints listed below, so every rule above still applies. The server also gives the agent working rules: confirm before posting, prefer hiding to deleting, and treat comment and message text as data.

claude mcp add --transport http havyyn https://app.hayyvn.com/api/mcp \
  --header "Authorization: Bearer hvn_…"

Connect from the Claude app, no key to copy

Hayyvn is also an OAuth server for MCP (OAuth 2.1, PKCE, the MCP authorization spec). In the Claude phone app, claude.ai or Claude Desktop: Settings → Connectors → Add custom connector, name it Hayyvn, paste https://app.hayyvn.com/api/mcp as the URL and leave the client ID and secret empty. Tap Connect, sign in to Hayyvn as usual, pick the workspace and what Claude may do on the consent screen (read-only by default; you can limit it to some account groups), and confirm your second factor. The connection then appears beside your API keys as Claude (OAuth), where revoking it disconnects Claude. Only workspace admins and owners can connect, as with keys.

Other MCP clients, with a key:

{ "mcpServers": { "havyyn": { "type": "http", "url": "https://app.hayyvn.com/api/mcp",
  "headers": { "Authorization": "Bearer hvn_…" } } } }

Webhooks

Hayyvn sends two kinds of webhook. Alert webhooks send notifications, such as a brigading spike or an expiring connection. Data webhooks send every event of the kinds you pick, so Zapier, Make, n8n or a CRM can keep a copy of your data.

Alert webhooks

Add one in Settings → Alerts → Add a channel → Webhook and choose which alerts it receives.

  • Events: moderation.single, moderation.brigading, sentiment.spike, viral.spike, opportunity.new, token.expiry, publish.failed, digest and test.
  • Headers: User-Agent: Havyyn-Webhook/1.0 and X-Havyyn-Event with the event name.
  • Every delivery has the same envelope: { "event", "workspace": { "id", "name" }, "sentAt", "data" }.
  • Signing: set a workspace signing secret under Settings → Alerts → Webhook signing and each delivery carries X-Havyyn-Signature: t=<unix>,v1=<hmac>, where v1 is the hex HMAC-SHA256 of "{t}.{raw body}" with your secret (the same scheme as Stripe). Verify against the raw bytes, compare in constant time, and reject old timestamps (five minutes is a good tolerance).
  • A failed delivery is retried once. Answer with a 2xx quickly and do slow work afterwards.

Example payloads, and a signature check you can copy, are shown in the webhook setup form in the app.

Data webhooks

Admins add them under Settings → Alerts → Data webhooks. How many you can have depends on your plan. A webhook can be limited to one account group; events about disconnected accounts are never sent.

  • Events: comment.created, dm.received, post.published, moderation.action, opportunity.created, opportunity.stage_changed and webhook.test. Events usually arrive 10 to 30 seconds after they happen.
  • Envelope: { "id", "event", "workspaceId", "occurredAt", "data" }. id is the same on every retry and redelivery, and delivery is at least once, so de-duplicate on it.
  • Headers: X-Havyyn-Event, X-Havyyn-Event-Id, X-Havyyn-Delivery and X-Havyyn-Signature: t=<unix>,v1=<hmac>, signed the same way as alert webhooks but with the webhook’s own secret (it starts whsec_). While a secret is being rotated the header carries two v1 values for 24 hours; accept the request if either matches.
  • Answer with a 2xx within 8 seconds. 408, 425, 429, 5xx, timeouts and network errors are retried after 1 min, 5 min, 15 min, 1 h, 3 h, 6 h and 12 h (8 attempts over about 22 hours); any other 4xx fails at once. Every delivery is in the webhook’s delivery log for 30 days, where you can redeliver it.
  • A webhook that keeps failing (20 failed attempts over 3 days with no success, or 100 in a row) is turned off and the workspace owner is emailed.

Reference · v1.0

Endpoints

Paths are relative to https://app.hayyvn.com. Replace {workspaceId} with your key’s workspace id. Download the OpenAPI document to generate a client.

Key

The calling key itself.

GET/api/api-keys/self

Describe the calling key

Any valid key. Any valid key. Returns the workspace it belongs to, its name, effective scopes (held plus implied: posts:publish ⊃ posts:schedule ⊃ posts:draft ⊃ posts:read), reply mode (draft or send), role (never above moderator), expiry, connection, and effective account access ({scope:"all"} or {scope:"groups", groups:[{id,name}], reason}). connection is {kind:"key"} for a key made in Settings, or {kind:"oauth", renewsAutomatically, connectedUntil} for an app connected with Sign in with Hayyvn — its expiresAt is the 1-hour access token, renewed automatically until connectedUntil.

200 { workspaceId, workspaceName, keyName, expiresAt, connection, scopes, replyMode, role, access }

Accounts

Connected accounts and account groups.

GET/api/workspaces/{workspaceId}/account-groups

List account groups

Scopes: any of posts:read, insights:read, comments:read, dms:read. Any of posts:read, insights:read, comments:read, dms:read. The live groups { id, name, color, sortOrder, accountIds }, so you can find names to pass as group. Creating and editing groups is for people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 The workspace’s live account groups.

GET/api/workspaces/{workspaceId}/accounts/{accountId}/youtube/playlists

List a YouTube channel’s playlists

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). The connected YouTube channel’s own playlists — id, title, itemCount, privacyStatus — for youtubeOptions.playlistIds and POST media/{mediaId}/playlists. accountId is a YouTube account’s id (GET connections). Needs posts:draft. Cached for 10 minutes (?fresh=1 asks YouTube again; at most 60 fresh lists per hour per workspace). Uses 1 unit of the day’s YouTube quota per 50 playlists, nothing when cached (429 youtube_quota_exhausted); at most 200 playlists are listed (truncated: true beyond). YouTube only (400 not_supported); 404 not_found for an unknown account or one the key can’t see; 400 account_or_token_missing when the channel isn’t connected.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId path · string · required
  • fresh query · "1" — 1 = skip the 10-minute cache.

200 { accountId, playlists: [{ id, title, itemCount, privacyStatus }], truncated }

POST/api/workspaces/{workspaceId}/accounts/{accountId}/youtube/playlists

Create a YouTube playlist

Scope: posts:schedule (higher post scopes work too: posts:publish). Creates a playlist on the connected YouTube channel. Body { title, privacyStatus? } — title ≤ 150 characters, no < or > (400 invalid_request); privacyStatus public (default), unlisted or private. Needs posts:schedule. YouTube only (400 not_supported); 404 not_found for an unknown account or one the key can’t see; 409 while the account is being handed back to its creator. Uses 50 units of the day’s YouTube quota (429 youtube_quota_exhausted); at most 10 per hour per workspace (429 rate_limited). Audited as media.playlist_created.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId path · string · required

Body · application/json

  • title string ≤500 · required
  • privacyStatus "public" | "unlisted" | "private"

201 { accountId, playlist: { id, title, itemCount, privacyStatus } }

GET/api/workspaces/{workspaceId}/connections

List connected accounts

Scope: posts:read. The workspace’s connected Instagram, YouTube and TikTok accounts, each with nickname, group ({ id, name, color } or null) and connectionType (Instagram: instagram_login or facebook_login — only facebook_login can delete comments, like or block in DMs; null on YouTube / TikTok).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { accounts: [{ id, platform, externalId, displayName, nickname, group, status, connectionType, connectedAt, lastSeenAt, tokenExpiresAt }] }

GET/api/workspaces/{workspaceId}/tiktok/creator-info

TikTok posting options

Scope: posts:read. A TikTok account’s live posting options from TikTok (its posting rules require them before posting): allowed privacy levels, max video length, whether comments / duet / stitch are off, and the account’s nickname and username. Live call: 10 per minute per key (429 rate_limited). TikTok failures are typed, each with reason, retryable, tiktokCode and tiktokRequestId: 409 tiktok_reconnect_required, 403 tiktok_permission_denied, 429 tiktok_rate_limited, 422 tiktok_request_rejected, 503 tiktok_unavailable or 503 tiktok_unexpected_response.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — The TikTok account (an id from GET connections). Default: any active TikTok account the key sees.

200 { info: { privacyLevelOptions, commentDisabled, duetDisabled, stitchDisabled, maxVideoPostDurationSec, creatorUsername, creatorNickname, creatorAvatarUrl, profileLookup } } (profileLookup: "failed" → the three creator names are null; the options are still live)

Media

Upload images and videos for posts.

POST/api/uploads

Upload media files

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). Upload one or more images or videos for a post (multipart form, one file field per file). Returns public URLs to pass as post media. Counts toward the workspace’s storage. Each file up to 95 MB (95,000,000 bytes), the whole request up to that plus 64 KiB; Content-Length is required. At most 2 of these in flight per caller and 4 per workspace (429 uploads_in_progress), and a server-wide limit on bytes in flight (503 server_busy); both carry Retry-After. For larger videos use the multipart upload below.

Parameters

  • workspaceId query · string · required — The workspace the key belongs to.

Body · multipart/form-data

  • file file[] · required

200 The stored files with their public URLs.

POST/api/uploads/multipart

Start, complete or abort a multipart upload

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). For large videos. action: "create" (with contentType and size) returns { key, uploadId, partSize }; PUT each part; then action: "complete" with every part’s etag returns { url }, or action: "abort" discards it.

Parameters

  • workspaceId query · string · required — The workspace the key belongs to.

Body · application/json

  • Variant 1
  • action "create" · required
  • filename string ≤300
  • contentType string ≤100 · required
  • size integer · required
  • target "staging" | "library"
  • Variant 2
  • action "complete" · required
  • key string · required
  • uploadId string · required
  • parts object[] · required
  • Variant 3
  • action "abort" · required
  • key string · required
  • uploadId string · required
  • Variant 4
  • action "sign" · required
  • key string · required
  • uploadId string ≤1024 · required
  • partNumbers integer 1–10000[] · required
  • size integer 1–167772160000 · required

200 { key, uploadId, partSize } (create), { url } (complete) or { ok } (abort).

PUT/api/uploads/multipart

Upload one part

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). Raw bytes of one part (every part but the last is exactly partSize). Failed parts can be retried on their own. At most 4 parts in flight per caller and 8 per workspace (429 uploads_in_progress, or 503 server_busy when the server is full; wait Retry-After), and 600 parts a minute per caller.

Parameters

  • key query · string · required — The key from create.
  • partNumber query · integer 1–10000 · required — 1-based part number.
  • total query · integer — How many parts the upload will have.
  • uploadId query · string · required — The uploadId from create.
  • workspaceId query · string · required — The workspace the key belongs to.

Body · application/octet-stream

See the description.

200 { etag } — keep it for complete.

GET/api/workspaces/{workspaceId}/library

List library items

Scope: posts:read. The workspace’s content library (saved images and videos) plus its folders. Each asset’s url is a media ref POST composes accepts in defaultMediaRefs. A key limited to some account groups sees only its groups’ folders (never the root). Without limit the listing is the app’s (root or one folder, up to 200); with it, newest first + nextCursor.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • cursor query · string — nextCursor from the previous page, unchanged (needs limit).
  • everywhere query · "1" — 1 = every folder and the root at once.
  • folderId query · string — Only this folder’s assets (default: the root).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • kind query · "image" | "video" — Only images or only videos.
  • limit query · integer 1–100 — Page size, 1–100 (enables nextCursor).
  • q query · string — Search titles and captions across all folders.
  • removed query · "1" — 1 = the Removed list instead.

200 { assets: [{ id, kind, url, title, bytes, contentType, durationSec, width, height, defaultCaption, folderId, timesPublished, lastPublishedAt, createdAt }], folders: [{ id, parentId, name, groupId, groupName, assetCount }], groups, lens, rootWritable, nextCursor? }

Posts

Drafts, scheduled posts and publishing.

GET/api/workspaces/{workspaceId}/composes

List drafts

Scope: posts:read. Unscheduled drafts, each in the same shape POST composes accepts.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mine query · "1" — 1 = only the ones this API key created.

200 { drafts }

POST/api/workspaces/{workspaceId}/composes

Create a post or draft

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). With publishAt: scheduled to every account in platformAccountIds. Without it: saved as a draft (posts:draft is enough). With draftId: replaces that draft’s content (the key’s own drafts only) and schedules it if publishAt is set. A publishAt at least 5 minutes ahead needs posts:schedule; sooner (now) needs posts:publish — otherwise 403 api_key_missing_scope naming the scope. A YouTube target can carry youtubeOptions.tags (up to 30 tags, each ≤ 100 characters, ≤ 500 in total counting YouTube’s quotes and commas, no < or >; a leading # is dropped and duplicates removed — 400 invalid_youtube_tags otherwise). A YouTube target can carry youtubeOptions.playlistIds (≤ 5 of the channel’s own playlist ids — GET accounts/{accountId}/youtube/playlists; 400 invalid_youtube_playlists for a malformed id, 400 unknown_playlist for one that isn’t the channel’s): the video is added to them right after it goes live, 50 YouTube units each, never failing the publish (c569); on a post to several channels each video goes only into its own channel’s playlists — the other channels’ ids are skipped. Accounts in a group with an approval policy create a post waiting for approval. Media are URLs from the upload routes. A YouTube target can carry subtitle tracks, youtubeOptions.captions: [{ ref, language, name? }] — ≤ 5, one per language (BCP-47, e.g. en, es-419), each ref a Hayyvn upload of an SRT or WebVTT file (POST uploads with application/x-subrip / text/vtt, ≤ 1 MB; library files can’t be used yet) — 400 invalid_captions otherwise; a subtitle file is never a post’s media (400 incompatible_plan). They are added right after the upload (400 YouTube units each, from the workspace’s publish allowance); a refusal is retried later and never fails the publish — the job records captionsError (c568). A YouTube target can carry a custom thumbnail, youtubeOptions.thumbnailRef: a Hayyvn image URL (an upload or a library item’s url), JPEG or PNG, ≤ 2 MB, at least 640×360 (400 invalid_thumbnail otherwise). It is set right after the upload and never fails the publish — a channel not verified for custom thumbnails keeps YouTube’s own frame (c565). youtubeOptions.firstComment (≤ 2,000 characters, no < >; 400 invalid_youtube_first_comment) is posted as the channel right after the video goes live — it never fails the publish; comments off on the video (or a made-for-kids video, skipped without a call) → the job records firstCommentError: comments_disabled. YouTube can’t pin it through the API (c570). An API key setting a first comment is sending a comment: it also needs comments:reply (403 api_key_missing_scope) and **send** reply mode (403 draft_mode_cannot_send), and the text is stored with the key’s disclosure (R2-F1).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • contentKind "short_video" | "long_video" | "photo" | "story" · required
  • platformAccountIds string[] · required
  • defaultCaption string ≤4000
  • defaultMediaRefs string ≤2000[]
  • overrides object
  • tiktokOptions object
  • youtubeOptions object
  • instagramOptions object
  • publishAt string (date-time)
  • draftId string
  • studioClipId string

201 The created post or draft.

DELETE/api/workspaces/{workspaceId}/composes/{composeId}

Delete a draft

Scope: posts:draft (higher post scopes work too: posts:schedule, posts:publish). Removes an unscheduled draft. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • composeId path · string · required
  • permanent query · "1" — Not for API keys (403 people_only): removed drafts can be restored in the app for 30 days, and only people delete them for good there.

200 { ok: true }

GET/api/workspaces/{workspaceId}/media/{mediaId}/captions

List a YouTube video’s subtitles

Scope: posts:read. The subtitle tracks Hayyvn put on a published YouTube video — language, name and when — never YouTube’s caption ids. mediaId is Hayyvn’s id (GET media → mediaId); the YouTube video id is accepted too. Needs posts:read. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

200 { mediaId, captions: [{ language, name, uploadedAt }] }

POST/api/workspaces/{workspaceId}/media/{mediaId}/captions

Add or replace a YouTube subtitle track

Scope: posts:schedule (higher post scopes work too: posts:publish). Adds a subtitle track to a published YouTube video, or — when Hayyvn already put one in that language there — replaces its file (the track keeps its name). Body { ref, language, name? }: ref a Hayyvn upload (POST uploads) of an SRT or WebVTT file, ≤ 1 MB, with real cues; language a code like en, es-419; name ≤ 150 characters, no < > (400 invalid_captions otherwise). Up to 5 tracks per video (400 too_many_captions). Needs posts:schedule. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see; 409 while the account is being handed back to its creator; 400 account_or_token_missing when the channel isn’t connected; 404 video_not_found when YouTube no longer has it. Each upload uses 400 units of the day’s YouTube quota — a large share (429 youtube_quota_exhausted, nothing changed); at most 10 changes per hour per workspace (429 rate_limited). Audited as media.captions_changed (language, action).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • ref string ≤2000 · required
  • language string ≤40 · required
  • name string ≤200

200 { mediaId, action: "added" | "replaced", captions: [{ language, name, uploadedAt }] }

DELETE/api/workspaces/{workspaceId}/media/{mediaId}/captions

Remove a YouTube subtitle track

Scope: posts:schedule (higher post scopes work too: posts:publish). Removes the subtitle track Hayyvn put on a published YouTube video in ?language= (deleted on YouTube; adding it back needs the file again). 404 caption_not_found when Hayyvn hasn’t put that language there; a track already removed in YouTube Studio counts as removed. Needs posts:schedule; same gates as POST. Uses 50 units of the day’s YouTube quota. Audited as media.captions_changed (action: removed).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required
  • language query · string — The track’s language code, as GET lists it.

200 { mediaId, action: "removed", captions: [{ language, name, uploadedAt }] }

PATCH/api/workspaces/{workspaceId}/media/{mediaId}/details

Edit a YouTube video’s details

Scope: posts:schedule (higher post scopes work too: posts:publish). Changes a published YouTube video’s title, description and/or tags without re-uploading it. Body { title?, description?, tags? } — at least one; only what you send changes. title ≤ 100 characters; description ≤ 5,000 bytes and replaces the whole description; tags replaces the whole list (≤ 30, each ≤ 100 characters, ≤ 500 in total; [] removes them); no < or > in any (400 invalid_youtube_title / invalid_youtube_description / invalid_youtube_tags). Everything else on the video (category, languages) is kept: Hayyvn reads the current details and sends them back with only these changed. mediaId is Hayyvn’s id (GET media → mediaId, or a YouTube job’s mediaId in GET scheduled-posts); the YouTube video id is accepted too. Needs posts:schedule. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see; 400 account_or_token_missing when the channel isn’t connected; 404 video_not_found when YouTube no longer has it. YouTube is always read first (what Hayyvn stored may be stale): already that way there → 200 with unchanged: true, nothing changed (1 unit used). An account being handed back to its creator → 409. Each edit reserves 51 units of the day’s YouTube quota (429 youtube_quota_exhausted, nothing changed); at most 30 edits per hour per workspace (429 rate_limited). Audited as media.details_changed (which fields, never their text).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • title string ≤1000
  • description string ≤20000
  • tags string ≤500[]

200 { mediaId, title, description, tags } (null when Hayyvn doesn’t know a field yet; plus unchanged: true when nothing changed)

GET/api/workspaces/{workspaceId}/media/{mediaId}/playlists

List a YouTube video’s playlists

Scope: posts:read. The playlists Hayyvn put a published YouTube video in (at publish or with POST) — { id, title } only. Playlists it was added to in YouTube Studio aren’t known here. mediaId is Hayyvn’s id (GET media → mediaId); the YouTube video id is accepted too. Needs posts:read. 404 not_found for an unknown post or one on an account the key can’t see.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

200 { mediaId, playlists: [{ id, title }] }

POST/api/workspaces/{workspaceId}/media/{mediaId}/playlists

Add a YouTube video to a playlist

Scope: posts:schedule (higher post scopes work too: posts:publish). Adds a published YouTube video to one of its channel’s playlists. Body { playlistId } (from GET accounts/{accountId}/youtube/playlists; 400 unknown_playlist when it isn’t the channel’s). Already added by Hayyvn → 200 with unchanged: true, nothing sent (YouTube would add it a second time). Needs posts:schedule. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see; 400 account_or_token_missing when the channel isn’t connected; 409 while the account is being handed back to its creator. Uses 50 units of the day’s YouTube quota (429 youtube_quota_exhausted, nothing changed); at most 30 playlist changes per hour per workspace (429 rate_limited). Audited as media.playlist_changed.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • playlistId string · required

200 { mediaId, playlists: [{ id, title }] } (plus unchanged: true when it was already in it)

DELETE/api/workspaces/{workspaceId}/media/{mediaId}/playlists/{playlistId}

Remove a YouTube video from a playlist

Scope: posts:schedule (higher post scopes work too: posts:publish). Takes a published YouTube video out of a playlist Hayyvn put it in; add it back with POST. 404 not_in_playlist when Hayyvn has no record of it (added in YouTube Studio — remove it there). Needs posts:schedule. Same gates as POST: YouTube only, the key’s accounts, 409 during a hand-back; 50 units of the day’s YouTube quota; 30 changes per hour per workspace. Audited as media.playlist_changed.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required
  • playlistId path · string · required

200 { mediaId, playlists: [{ id, title }] }

PATCH/api/workspaces/{workspaceId}/media/{mediaId}/thumbnail

Set a YouTube video’s thumbnail

Scope: posts:schedule (higher post scopes work too: posts:publish). Sets or changes a published YouTube video’s custom thumbnail without re-uploading it. Body { thumbnailRef }: a Hayyvn image URL — an upload (POST uploads) or a library item’s url — JPEG or PNG, ≤ 2 MB, at least 640×360 (1280×720 is best); 400 invalid_thumbnail otherwise. mediaId is Hayyvn’s id (GET media → mediaId, or a YouTube job’s mediaId in GET scheduled-posts); the YouTube video id is accepted too. Needs posts:schedule. The channel must be verified for custom thumbnails: 409 channel_not_verified (with verifyUrl) otherwise. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see; 400 account_or_token_missing when the channel isn’t connected; 404 video_not_found when YouTube no longer has it; 409 while the account is being handed back to its creator. A successful change also clears a thumbnail that didn’t take at publish. Each change uses 50 units of the day’s YouTube quota (429 youtube_quota_exhausted, nothing changed); at most 30 changes per hour per workspace (429 rate_limited). Audited as media.thumbnail_changed.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • thumbnailRef string ≤2000 · required

200 { mediaId, customThumbnail: true }

PATCH/api/workspaces/{workspaceId}/media/{mediaId}/visibility

Change a YouTube video’s visibility

Scope: posts:schedule (higher post scopes work too: posts:publish). Changes a published YouTube video to public, unlisted or private without re-uploading it — e.g. publish unlisted for review, make it public later. mediaId is Hayyvn’s id (GET media → mediaId, or GET scheduled-posts → a YouTube job’s mediaId); the YouTube video id is accepted too. Making a video **public** is publishing it, so a key needs posts:publish for that value (403 api_key_missing_scope naming it); unlisted and private need posts:schedule. YouTube only (400 not_supported for an Instagram or TikTok post); 404 not_found for an unknown post or one on an account the key can’t see; 400 account_or_token_missing when the channel isn’t connected; 404 video_not_found when YouTube no longer has it. YouTube is always read first (what Hayyvn stored may be stale): already at that value there → 200 with unchanged: true, nothing changed (1 unit used). An account being handed back to its creator → 409. Each change reserves 51 units of the day’s YouTube quota (429 youtube_quota_exhausted, nothing changed); at most 30 changes per hour per workspace (429 rate_limited). Audited as media.visibility_changed.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • privacyStatus "public" | "unlisted" | "private" · required

200 { mediaId, privacyStatus } (plus unchanged: true when it already had that value)

GET/api/workspaces/{workspaceId}/posting-schedules

List auto-post schedules

Scope: posts:read. Recurring auto-post schedules (posting from the library): cadence, accounts, status + pausedReason, nextAt, pending drafts waiting to be scheduled (each with composeId, occurrenceAt, caption, asset { assetId, title, kind, removed }), lastMaterializedAt. Creating, switching on and changing schedules are people-only; a posts:schedule key can schedule or skip pending drafts (below). A limited key sees only schedules whose every account is its own.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • removed query · "1" — 1 = the Removed list instead.

200 { schedules, meta }

POST/api/workspaces/{workspaceId}/posting-schedules/{scheduleId}/pending/{composeId}/schedule

Schedule a pending auto-post draft

Scope: posts:schedule (higher post scopes work too: posts:publish). Schedules a draft an auto-post schedule prepared (composeId from GET posting-schedules → pending) to the schedule’s accounts, with its stored caption and media. The draft was made by the schedule, so any key that sees the schedule may use it; the post records the key (it can then reschedule / cancel it). A publishAt at least 5 minutes ahead needs posts:schedule; sooner (now) needs posts:publish — otherwise 403 api_key_missing_scope naming the scope. Monthly post limit, approval policies and platform rules apply as for POST composes. A schedule paused for a plan or limit reason (plan, quota, daily_cap, kill_switch) is 409 schedule_paused for keys. While auto-posting is turned off for maintenance, every call is 409 auto_post_off. A limited key: the draft’s library items must still be in its groups’ folders (400 library_item_not_available).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • scheduleId path · string · required
  • composeId path · string · required

Body · application/json

  • publishAt string (date-time) · required

201 { ok: true, scheduledPostId }

POST/api/workspaces/{workspaceId}/posting-schedules/{scheduleId}/pending/{composeId}/skip

Skip a pending auto-post draft

Scope: posts:schedule (higher post scopes work too: posts:publish). Passes on a draft an auto-post schedule prepared: it stops waiting and stays in the drafts list (nothing is deleted). 404 when it is no longer waiting.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • scheduleId path · string · required
  • composeId path · string · required

200 { ok: true }

POST/api/workspaces/{workspaceId}/publish-jobs/{jobId}

Retry a failed publish

Scope: posts:schedule (higher post scopes work too: posts:publish). Retries one failed publish job (a post to one account). A post still waiting for approval is refused (409 approval_open). A post created for a later time retries with posts:schedule; one created to publish at once (its publishAt under 5 minutes after it was created) needs posts:publish. When the last attempt reached the platform but no answer came back and there is nothing to check it against (a TikTok upload with no publish id), a plain retry is refused with 409 outcome_unknown — the post may already be live; check, and only if it is not there send { confirmNotPublished: true }. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • jobId path · string · required

200 { ok: true }

POST/api/workspaces/{workspaceId}/publish-jobs/{jobId}/dismiss

Dismiss a publish failure

Scope: posts:schedule (higher post scopes work too: posts:publish). Marks one FAILED publish job as acknowledged, so it stops counting as an unresolved failure. Bookkeeping only: the job keeps its error and stays listed; DELETE on the same path takes it back. A job that hasn’t failed is 409 not_dismissable; a job retried or (un)dismissed in between is 409 job_changed (with its current status / dismissed), nothing written. A key’s dismiss records no user; the audit carries the key. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • jobId path · string · required

200 { ok: true } (or alreadyDismissed: true)

DELETE/api/workspaces/{workspaceId}/publish-jobs/{jobId}/dismiss

Take back a dismissed failure

Scope: posts:schedule (higher post scopes work too: posts:publish). Un-dismisses a publish failure, so it counts as unresolved again. A job that changed in between is 409 job_changed, nothing written. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • jobId path · string · required

200 { ok: true } (or alreadyActive: true)

GET/api/workspaces/{workspaceId}/scheduled-posts

List scheduled and published posts

Scope: posts:read. Posts with their per-account publish jobs, approval state (approvalState, approvalHeld, this round’s approvals), newest first. A YouTube job also carries mediaId (for PATCH media/{mediaId}/visibility) and visibility (public, unlisted, private, or null when not known yet), plus youtube: { uploadStatus, failureReason } — YouTube keeps processing a video after the upload, and can still reject it: uploaded (still processing), processed, rejected / failed (stopped by YouTube after upload — the job is then failed with a plain-words error, e.g. a copyright match; a retry re-uploads and may be refused again), deleted (the video is no longer on YouTube — the job is failed with “This video was removed from YouTube.” and already dismissed), unknown (Hayyvn stopped checking after ~2 days), or null (not checked). failureReason is YouTube’s token (copyright, duplicate, codec, …; removed when the video is gone); left out for client members.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • before query · string (date-time) — Cursor: posts scheduled before this ISO time.
  • beforeId query · string — Cursor tie-breaker: the last post id of the previous page.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • ids query · string — Only these post ids (comma-separated).
  • mine query · "1" — 1 = only the ones this API key created.
  • status query · string — Only posts in this status (400 invalid_status lists the allowed values).

200 { posts }

GET/api/workspaces/{workspaceId}/scheduled-posts/{postId}

Get a post

Scope: posts:read. One post, with its content in the same shape POST composes accepts, its publish jobs and approval state.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • postId path · string · required

200 The post.

PATCH/api/workspaces/{workspaceId}/scheduled-posts/{postId}

Edit a waiting post

Scope: posts:schedule (higher post scopes work too: posts:publish). Same body and checks as POST composes, plus optional publishAt (A publishAt at least 5 minutes ahead needs posts:schedule; sooner (now) needs posts:publish — otherwise 403 api_key_missing_scope naming the scope.). Content type and accounts can’t change (400 targets_locked); once publishing has started it’s 409 not_editable. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • postId path · string · required

Body · application/json

  • contentKind "short_video" | "long_video" | "photo" | "story" · required
  • platformAccountIds string[] · required
  • defaultCaption string ≤4000
  • defaultMediaRefs string ≤2000[]
  • overrides object
  • tiktokOptions object
  • youtubeOptions object
  • instagramOptions object
  • publishAt string (date-time)

200 The updated post.

POST/api/workspaces/{workspaceId}/scheduled-posts/{postId}/cancel

Cancel a post

Scope: posts:schedule (higher post scopes work too: posts:publish). Cancels a post that hasn’t published yet. Posts already live stay up (deleting live posts is for people in the app). The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • postId path · string · required

200 { ok: true, … }

POST/api/workspaces/{workspaceId}/scheduled-posts/{postId}/reschedule

Reschedule a post

Scope: posts:schedule (higher post scopes work too: posts:publish). Moves a waiting post to a new time. A publishAt at least 5 minutes ahead needs posts:schedule; sooner (now) needs posts:publish — otherwise 403 api_key_missing_scope naming the scope. The key can only act on posts and drafts it created itself (403 api_key_not_post_owner / api_key_not_draft_owner).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • postId path · string · required

Body · application/json

  • publishAt string (date-time) · required

200 { ok: true, publishAt }

Insights

Per-post stats and the briefing.

GET/api/workspaces/{workspaceId}/affiliate-links/stats

Affiliate link clicks

Scope: insights:read. Clicks per link: all time, from in-app browsers, and in the last 30 days. Same access as GET affiliate-links.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { totalClicks, perLink: [{ linkId, clicks, inAppClicks, clicksLast30d }] }

GET/api/workspaces/{workspaceId}/briefing

Briefing: how the accounts are doing

Scope: insights:read. Per account: followers and change, recent posts against the account’s usual. Comment, DM and opportunity sections appear only when the key also has comments:read / dms:read; upcoming posts and nothingScheduled only with posts:read. Without group, a workspace with groups also gets a per-group groups[] breakdown.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • hours query · integer 1–168 — Look-back window in hours (1–168, default 24).

200 The briefing.

GET/api/workspaces/{workspaceId}/competitors

Benchmarks watchlist

Scope: insights:read. The creators the workspace watches on Benchmarks, each with its last 30 daily snapshots (followers, media count, engagement rate, posts per week, audience overlap — aggregates only, never who), the workspace’s own accounts for comparison (disconnected ones hidden), its live groups and the watchlist cap. Stored snapshots only — no platform call. Not available to keys limited to account groups. Keys get no notes.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string — Only creators (and own accounts) compared with this group: a group id, its name, or "none".

200 The watchlist.

GET/api/workspaces/{workspaceId}/insights

Account insights (the Analytics page)

Scope: insights:read. Per connected account (active only): follower/subscriber history from daily snapshots (followers, 90 days, with Instagram follows vs unfollows), Instagram account insights (instagram: reach, accounts engaged, interactions, views, profile link taps — 30 days; error: "insights_unavailable" when Instagram didn’t answer), YouTube channel analytics (youtube: views, engaged views, minutes watched, subscribers gained/lost, traffic sources — 28 days), TikTok account + video totals (tiktok, stored data), recent Instagram stories, and group rollups (groups, when the workspace uses groups and no account is given). Instagram and YouTube numbers are cached about an hour. Keys: up to 30 calls an hour per key. Unknown group → 404 group_not_found; account naming only accounts outside the scope → 404 account_not_found.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • account query · string — Only these accounts (comma-separated account ids). Ids outside the group / your access are ignored.
  • group query · string — Only this account group: a group id, its name, or "none" for accounts in no group.

200 The insights.

GET/api/workspaces/{workspaceId}/media

List published posts

Scope: insights:read. Every post the connected accounts published, as Hayyvn has stored it (not only posts Hayyvn scheduled), newest first, with cached numbers: likes/comments as of countsUpdatedAt, views/reach/saves/shares as of insightsUpdatedAt. No platform call — use media-stats with the mediaId for fresh numbers. A YouTube video also carries playlists: [{ id, title }] — the playlists Hayyvn put it in (null on other platforms) — change them with POST / DELETE media/{mediaId}/playlists (c569). A YouTube video also carries youtube: { title, tags, firstComment: { posted } } — title and tags as Hayyvn last saw them (both null when not known yet; youtube is null on other platforms) — change them with PATCH media/{mediaId}/details; firstComment.posted says whether Hayyvn posted the channel’s first comment (c570). A YouTube video also carries captions: [{ language, name }] — the subtitle tracks Hayyvn put on it (never YouTube’s caption ids; null on other platforms) — change them with POST / DELETE media/{mediaId}/captions (c568). type=story lists Instagram stories instead (views, reach, replies, expiresAt). Disconnected accounts are left out unless accountId names one. A YouTube video YouTube rejected or removed after upload is not live and is left out (it stays on its post, under the failed job — GET scheduled-posts).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — Only this connected account.
  • cursor query · string — nextCursor from the previous page, unchanged.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–100 — Page size, 1–100 (default 25).
  • platform query · "instagram" | "youtube" | "tiktok" — Only this platform.
  • since query · string (date-time) — Only posts published at or after this ISO date/time.
  • type query · "photo" | "video" | "carousel" | "story" — photo, video (incl. reels), carousel, or story.

200 { posts: [{ mediaId, platformMediaId, platform, type, permalink, caption, postedAt, firstSeenAt, views, likes, comments, shares, saves, reach, countsUpdatedAt, insightsUpdatedAt, visibility, thumbnail, account: { id, name } }], nextCursor } — visibility is a YouTube video’s public / unlisted / private as Hayyvn last saw it (null on other platforms or when not known yet). thumbnail is { custom } on a YouTube video — whether Hayyvn set a custom thumbnail on it — and null elsewhere.

GET/api/workspaces/{workspaceId}/media-kit

List media kits

Scope: insights:read. The workspace’s media kits (public page /kit/{slug} when published). A key limited to some account groups sees only kits that follow one of its groups or show only its accounts. A key never receives contactEmail, and gets audience, rateCard and brands only for a published kit (what its public page shows). Editing kits is for people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { kits: [{ id, title, slug, published, displayName, tagline, bio, niche, location, avatarUrl, coverUrl, highlights, rateCardId, platformAccountIds, channelScope, groupId, acceptInquiries, showDemographics, showFollowerChart, updatedAt, audience?, rateCard?, brands? }] } (audience / rateCard / brands on published kits only).

GET/api/workspaces/{workspaceId}/media-stats

Per-post stats

Scope: insights:read. Views, likes, comments, shares, saves, reach and average view % for up to 50 YouTube, Instagram or TikTok posts. Items are our mediaIds (from GET media), platform media ids or public links (youtube.com/shorts/<id>, youtu.be/<id>, instagram.com/reel/<code>/, tiktok.com/@<name>/video/<id> …). accountId is optional when the items identify their account (a mediaId, or a post Hayyvn has stored); an item it can’t place gets error: "account_required". TikTok numbers are the stored ones (refreshed by Hayyvn’s scans, no platform call). Answers are cached (1 hour for posts under 48 hours old, up to 24 hours for older ones), so polling is cheap. A failing item sets its own error without failing the call. Limits: 60 requests per minute per key and 300 per hour per workspace (429 rate_limited, Retry-After); at most 5 accounts per call (too_many_accounts).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — The connected account the posts belong to (optional when the items identify it).
  • items query · string · required — Comma-separated mediaIds, media ids or links (max 50).

200 { cached, items: [{ key, mediaId, accountId, platform, externalId, permalink, views, likes, comments, shares, saves, reach, avgViewPct, fetchedAt, error }] }

GET/api/workspaces/{workspaceId}/posting-times

Recommended posting times

Scope: insights:read. Per connected Instagram, YouTube and TikTok account (disconnected ones hidden): suggested days and times to post, per kind of post (Instagram reel, photo, carousel, story; YouTube short, long; TikTok video), in the workspace time zone (timezone; timezoneIsDefault: true while it is still UTC). Each kind has a basis — personal (the creator’s own results), same_time_habit (they always post at one time, so there is nothing to compare yet), audience_online (when followers are online; not YouTube), starting_point (no history yet: a general starting point from what the account posts about — never a measured result, and its slots carry no numbers) or none — plus slots, tryInstead, pace (typicalPerWeek, suggestedPerWeek), reason (key + values for building your own sentence) and nextSlots (the next free instants, ISO, skipping any time within 2 hours of a post already scheduled on that account). lift is only set for the creator’s own results backed by enough posts. status: "pending" = nothing computed yet. Stored results only — no platform or AI call. No plan needed. Keys: up to 60 calls an hour per key; keys get no starter.audienceSummary. Unknown group → 404 group_not_found; account naming only accounts outside the scope → 404 account_not_found.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • account query · string — Only these accounts (comma-separated account ids). Ids outside the group / your access are ignored.
  • group query · string — Only this account group: a group id, its name, or "none" for accounts in no group.
  • kind query · "reel" | "photo" | "carousel" | "story" | "short" | "long" | "video" — Only this kind of post.

200 The suggested posting times, per account and kind.

GET/api/workspaces/{workspaceId}/rate-cards

List rate cards

Scopes: any of insights:read, dms:read. The workspace’s rate cards (public page /rates/{slug} when published). Needs insights:read or dms:read. A key limited to some account groups sees only cards that follow one of its groups or show only its accounts (the media-kit rule). A key never receives contactEmail, and gets the prices (content: items, packages, add-ons, terms) only for a published card. Editing cards is for people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { rateCards: [{ id, title, slug, published, displayName, tagline, avatarUrl, acceptInquiries, showStats, platformAccountIds, channelScope, groupId, content? }] } (content on published cards only, for a key).

GET/api/workspaces/{workspaceId}/superfans

Top fans

Scope: insights:read. The highest-ranked fans across platforms (top), or a handle search (q, 8 matches). Platforms with no connected account are left out. Fans are per platform, not per account, so a key limited to some account groups is refused (403 access_limited).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • q query · string — Handle search instead of top: up to 8 matches.
  • top query · integer 1–50 — Return the N (1–50) highest-ranked fans: { fans: [{ rank, platform, username, tier, score, commentCount, mentionCount, lastActiveAt }] }.

200 { fans } with top; { matches } with q.

GET/api/workspaces/{workspaceId}/tasks

Tasks: what needs the creator, ranked

Scopes: any of comments:read, dms:read, posts:read, insights:read. One ranked to-do list over the queues that already exist — brand opportunities, reply drafts, mentions, review holds grouped per account, pending auto-posts, publish failures, block suggestions, reconnects, items expiring within 24h — plus handled: what automation did alone in the window. Each task carries actions[] pointing at the existing routes. Kinds the key may not read are left out (comment kinds need comments:read, DM/opportunity kinds dms:read, publish kinds posts:read). Trust-ramp cards are for signed-in owners/admins only.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string — Only this account group: a group id, its name, or "none" for accounts in no group.
  • hours query · integer 1–168 — Window for handled and expiry, in hours (1–168, default 24).

200 The ranked tasks.

Comments

Read, moderate and reply to comments.

GET/api/workspaces/{workspaceId}/assist-level

Assist level: what Hayyvn does on its own

Scope: comments:read. Needs comments:read. How much the workspace lets Hayyvn act without a person: level is ask_first (everything waits for the creator), obvious (clear spam and hate are hidden, simple thank-yous get a reply on their own; the rest waits) or custom (individual automation levels were tuned in the app). chosen / chosenAt say whether and when someone picked it; autoRepliesLive is false while auto-replies are switched off for Hayyvn, in which case thank-you replies wait too. Workspace-wide, so a key limited to some account groups is refused. Changing it is for an owner or admin in the app — no key can.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { level, chosen, chosenAt, autoRepliesLive }.

GET/api/workspaces/{workspaceId}/block-suggestions

List block suggestions

Scope: comments:read. People Hayyvn suggests ghost-blocking because their comments keep getting moderated, highest score first (up to 50 pending), with the receipts (the hidden/deleted comments behind each) and the feature’s mode. A key limited to some account groups sees a person only when all of their comments and DMs are on its own accounts, with receipts from those accounts. A key never receives the platform user id or the note a person left; targetUsername is the handle without @, or null when only the user id is known.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { mode, suggestions: [{ id, status, platform, targetUsername, targetDisplayName, score, reasonSummary, hiddenCount, deletedCount, ruleHitCount, distinctPosts, avgSentiment, avgToxicity, lastActionAt, isAlsoSuperfan, aiSummary, aiRecommendation, receipts: [{ externalId, text, at }] }] }

DELETE/api/workspaces/{workspaceId}/block-suggestions/{suggestionId}

Dismiss a block suggestion

Scope: comments:moderate. Needs comments:moderate. Marks the suggestion “not interested” — nothing reaches a platform, and it takes no moderation slot; the person is suggested again only if their behaviour gets clearly worse. Not available to a key limited to some account groups (403 access_limited). 409 already_decided when it was already accepted or dismissed; 404 not_found. People can restore it in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • suggestionId path · string · required

200 { ok: true }

POST/api/workspaces/{workspaceId}/block-suggestions/{suggestionId}/accept

Accept a block suggestion

Scope: comments:moderate. Needs comments:moderate. Ghost-blocks the person (their comments are silently hidden on every account of that platform) and marks the suggestion accepted. Each accept takes one slot of the key’s 200-per-hour moderation cap (429 agent_moderation_limit, nothing done). Not available to a key limited to some account groups (403 access_limited). 409 already_decided when it was already accepted or dismissed; 409 trusted for someone on the Trusted people list; 400 cannot_block_self; 404 not_found (also for a person whose activity is only on disconnected accounts — GET block-suggestions never lists them). People undo it by removing the ghost block in the app (it can be restored).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • suggestionId path · string · required

200 { ok: true, entryId }

GET/api/workspaces/{workspaceId}/comments

List comments

Scope: comments:read. Comments across the workspace’s connected accounts, newest first, with their latest moderation status. Keys get no fromUserId (the commenter’s platform user id) and no assigneeUserId — assignee: { role } instead (null role = no longer a member; assignee: null = unassigned) — and a regex rule over 60 characters comes as rulePattern: null plus rulePatternLength.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — Only this connected account (an id from GET connections).
  • assigned query · "me" — me = only items assigned to the member the key acts as (its creator).
  • cursor query · string — Opaque cursor from the previous page’s nextCursor.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–200 — Page size (default 50, max 200).
  • mediaId query · string — Only comments on these posts (comma-separated platform media ids).
  • platform query · "instagram" | "youtube" | "tiktok" — Only this platform.
  • q query · string — Text search over the comment and its post’s caption.
  • sinceDays query · integer — Only comments seen in the last N days (default 30, max 365; 0 = all time).
  • sort query · "recent" | "toxic" — recent (default) or toxic (most toxic first).
  • status query · "active" | "hidden" | "deleted" | "review" | "unmoderated" — Moderation status.

200 { items, nextCursor, total }. Each item says which post it is on: mediaId (Hayyvn’s media id, null when the post isn’t stored), platformMediaId (the platform’s media/video id, null when unknown or for live chat) and permalink (null when unknown).

GET/api/workspaces/{workspaceId}/comments/{commentId}/notes

Read a comment’s internal notes

Scope: comments:read. Needs comments:read. The team’s internal notes on the comment (never posted), oldest first. Keys see live notes only; author is "Agent · <key name>" for a note an API key wrote, otherwise the writer’s role ("Teammate · admin") or "Former member" — never an email or user id. Teammate mentions read as @label in body, and mentions lists them as { ref, label, role }.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

200 { notes: [{ id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }] }

POST/api/workspaces/{workspaceId}/comments/{commentId}/notes

Add an internal note to a comment

Scope: comments:moderate. Needs comments:moderate. An internal note for the team (1–2,000 characters after trimming) — never posted to the platform. It shows as "Agent · <key name>"; people can remove and restore it in the app. Keys: at most 60 notes per key per hour across comment, DM and opportunity notes (429 agent_note_limit, fails closed). Plan 49: a note may mention teammates with <@ref> tokens (refs from GET …/notes/mentionables); they are told in Hayyvn. At most 10 per note; anyone who can’t see this account fails the whole note (422 mention_not_eligible, nothing saved; 422 too_many_mentions past 10). Mentions count against the same hourly cap. assign (plan 49 P8: a tm_ ref the note mentions — 400 assign_not_mentioned otherwise, nothing saved) also assigns the comment to that teammate after the note is saved; if they can’t be assigned (a viewer, or no access) the note stays and assignError says why. The assignee is told once — the mention’s alert says both.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

Body · application/json

  • body string ≤2000 · required
  • assign string ≤64

201 { ok: true, note: { id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }, assigned?: { changed }, assignError?: { error, message } }

GET/api/workspaces/{workspaceId}/comments/{commentId}/notes/mentionables

List teammates who can be mentioned on a comment

Scope: comments:read. Needs comments:read. The teammates who can be @-mentioned in a note on this comment — members who can see its account (never clients). Each is { ref, label, role, canAssign, isSelf }: ref is an opaque, stable tm_… id for this workspace (write <@ref> in a note to mention them), label the short name Hayyvn shows (the part of their email before the @), role their workspace role, canAssign whether they could be assigned the thread. Never a user id or an email (isSelf marks the person who created the key). 404 not_found while teammate mentions are off for the workspace.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

200 { teammates: [{ ref, label, role, canAssign, isSelf }] }

POST/api/workspaces/{workspaceId}/comments/{commentId}/react

Like or pin a comment

Scope: comments:reply. Body { action: "like" | "unlike" | "pin" | "unpin" }. TikTok (other platforms are refused, platform_unsupported). Keys need comments:reply; 60 per key per hour (429 agent_reaction_limit); audited with the key.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

Body · application/json

  • action "like" | "unlike" | "pin" | "unpin" · required

200 { ok, action }

POST/api/workspaces/{workspaceId}/comments/{commentId}/reply

Reply to a comment

Scope: comments:reply. Follows the key’s reply mode. draft (default): the reply waits in the Engage queue for a person to send (202 {status:"drafted", entryId}); send: posted directly, at most 30 per key per hour. The key’s disclosure is appended; the platform’s length limit is checked against the final text (TikTok 150, Instagram 2,200, YouTube 10,000). Refused: 409 comment_hidden, 409 reply_already_pending, 409 reply_already_sent, 429 agent_draft_limit (60 drafts/hour), 429 agent_draft_backlog (100 pending), 429 agent_send_limit. Send mode never posts the same reply twice: pass idempotencyKey (any string ≤ 200, one per reply you mean to send) and reuse it on retry — a repeat returns the first result with replayed: true; without one, the same text to the same target within 5 minutes counts as a repeat. 409 send_in_progress while another send to it is going out; 422 idempotency_key_reused for a key already used on a different reply. 504 outcome_unknown (outcomeUnknown: true): the platform didn’t answer in time and the reply may be live — a retry is checked against the platform first, and refused with 409 outcome_unknown while that can’t be confirmed. When the platform refuses a send: 409 needs_reconnect, 404 not_found, 429 rate_limited / quota_exhausted, 422 invalid_input, 502 provider_error (c650).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

Body · application/json

  • message string ≤10000 · required
  • replyDraftId string ≤64
  • idempotencyKey string ≤200

202 { status: "drafted", entryId } in draft mode; the sent reply in send mode (200).

GET/api/workspaces/{workspaceId}/comments/{commentId}/thread

Get a comment’s thread

Scope: comments:read. Instagram only. Cached 90 seconds for keys; at most 30 live fetches per hour per account. When the live fetch is refused or the account is backing off, the stored thread is returned with source: "stored"; otherwise 429 rate_limited with Retry-After. A failed live fetch answers 409 needs_reconnect (with platform + accountName), 404 not_found or 502 platform_error — never the platform’s own error text. Keys get no platform user ids: each comment carries byAccount (written by the connected account) instead of fromUserId, and there is no accountExternalId.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • commentId path · string · required

200 The thread, with source = live, cache or stored, and the post it is on (mediaId, platformMediaId, permalink).

POST/api/workspaces/{workspaceId}/comments/bulk-action

Moderate comments

Scope: comments:read. hide, unhide, hold_for_review, block_user, unblock_user need comments:moderate; delete needs comments:delete (on comments the account doesn’t own, platforms only allow a hide, so it hides). Keys: at most 25 comments per call (400 too_many_comments) and 200 per key per hour (429 agent_moderation_limit). YouTube writes reserve quota first; if none is left nothing is done (429/503 youtube_quota_exhausted).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • commentExternalIds string[] · required
  • action "hide" | "unhide" | "delete" | "hold_for_review" | "block_user" | "unblock_user" · required
  • restrictAuthor boolean
  • restoreBlock object

200 { ok, appliedCount, failedCount, results }

POST/api/workspaces/{workspaceId}/comments/hold-negatives

Hold negative comments on a post

Scope: comments:moderate. Holds every clearly negative, still-visible comment on one post (mediaId = the platform media id) for review; they stay up on the platform and land in the review queue. Comments that already have a review entry (alreadyHeld pending, alreadyDecided approved/rejected/expired) or that a person marked safe are skipped and cost nothing. Keys need comments:moderate; every comment held counts toward the 200-per-hour moderation cap. With fewer slots left than candidates, the most negative are held and the rest come back as notHeldOverLimit (a partial hold); with none left, nothing is held (429 agent_moderation_limit).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • mediaId string · required

200 { ok, held, alreadyHeld, alreadyDecided, notHeldOverLimit } — held counts entries actually created.

GET/api/workspaces/{workspaceId}/engage-queue

List reply drafts waiting for approval

Scopes: any of comments:read, dms:read. Pending reply drafts. Comment and mention drafts need comments:read; DM drafts need dms:read. People send or dismiss them in the app; createdByThisKey marks the ones this key drafted, which it may dismiss (POST engage-queue/{entryId}).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • assigned query · "me" — me = only items assigned to the member the key acts as (its creator).
  • channel query · "comment" | "mention" | "dm" — Only one kind of draft.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–50 — Page size (1–50, default 20).

200 The pending drafts. Each says what it answers by id — commentId, conversationId or mentionId (the others null) — with platformAccountId and fromDisplayName. A comment draft’s answering carries the post it is on (mediaId, platformMediaId, permalink).

POST/api/workspaces/{workspaceId}/engage-queue/{entryId}

Dismiss a reply draft this key created

Scopes: any of comments:reply, dms:reply. Takes back a draft the key put in the Engage queue (a reply in draft mode) before anyone sends it — it is never posted. Keys may only dismiss, and only their own drafts (createdByThisKey in GET engage-queue): 403 people_only for any other action, 403 api_key_not_draft_owner for another key’s or a Hayyvn-written draft. A comment or mention draft needs comments:reply, a DM draft dms:reply. 404 not_found unknown id; 409 already_resolved when it was already sent or dismissed.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • entryId path · string · required

Body · application/json

  • action "dismiss" · required

200 { ok: true, status: "dismissed" }

GET/api/workspaces/{workspaceId}/engage-queue/expired

List expired reply drafts

Scopes: any of comments:read, dms:read. Reply drafts that expired unsent, newest first (up to 200). A key sees only the kinds its scopes cover: comment and mention drafts with comments:read, DM and private-reply drafts with dms:read.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.

200 { total, items: [{ id, platform, channel, text, author, createdAt, expiredAt }] }

POST/api/workspaces/{workspaceId}/engage-queue/expired

Reopen expired reply drafts

Scopes: any of comments:reply, dms:reply. Puts expired drafts back in the Engage queue as ordinary drafts — a person still sends them; they never auto-send. Keys pass ids (at most 25, 400 too_many_ids); { all: true } is people-only (403 people_only). A key reopens only the kinds its reply scopes cover (comments:reply / dms:reply).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.

Body · application/json

  • Variant 1
  • ids string[] · required
  • Variant 2
  • all true · required

200 { ok, reopened }

GET/api/workspaces/{workspaceId}/faqs

List FAQs

Scopes: any of comments:read, dms:read. The creator’s saved FAQs: question (title), canonical answer, trigger keywords, accounts (accountIds empty = every account; scopeLost = its accounts were removed and it applies to none). Needs comments:read or dms:read. A key limited to some account groups sees every-account FAQs and FAQs naming only its accounts (one that also names another group’s account is hidden); never a lost-scope FAQ, and nothing at all when its groups give it no accounts. FAQs are changed by people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • stats query · "1" — 1 = add matchedCount: reply drafts the FAQ produced (from the caller’s accounts when limited).

200 { faqs: [{ id, title, answer, triggerKeywords, accountIds, active, scopeLost, autoAnswer, answerDms, createdAt, matchedCount? }] }

GET/api/workspaces/{workspaceId}/ghost-block

List ghost blocks

Scope: comments:read. People whose comments are silently hidden, newest first (up to 500). Not available to a key limited to some account groups (403 access_limited). A key never receives the platform user id or the note a person left; targetUsername is the handle without @, or null when only the user id is known. Adding and removing ghost blocks is for people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • counts query · "1" — 1 = add commentsHidden per entry and countsWindowDays (90): how many of each person’s comments the ghost block hid in that window that are still hidden (later unhides don’t count).

200 { entries: [{ id, platform, targetUsername, targetDisplayName, reason, addedAt, commentsHidden? }], countsWindowDays? }

GET/api/workspaces/{workspaceId}/media/{mediaId}/first-comment

Get a YouTube video’s first comment

Scope: comments:read. Whether Hayyvn posted the channel’s first comment on this published YouTube video, and which. mediaId is Hayyvn’s id (GET media → mediaId); the YouTube video id is accepted too. Needs comments:read. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see. text is the comment as Hayyvn last read it (null until it’s ingested); error says why the one set at publish wasn’t posted (comments_disabled, quota — retrying —, gave_up, account_unavailable, unknown, …). unconfirmed: true = a send got no answer from YouTube, so it may be live: nothing posts again until a person checks YouTube and clears it in Hayyvn.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

200 { mediaId, posted, unconfirmed, commentId, postedAt, url, text, error }

POST/api/workspaces/{workspaceId}/media/{mediaId}/first-comment

Post a YouTube video’s first comment

Scope: comments:reply. Posts the channel’s own top-level comment on a published YouTube video (usually a link — GET affiliate-links has the short links). Body { text }: trimmed, ≤ 2,000 characters including the key’s disclosure, no < > (400 invalid_first_comment). One per video: a video that has one → 409 already_posted with its commentId (also while another send is posting it). Needs comments:reply and a key in **send** mode — a draft-mode key gets 403 draft_mode_cannot_send (there is no queue entry to draft a top-level comment into); a send counts against the key’s hourly direct-send cap (429 agent_send_limit) and carries its disclosure. YouTube only (400 not_supported); 404 not_found for an unknown post or one on an account the key can’t see; 400 account_or_token_missing when the channel isn’t connected; 404 video_not_found when YouTube no longer has it; comments off on the video (made for kids, or turned off) → 409 comments_disabled; 409 while the account is being handed back to its creator. Pinning has no API — pin it in YouTube Studio. Each post uses 50 units of the day’s YouTube quota (429 youtube_quota_exhausted, nothing posted); at most 10 per hour per workspace (429 rate_limited). The key’s send slot is spent only once the video is claimed and the quota reserved. When YouTube gives no answer (timeout / network / 5xx) the comment may be live: 502 result_unknown, and every later send gets 409 first_comment_unconfirmed until a person checks YouTube and clears it in Hayyvn. Audited as media.first_comment_posted.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mediaId path · string · required

Body · application/json

  • text string ≤10000 · required

200 { mediaId, posted: true, commentId, postedAt, url, text }

GET/api/workspaces/{workspaceId}/mentions

List mentions

Scope: comments:read. Where people @-mention the creator (captions, comments, replies, stories), unhandled first then newest. 404 while mentions are turned off for Hayyvn. A key limited to some account groups sees only its accounts’ mentions. No platform user ids or avatar URLs.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — Only this connected account (an id from GET connections).
  • cursor query · string — The previous page’s nextCursor.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–100 — Page size (1–100, default 50).
  • platform query · "instagram" | "tiktok" | "youtube" — Only this platform.
  • q query · string ≤200 — Search the mention text and the author’s handle (at most 200 characters).
  • tab query · "all" | "unhandled" | "collab" | "complaints" — unhandled, collab or complaints (default: all).

200 { total, unhandled, nextCursor, mentions: [{ id, platform, account {id, name}, text, fromUsername, mentionType, intent, priority, sentiment, opportunityId, permalink, hasDraft, replyable, handled, at }] }

PATCH/api/workspaces/{workspaceId}/mentions

Mark a mention handled

Scope: comments:reply. Body { id, handled }. Local to Hayyvn — nothing changes on the platform. Keys need comments:reply; audited with the key (mention.handled_changed).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { ok }

GET/api/workspaces/{workspaceId}/mentions/{mentionId}/notes

Read a mention’s internal notes

Scope: comments:read. Needs comments:read. The team’s internal notes on a mention (never posted), oldest first. Keys see live notes only; author is "Agent · <key name>" for a note an API key wrote, otherwise the writer’s role ("Teammate · admin") or "Former member" — never an email or user id. Teammate mentions read as @label in body, and mentions lists them as { ref, label, role }. 404 while mentions or teammate mentions are turned off.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mentionId path · string · required

200 { notes: [{ id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }] }

POST/api/workspaces/{workspaceId}/mentions/{mentionId}/notes

Add an internal note to a mention

Scope: comments:moderate. Needs comments:moderate. An internal note for the team (1–2,000 characters after trimming) — never posted to the platform. It shows as "Agent · <key name>"; people can remove and restore it in the app. Keys: at most 60 notes per key per hour across comment, DM, mention and opportunity notes (429 agent_note_limit, fails closed). Mention teammates with <@ref> tokens (refs from GET …/mentions/{mentionId}/notes/mentionables); at most 10 per note, and anyone who can’t see this account fails the whole note (422 mention_not_eligible, nothing saved; 422 too_many_mentions past 10). assign (a <@ref> this note mentions) also assigns the mention’s pending reply draft — when there is none the note is still saved and assignError says why. 404 while mentions or teammate mentions are turned off.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mentionId path · string · required

Body · application/json

  • body string ≤2000 · required
  • assign string ≤64

201 { ok: true, note: { id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }, assigned?: { changed }, assignError?: { error, message } }

GET/api/workspaces/{workspaceId}/mentions/{mentionId}/notes/mentionables

List teammates who can be mentioned on a mention

Scope: comments:read. Needs comments:read. The teammates who can be @-mentioned in a note on this platform mention — members who can see its account (never clients). Each is { ref, label, role, canAssign, isSelf }: ref is an opaque, stable tm_… id for this workspace (write <@ref> in a note to mention them), label the short name Hayyvn shows, role their workspace role, canAssign whether they could be assigned the mention’s pending reply draft (always false when it has none). Never a user id or an email. 404 while mentions or teammate mentions are turned off.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mentionId path · string · required

200 { teammates: [{ ref, label, role, canAssign, isSelf }] }

POST/api/workspaces/{workspaceId}/mentions/{mentionId}/reply

Draft a reply to a mention

Scope: comments:reply. For a key this is ALWAYS a draft, whatever its reply mode: the reply waits in the Engage queue for a person to send (202 {status:"drafted", entryId}); a key never posts on someone else’s post. Instagram comment and caption mentions only (400 not_replyable); the key’s disclosure and the mentioner’s @handle must fit 2,200 characters (400 too_long). Refused like comment drafts: 409 reply_already_pending, 409 reply_already_sent, 429 agent_draft_limit, 429 agent_draft_backlog.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • mentionId path · string · required

Body · application/json

  • message string ≤2200 · required
  • idempotencyKey string ≤200

202 { ok, status: "drafted", entryId, replacedExistingDraft }

GET/api/workspaces/{workspaceId}/moderation-audit

Moderation history

Scope: comments:read. What was done to comments (and, with dms:read, DMs), newest first: hide, delete, block_user, hold_for_review…, to what (comment id, a short excerpt, author handle, account), whether it worked and who did it — rule:<rule>, autonomy, person (with their role) or agent:<key name>, never an email or user id. Replies, DMs sent and likes are not in it (400). A key limited to some account groups sees only its accounts’ rows; another group’s accountId is 404. Keys get no raw error text and no platform user id.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — Only this connected account.
  • action query · string — Only this action, e.g. hide, delete, block_user, hold_for_review.
  • authorHandle query · string — Only actions on this person’s comments (a leading @ is ignored).
  • commentId query · string — Our comment id (from GET comments) or the platform comment id.
  • cursor query · string — nextCursor from the previous page, unchanged.
  • limit query · integer 1–100 — Page size (1–100, default 50).
  • since query · string (date-time) — Only actions at or after this ISO date/time.

200 { items: [{ id, at, action, target: { kind, commentId, platformCommentId, excerpt, authorHandle, platform, account: { id, name } }, outcome, simulated, actor, ruleId, reason }], nextCursor }

GET/api/workspaces/{workspaceId}/people/{platform}/{userId}

Get a person

Scope: comments:read. Everything about one commenter on one platform: who they are, their standing (trusted, blocked, restricted or normal) with its detail (for a restriction: comments kept hidden, approvals in a row, when it lifts and who put it on — you, teammate, rule, agent, import or automatic), pending Review items, superfan tier (needs insights:read), a pending block suggestion, their newest 20 comments (status visible / hidden / deleted, account, post) with counters over the last 18 months, and the newest 20 moderation-history rows (the GET moderation-audit row). A key asks by handle: {userId} is then the handle (with or without @) and by=handle — keys never hold platform user ids (409 ambiguous_handle when two people used it). A key limited to some account groups gets only its accounts’ comments, counters and history; the standing, lists, pending, superfan and block-suggestion fields are null for it, and the person is 404 not_found unless they commented on its accounts. Keys get no person.userId, no avatar, no trusted note or block reason, the trimmed history row, and canAct all false. At most 120 reads per minute per caller (429 rate_limited).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • platform path · string · required
  • userId path · string · required
  • by query · "handle" — handle = {userId} is the person’s handle, not the platform user id.

200 { person: { platform, username, displayName, avatarUrl, firstSeenAt, lastSeenAt, ownAccount }, counts: { comments, hidden, deleted, visible }, standing, standingDetail, lists, pending: { restrictedWaiting, reviewWaiting }, superfan: { tier, score, rank, lastActiveAt }, blockSuggestion: { id, status, reasons }, comments: [{ id, platformCommentId, text, at, status, account: { id, name }, post: { mediaId, permalink, caption }, aiToxicity, aiSentiment }], commentsNextCursor, history, canAct }

GET/api/workspaces/{workspaceId}/personas

List personas

Scope: comments:read. The reply voices. A key gets each live persona’s name, a style summary of at most 300 characters (tone, formality, emoji, length and signature only — never the free-text extra instructions or guardrails) and what it covers: platform defaults (slots), per-account overrides (accounts) and group voices (groups), per channel — never the voice settings, knowledge, lessons or training examples. A key limited to some account groups sees personas covering its accounts, its groups, or a platform it has an account on, with coverage trimmed to its own. Personas are changed by people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 For a key: { personas: [{ id, name, styleSummary, covers: { slots: [{ platform, channelType }], accounts: [{ platformAccountId, platform, name, channelType }], groups: [{ groupId, name, channelType }] } }], parked: [], removed: [] }

GET/api/workspaces/{workspaceId}/review-queue

List the review queue

Scope: comments:read. Held-for-review comments waiting on a decision, oldest first (the /review queue): entryId, why it was held (source, reason, ruleId, wouldDo), expiresAt, and the comment with its account and post (mediaId, platformMediaId, permalink).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • cursor query · string — Opaque cursor from the previous page’s nextCursor.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–100 — Page size (default 50, max 100).
  • source query · "restricted" — restricted = only comments from restricted people (already hidden; keep shows them). Any other value is 400 invalid_request.

200 { items, nextCursor, total } (total on the first page only).

POST/api/workspaces/{workspaceId}/review-queue/bulk-resolve

Resolve review items

Scope: comments:read. keep, hide, block_user need comments:moderate; delete needs comments:delete; mark_safe is people-only (403 people_only). Keys: at most 25 entries per call (400 too_many_comments), each counts toward the 200-per-hour moderation cap (429 agent_moderation_limit), YouTube writes reserve quota first (429/503 youtube_quota_exhausted); entries all already decided → 409 already_resolved (409 expired when they aged out); an entry on a disconnected account → 404 not_found for the whole batch (GET review-queue never lists those).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • entries object[] · required
  • restrictAuthor boolean

200 { results }: per entry { id, ok, error?, downgraded? }; a failed platform call leaves the entry pending.

GET/api/workspaces/{workspaceId}/review-queue/expired

List expired review items

Scope: comments:read. Held comments that aged out of the review queue, newest first (up to 200).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.

200 { total, items }

POST/api/workspaces/{workspaceId}/review-queue/expired

Reopen expired review items

Scope: comments:moderate. Puts expired items back in the review queue. Keys need comments:moderate and pass ids (at most 25); { all: true } is people-only (403 people_only).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.

Body · application/json

  • Variant 1
  • ids string[] · required
  • Variant 2
  • all true · required

200 { ok, reopened }

GET/api/workspaces/{workspaceId}/rule-suggestions

List rule suggestions

Scope: comments:read. Moderation rules Hayyvn suggests from the workspace’s comments, strongest first (up to 100). Read-only for keys — people accept or dismiss them in the app. Not available to a key limited to some account groups.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • status query · "pending" | "accepted" | "dismissed" | "superseded" | "all" — pending (default), accepted, dismissed, superseded or all.

200 { suggestions: [{ id, proposedPattern, proposedAction, reason, matchedCount, confidence, status, createdAt, resolvedAt }] }

GET/api/workspaces/{workspaceId}/rules

List moderation rules

Scope: comments:read. Live moderation rules (up to 500) with what they match, their action, platform, group scope (groupId null = every account) and starter pack. A key limited to some account groups sees every-account rules and its own groups’ rules, with hit stats from its accounts only. For a key, a regular expression longer than 60 characters comes back as pattern: null with patternLength. Rules are changed by people in the app — no key can edit them.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • stats query · "1" — 1 = add hitCount and lastFiredAt per rule.

200 { rules: [{ id, platform, pattern, patternLength?, matchMode, threshold, action, severity, enabled, groupId, groupName, groupRemoved, createdAt, appliesTo, packId, packName, patternUnsafe, hitCount?, lastFiredAt? }] }

POST/api/workspaces/{workspaceId}/rules/preview

Preview a moderation rule

Scope: comments:read. Dry-runs a rule against recent comments (up to 2,000) and returns matching samples. Nothing is saved — rules are created by people in the app. Not available to a key limited to some account groups. 60 previews per key per hour (429 agent_preview_limit); an unsafe regular expression is 400 invalid_pattern.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • pattern string ≤200
  • matchMode "substring" | "word_boundary" | "obfuscated" | "regex" | "link_present" | "link_domain" | "username_pattern" | "all_caps" | "emoji_only" · required
  • sinceDays integer 1–365
  • limit integer 1–200
  • groupId string ≤64 | null

200 { totalScanned, matches: [{ externalId, text, fromUsername, platform, externalMediaId, externalTimestamp }], truncated, timedOut, groupInactive? }

GET/api/workspaces/{workspaceId}/standing

List restricted people

Scope: comments:read. People who are restricted, newest first (up to 500), workspace-wide per platform: their new comments are hidden the moment they arrive and wait in Review until a person approves them (approving shows the comment). Per person: strikes = comments kept hidden while restricted, approvals = approvals in a row, liftAt = when the restriction lifts by itself (enough approvals in a row lift it sooner). Not available to a key limited to some account groups (403 access_limited). A key never receives the platform user id or the note a person left; targetUsername is the handle without @, or null when only the user id is known.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • handle query · string ≤200 — Only this person, by handle (with or without @, case-insensitive; needs platform).
  • platform query · "instagram" | "youtube" | "tiktok" | "facebook" — Only this platform (instagram, youtube, tiktok, facebook). Required with targetUserId or handle.
  • removed query · "1" — 1 = the Removed list (lifted or unrestricted people — people only; a key always gets the live list).
  • targetUserId query · string ≤200 — Only this person, by the platform’s own user id (needs platform).

200 { entries: [{ id, platform, targetUsername, targetDisplayName, restrictedAt, restrictedBy, restrictedByLabel, strikes, approvals, liftAt, removedAt, liftedReason, liftedReasonLabel }] }

POST/api/workspaces/{workspaceId}/standing

Restrict a person

Scope: comments:moderate. Needs comments:moderate. Restricts someone on one platform, on every account of it: from now on their new comments are hidden on arrival and wait in Review for a person’s approval. Give targetUserId or handle (someone who has commented on the workspace’s accounts with it — 404 person_not_found when no one has, 409 ambiguous_handle when two people have). Each call takes one slot of the key’s 200-per-hour moderation cap (429 agent_moderation_limit, nothing done), and the workspace allows 120 restrictions per hour (429 rate_limited). Not available to a key limited to some account groups (403 access_limited). 409 trusted for someone on the Trusted people list, 409 blocked for someone already ghost-blocked, 409 own_account for one of the workspace’s own accounts. A note from a key is not stored. Already restricted → 200 { alreadyRestricted: true }, nothing changes.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

Body · application/json

  • platform "instagram" | "youtube" | "tiktok" | "facebook" · required
  • targetUserId string ≤200
  • handle string ≤200
  • targetUsername string ≤200
  • targetDisplayName string ≤200
  • note string ≤500

201 { entry: { id, platform, targetUsername, targetDisplayName, restrictedAt, restrictedBy, strikes, approvals, liftAt } } (200 with alreadyRestricted: true when they already were)

DELETE/api/workspaces/{workspaceId}/standing/{standingId}

Unrestrict a person

Scope: comments:moderate. Needs comments:moderate. Lifts a restriction (id from GET standing): their new comments show normally again; comments already hidden stay as they are. Idempotent. Not available to a key limited to some account groups (403 access_limited); 404 not_found for an unknown id; the workspace allows 120 restrict/unrestrict changes per hour (429 rate_limited). People can restore it from the Removed list in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • standingId path · string · required

200 { ok: true }

GET/api/workspaces/{workspaceId}/trusted

List trusted people

Scope: comments:read. People Hayyvn never moderates, newest first (up to 500), workspace-wide. Not available to a key limited to some account groups (403 access_limited). A key never receives the platform user id or the note a person left; targetUsername is the handle without @, or null when only the user id is known. Trusting and removing people is for people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • removed query · "1" — 1 = the Removed list (people only — a key always gets the live list).

200 { entries: [{ id, platform, targetUsername, targetDisplayName, note, addedAt, removedAt }] }

DMs

Instagram direct messages and the opportunity pipeline.

GET/api/workspaces/{workspaceId}/auto-dm

List auto-DM campaigns

Scope: dms:read. Comment-to-DM campaigns, newest first. A key limited to some account groups sees only its accounts’ campaigns. A key never receives the DM text (dmVariants, publicReply). Campaigns are changed by people in the app — no key can edit, pause or switch them.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • stats query · "1" — 1 = add sentLast7d: DMs the campaign sent in the last 7 days.

200 { campaigns: [{ id, name, platformAccountId, scopeMediaIds, triggerKeywords, offerId, active, activeUntil, maxSends, mode, matchedCount, sentCount, createdAt, sentLast7d? }] }

GET/api/workspaces/{workspaceId}/dms

List DM conversations

Scope: dms:read. Direct-message conversations, most recent first. q is a windowed search: each call examines the next 500 conversations in scope, so a page can be short or empty with a nextCursor — keep paging. Keys: 360 q calls per key per hour — every page counts, since each examines up to 500 conversations (429 agent_search_limit, fails closed); no participantUserId (the person’s platform user id) and no assigneeUserId — assignee: { role } instead; assigned=me means threads assigned to the person who created the key.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • accountId query · string — Only this connected account (an id from GET connections).
  • archived query · "1" | "0" | "true" | "false" — 1/true = only archived conversations; 0/false = only unarchived. Omit for both.
  • assigned query · "me" — me = only items assigned to the member the key acts as (its creator).
  • cursor query · string — Opaque cursor from the previous page’s nextCursor.
  • flagged query · "1" | "0" | "true" | "false" — 1/true = only flagged conversations; 0/false = only unflagged. Omit for both.
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer 1–100 — Page size (1–100, default 100).
  • q query · string ≤100 — Search, case-insensitive: the person’s handle or name, or the text of a message in the thread (unsent messages excluded). A leading @ is ignored.
  • snoozed query · "1" | "0" | "true" | "false" — 1/true = only conversations snoozed right now (snoozedUntil in the future); 0/false = only ones not snoozed. Omit for both.
  • unread query · "1" | "0" | "true" | "false" — 1/true = only conversations with unread messages; 0/false = only read ones.

200 The conversations and nextCursor (null on the last page).

GET/api/workspaces/{workspaceId}/dms/{conversationId}

Get a conversation

Scope: dms:read. One conversation’s messages, newest page first, with platformAccountId, participantName and lastInboundAt (Instagram allows replies only within 24 hours of the person’s last message). Keys get no participantUserId or accountExternalId (platform user ids). c545: keys also get no signed story media URLs on messages (replyToStoryMediaUrl, storyMentionMediaUrl, storyMediaThumbUrl are absent; replyToStoryId / storyMention stay), attachments as { type, label } (no url) and reactions as { emoji } (no actorId).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required
  • before query · string ≤64 — Cursor: return messages older than this one.
  • limit query · integer — Messages per page.

200 The conversation and a page of messages.

PATCH/api/workspaces/{workspaceId}/dms/{conversationId}

Flag, archive or snooze a conversation

Scope: dms:reply. Needs dms:reply. Keys may send only flagged, archived and/or snoozedUntil (all reversible; nothing is sent to Instagram). snoozedUntil (ISO-8601 with offset, 1 minute to 1 year ahead; null = unsnooze) takes the thread out of the inbox until then — it comes back marked unread, or sooner when the person writes; snoozing unarchives, archiving unsnoozes, and both in one call is 400. markRead or any other field is 403 people_only — marking a thread read clears the unread signal a person relies on. 404 not_found for an unknown id or another group’s conversation.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

Body · application/json

  • flagged boolean
  • archived boolean
  • snoozedUntil string | null (date-time)

200 { ok: true } (plus snoozedUntil when it was sent)

POST/api/workspaces/{workspaceId}/dms/{conversationId}/ai-pause

Pause the AI on a conversation

Scope: dms:reply. Needs dms:reply. { action: "pause", preset: "4h" | "24h" | "indefinite" } stops Hayyvn’s autonomous sends (auto-reply, Auto-DM, deal vetting and follow-ups) on this thread until then — drafts still appear for a person. indefinite lasts until a person turns it back on. { action: "resume" } is people-only: a key gets 403 people_only. 404 not_found for an unknown id or another group’s conversation.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

Body · application/json

  • action "pause" | "resume" · required
  • preset "4h" | "24h" | "indefinite"

200 { aiPausedUntil, aiPauseReason, indefinite }

GET/api/workspaces/{workspaceId}/dms/{conversationId}/notes

Read a conversation’s internal notes

Scope: dms:read. Needs dms:read. The team’s internal notes on the thread (never sent to Instagram), oldest first. Keys see live notes only; author is "Agent · <key name>" for a note an API key wrote, otherwise the writer’s role ("Teammate · admin") or "Former member" — never an email or user id. Teammate mentions read as @label in body, and mentions lists them as { ref, label, role }.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

200 { notes: [{ id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }] }

POST/api/workspaces/{workspaceId}/dms/{conversationId}/notes

Add an internal note to a conversation

Scope: dms:reply. Needs dms:reply. An internal note for the team (1–2,000 characters after trimming) — never sent to Instagram. It shows as "Agent · <key name>"; people can remove and restore it in the app. Keys: at most 60 notes per key per hour across comment, DM and opportunity notes (429 agent_note_limit, fails closed). Plan 49: a note may mention teammates with <@ref> tokens (refs from GET …/notes/mentionables); they are told in Hayyvn. At most 10 per note; anyone who can’t see this account fails the whole note (422 mention_not_eligible, nothing saved; 422 too_many_mentions past 10). Mentions count against the same hourly cap. assign (plan 49 P8: a tm_ ref the note mentions — 400 assign_not_mentioned otherwise, nothing saved) also assigns the conversation to that teammate after the note is saved; if they can’t be assigned (a viewer, or no access) the note stays and assignError says why. The assignee is told once — the mention’s alert says both.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

Body · application/json

  • body string ≤2000 · required
  • assign string ≤64

201 { ok: true, note: { id, body, author, byAgent, createdAt, mentions: [{ ref, label, role }] }, assigned?: { changed }, assignError?: { error, message } }

GET/api/workspaces/{workspaceId}/dms/{conversationId}/notes/mentionables

List teammates who can be mentioned on a conversation

Scope: dms:read. Needs dms:read. The teammates who can be @-mentioned in a note on this DM thread — members who can see its account (never clients). Each is { ref, label, role, canAssign, isSelf }: ref is an opaque, stable tm_… id for this workspace (write <@ref> in a note to mention them), label the short name Hayyvn shows (the part of their email before the @), role their workspace role, canAssign whether they could be assigned the thread. Never a user id or an email (isSelf marks the person who created the key). 404 not_found while teammate mentions are off for the workspace.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

200 { teammates: [{ ref, label, role, canAssign, isSelf }] }

POST/api/workspaces/{workspaceId}/dms/{conversationId}/reply

Reply to a DM

Scope: dms:reply. Instagram only, and only within 24 hours of the person’s last message (409 outside_messaging_window). Follows the key’s reply mode like comment replies (send mode: at most 20 per key per hour). humanAgent is refused for keys (403 human_agent_not_for_keys). Send mode never posts the same reply twice: pass idempotencyKey (any string ≤ 200, one per reply you mean to send) and reuse it on retry — a repeat returns the first result with replayed: true; without one, the same text to the same target within 5 minutes counts as a repeat. 409 send_in_progress while another send to it is going out; 422 idempotency_key_reused for a key already used on a different reply. 504 outcome_unknown (outcomeUnknown: true): the platform didn’t answer in time and the reply may be live — a retry is checked against the platform first, and refused with 409 outcome_unknown while that can’t be confirmed. When Instagram refuses a send: 502 needs_reconnect (the connection expired), 422 outside_window / invalid_recipient, 429 rate_limited, 502 provider_error — each with a readable message, never Instagram’s own error text (c650).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • conversationId path · string · required

Body · application/json

  • text string ≤1000 · required
  • humanAgent boolean
  • humanProof object
  • replyDraftId string ≤64
  • idempotencyKey string ≤200

202 { status: "drafted", entryId } in draft mode; the sent message in send mode (200).

GET/api/workspaces/{workspaceId}/offers

List offers

Scope: dms:read. The creator’s offers (discount / link / pitch) with the code and url meant for fans, accounts (accountIds empty = every account) and campaignsUsing (live auto-DM campaigns using it). A key limited to some account groups sees every-account offers and offers naming only its accounts (an offer also scoped to another group’s account is hidden — its code and text were written for both; campaignsUsing counts only its accounts’ campaigns); never a lost-scope offer, and nothing when its groups give it no accounts. Offers are changed by people in the app.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).

200 { offers: [{ id, name, kind, body, code, url, accountIds, active, scopeLost, createdAt, campaignsUsing }] }

GET/api/workspaces/{workspaceId}/opportunities

List opportunities

Scope: dms:read. The deal pipeline built from DMs. Each deal carries accountId (its own account, else its conversation’s). A deal counts for a group through its account or its conversation’s account; unattributed deals appear only without group.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • group query · string ≤100 — Account group: its id, its name (case-insensitive) or none (accounts in no group). Intersects with accountId. An empty group returns an empty list (never every account); an unknown or removed group is 404 group_not_found; over 100 characters is 400 invalid_request.
  • limit query · integer — Page size (default 20).
  • maybes query · "1" — 1 = the low-confidence tier instead.
  • status query · "open" | "won" | "lost" | "archived" | "all" — Default open. all leaves archived deals out; archived lists only those.

200 The opportunities.

GET/api/workspaces/{workspaceId}/opportunities/{oppId}

Get an opportunity

Scope: dms:read. Needs dms:read. One deal in full: stage, category, brand, summary, confidence, deal value + currency, due date, next follow-up, conversationId, from, followUpDraft (the parked AI follow-up, or null), notes (authors as "Agent · <key name>" or "Teammate · <role>" — never an email or user id; teammate mentions as @label plus mentions: [{ ref, label, role }]) and timeline. Never the contact email or the commission split. 404 not_found for an unknown id, another group’s or an unattributed deal (group-limited keys), or a deal on a disconnected account.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • oppId path · string · required

200 { opportunity: { id, status, …, notes: [{ id, body, author, byAgent, createdAt }], timeline: [{ at, kind, by, … }] } }

POST/api/workspaces/{workspaceId}/opportunities/{oppId}

Move an opportunity to another stage

Scope: opportunities:write. Needs opportunities:write. Keys may send only { "action": "status", "status": … } with new, qualifying, negotiating, lost or archived. won, moving a deal that is already won (both touch the commission) and every other action (send_question, approve_follow_up, dismiss_follow_up) are 403 people_only. The same stage again is 200 with unchanged: true and changes nothing. The move only lands if the deal is still in the stage the key read: a deal a person moved (or marked won) in between is 409 deal_changed, nothing written. A key’s close records no person as resolvedBy; the audit carries the key. Local to Hayyvn. 404 not_found as for GET (including a deal on a disconnected account).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • oppId path · string · required

200 { ok: true, status } (plus unchanged: true when it was already there)

POST/api/workspaces/{workspaceId}/opportunities/{oppId}/notes

Add a note to an opportunity

Scope: opportunities:write. Needs opportunities:write. A note for the team (1–2,000 characters after trimming) — never sent to the brand. It shows as "Agent · <key name>". 404 not_found as for GET (including a deal on a disconnected account). At most 60 notes per key per hour across comment, DM and opportunity notes (429 agent_note_limit, fails closed; a note that fails to save gives its slot back). Plan 49: mention teammates with <@ref> tokens (refs from GET …/opportunities/{oppId}/notes/mentionables); at most 10 per note, and anyone who can’t see every account the deal names fails the whole note (422 mention_not_eligible, nothing saved).

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • oppId path · string · required

Body · application/json

  • body string ≤2000 · required

200 { ok: true, note: { id, body, author, byAgent, createdAt } }

GET/api/workspaces/{workspaceId}/opportunities/{oppId}/notes/mentionables

List teammates who can be mentioned on an opportunity

Scope: dms:read. Needs dms:read. The teammates who can be @-mentioned in a note on this deal — members who can see every account it names (its own and its DM thread’s; an unattributed deal: members with access to every account). canAssign is always false (deals have no assignee). Each is { ref, label, role, canAssign, isSelf }: ref is an opaque, stable tm_… id for this workspace (write <@ref> in a note to mention them), label the short name Hayyvn shows (the part of their email before the @), role their workspace role. Never a user id or an email (isSelf marks the person who created the key). 404 not_found while teammate mentions are off for the workspace. 404 not_found as for GET opportunity.

Parameters

  • workspaceId path · string · required — The workspace the key belongs to (see GET /api/api-keys/self).
  • oppId path · string · required

200 { teammates: [{ ref, label, role, canAssign: false, isSelf }] }

MCP

The Model Context Protocol endpoint for AI agents.

POST/api/mcp

MCP endpoint (Model Context Protocol)

Any valid key. Remote MCP server for AI agents: Streamable HTTP transport, stateless, JSON responses, one JSON-RPC message per request (no batches). Any valid key; the agent sees only the tools its scopes allow, and each tool calls the same routes listed here, so every check still applies. Limited to 120 requests per minute per key (429, with Retry-After).

Body · application/json

  • jsonrpc "2.0" · required
  • id string | integer
  • method string · required
  • params object

200 One JSON-RPC 2.0 response.