API reference

AI

10 endpoints, served at https://orbitwrite.com/api/v1. Each one lists the credentials it accepts, its parameters and every response it can give.

Run a composer assistant intent#

POST/api/v1/ai/assistant

Streams AI-generated text for one of the assistant panel's intents (refine, optimize, tone, translate, CTA, hashtags, promote a URL, generate, ideas). Scoped to the session's active workspace.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Body application/json

intentstringRequired
  • "refine"
  • "optimize_social"
textstringRequired

Between 1 and 25000 characters.

platformstring

At most 100 characters.

maxCharsPerPostinteger

At least 0.

accountIdstring

At least 1 character.

Responses

200string

The generated text stream

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
500Error

No AI provider configured

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/assistant
curl -X POST "https://orbitwrite.com/api/v1/ai/assistant" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "intent": "refine",
  "text": "string"
}'
Response
"string"

Refine post text#

POST/api/v1/ai/refine

Streams an edited version of the supplied post text for one of the refine palette's actions. The free-text custom action runs an abuse pre-flight (scope classifier + moderation). Scoped to the session's active workspace.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Body application/json

promptstringRequired

Between 1 and 25000 characters.

actionstringRequired
  • "improve"
  • "grammar"
  • "spelling"
  • "punchier"
  • "shorten"
  • "expand"
  • "rewrite"
  • "announcement"
  • "structure"
  • "positive"
  • "split"
  • "poll"
  • "custom"
platformstring

At most 100 characters.

maxCharsPerPostinteger

At least 0.

accountIdstring

At least 1 character.

fullContextstring

At most 25000 characters.

instructionstring

At most 500 characters.

variationinteger

Between 0 and 10.

Responses

200string

The generated text stream

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
422Error

Custom instruction refused by the scope guard

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
500Error

No AI provider configured

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/refine
curl -X POST "https://orbitwrite.com/api/v1/ai/refine" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "string",
  "action": "improve"
}'
Response
"string"

Plan campaign post angles from an article#

POST/api/v1/ai/campaign-plan

Reads the article behind a campaign's source URL and breaks its content into count distinct post angles. Free-text sources return reason: "not_url" so the client can fall back to its template generator.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Body application/json

sourcestringRequired

Between 1 and 4000 characters.

countintegerRequired

Between 1 and 40.

variationinteger

Between 0 and 50.

Responses

200AiCampaignPlanResult

The planned angles, or a not_url fallback signal

Response attributes
okbooleanRequired
topicsstring[]
titlestring | null
truncatedboolean
reasonstring
errorstring
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
422Error

The URL couldn't be fetched or read

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
502Error

The model couldn't produce topics from the article

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/campaign-plan
curl -X POST "https://orbitwrite.com/api/v1/ai/campaign-plan" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source": "string",
  "count": 1
}'
Response
{
  "ok": true,
  "topics": [
    "string"
  ],
  "title": "string",
  "truncated": true,
  "reason": "string",
  "error": "string"
}

Generate a campaign name#

POST/api/v1/ai/campaign-name

Generates a short campaign name from free-text context. Non-streaming.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Body application/json

contextstringRequired

Free-text topic the name is derived from

At most 500 characters.

Responses

200AiCampaignNameResult

The generated name

Response attributes
okbooleanRequired
namestring
errorstring
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
500Error

No AI provider configured

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/campaign-name
curl -X POST "https://orbitwrite.com/api/v1/ai/campaign-name" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "context": "string"
}'
Response
{
  "ok": true,
  "name": "string",
  "error": "string"
}

Generate alt text for an image#

POST/api/v1/ai/alt-text

Describes one of the workspace's uploaded images for screen readers, by mediaId or by its url. Optional context (the post's text) steers what the description emphasises. Returns a suggestion and stores nothing — set it as altText on the post's attachment to use it. Spends one AI assist; requires media:read. At most 1,000 characters, the shortest limit among the networks that take alt text.

Authentication

An API key or OAuth access token as a bearer token, or a signed-in session.

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Body application/json

mediaIdstring

The image's media id — from an upload, list_media, or a post's attachment.

At least 1 character.

urlstring

The image's URL, for an attachment that carries no media id. Must be one of this workspace's own uploads.

Format uri.

contextstring

The post the image goes with. Used to decide what in the image matters, never as a source of facts the image doesn't show.

At most 2000 characters.

Responses

200AltTextSuggestion

The suggested alt text

Response attributes
mediaIdstringRequired
altTextstringRequired
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
502Error

An upstream provider failed

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/alt-text
curl -X POST "https://orbitwrite.com/api/v1/ai/alt-text" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "mediaId": "string",
  "url": "https://example.com",
  "context": "string"
}'
Response
{
  "mediaId": "string",
  "altText": "string"
}

Chat with the assistant agent#

POST/api/v1/ai/agent

Streams an AI SDK UI message stream for a free-text conversation in which the model may call workspace tools (the MCP server's, under the caller's own permissions), app tools (run by the browser, such as opening a post) and, when context describes an open composer, composer tools (run by the browser on the open post). Tools that change or remove existing state stop for the caller's approval. Session only.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Body application/json

messagesany[]Required

At least 1 item.

organizationIdstring

At least 1 character.

contextobject
Child attributes
groupIdstring | nullRequired

At least 1 character.

titlestring

At most 200 characters. Defaults to "".

tagsstring[]

At most 50 items. Defaults to [].

textstring

At most 25000 characters. Defaults to "".

statusstring | null

At most 50 characters. Defaults to null.

scheduledAtstring | null

At most 40 characters. Defaults to null.

channelsobject[]

At most 20 items. Defaults to [].

Child attributes
idstringRequired

At least 1 character.

platformstringRequired

At most 50 characters.

namestring | nullRequired

At most 200 characters.

maxCharsinteger | nullRequired

At least 0.

threadsboolean | null

Defaults to null.

maxMediainteger | null

At least 0. Defaults to null.

syncedbooleanRequired
formatstring | null

Defaults to null.

  • "post"
  • "story"
  • "reel"
  • "short"
  • null
formatsstring[]

At most 4 items. Defaults to [].

  • "post"
  • "story"
  • "reel"
  • "short"
engagementstring[]

At most 5 items. Defaults to [].

timezonestring | null

At most 64 characters. Defaults to null.

suggestionsobject[]

At most 50 items. Defaults to [].

Child attributes
idstringRequired

At least 1 character.

typestring | nullRequired

At most 20 characters.

textstringRequired

At most 500 characters.

openCommentsinteger

At least 0. Defaults to 0.

mediaobject[]

At most 20 items. Defaults to [].

Child attributes
mimeTypestringRequired

At most 100 characters.

altstring | nullRequired

At most 300 characters.

mediaIdstring | null

At most 200 characters. Defaults to null.

pageobject
Child attributes
pathstringRequired

At most 300 characters.

titlestring | null

At most 200 characters. Defaults to null.

timezonestring | null

At most 64 characters. Defaults to null.

detailsstring[]

At most 12 items. Defaults to [].

focusobject[]

At most 10 items. Defaults to [].

Child attributes
typestringRequired
  • "campaign"
  • "post"
  • "channel"
  • "conversation"
idstringRequired

Between 1 and 200 characters.

labelstring | nullRequired

At most 200 characters.

approvalModestring

Defaults to "ask".

  • "ask"
  • "auto"
conversationIdstring

Between 8 and 64 characters.

Responses

200string

The UI message stream

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
500Error

No AI provider configured

Response attributes
errorstringRequired
issuesany[]
501Error

This host serves no agent

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/ai/agent
curl -X POST "https://orbitwrite.com/api/v1/ai/agent" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "messages": []
}'
Response
"string"

Your recent conversations with Orb AI#

GET/api/v1/assistant/conversations

Newest first, up to 30. Your own only. Session only.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Responses

200object

The history list

Response attributes
conversationsAssistantConversationSummary[]Required
Child attributes
idstringRequired
titlestringRequired
updatedAtstringRequired
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/assistant/conversations
curl -X GET "https://orbitwrite.com/api/v1/assistant/conversations" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "conversations": [
    {
      "id": "string",
      "title": "string",
      "updatedAt": "string"
    }
  ]
}

One of your conversations with Orb AI#

GET/api/v1/assistant/conversations/{id}

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Path parameters

idstringRequired

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Responses

200AssistantConversation

The conversation

Response attributes
idstringRequired
titlestringRequired
updatedAtstringRequired
messagesany[]Required

The AI SDK UI transcript, as the chat held it.

401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/assistant/conversations/{id}
curl -X GET "https://orbitwrite.com/api/v1/assistant/conversations/{id}" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "id": "string",
  "title": "string",
  "updatedAt": "string",
  "messages": []
}

Delete one of your conversations with Orb AI#

DELETE/api/v1/assistant/conversations/{id}

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Path parameters

idstringRequired

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Responses

204

Deleted

401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
DELETE /api/v1/assistant/conversations/{id}
curl -X DELETE "https://orbitwrite.com/api/v1/assistant/conversations/{id}" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "error": "string",
  "issues": []
}

Record a post created from one of Orb AI's post cards#

POST/api/v1/assistant/conversations/{id}/created-posts

Marks the show_post card toolCallId as created as the draft groupId, so the card stays created after a reload and Orb AI's next turn knows the post exists. Your own conversations only. Session only.

Authentication

A signed-in session only. The Orbitwrite app calls this; an API key is refused.

Path parameters

idstringRequired

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Body application/json

toolCallIdstringRequired

Between 1 and 200 characters.

groupIdstringRequired

Between 1 and 200 characters.

Responses

204

Recorded

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/assistant/conversations/{id}/created-posts
curl -X POST "https://orbitwrite.com/api/v1/assistant/conversations/{id}/created-posts" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "toolCallId": "string",
  "groupId": "string"
}'
Response
{
  "error": "string",
  "issues": []
}