API reference

Account

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

Read the signed-in user's profile and preferences#

GET/api/v1/account

Authentication

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

Responses

200Me

The signed-in user

Response attributes
idstringRequired
emailstring | nullRequired
namestring | nullRequired
appearancestring | nullRequired
timezonestring | nullRequired
weekStartDaystring | nullRequired
timeFormatstring | nullRequired
  • "auto"
  • "12h"
  • "24h"
  • null
defaultLandingPagestring | nullRequired
defaultComposerPanelstringRequired
  • "none"
  • "info"
  • "assistant"
  • "ideas"
  • "hashtags"
  • "preview"
  • "comments"
defaultOrganizationIdstring | nullRequired
notifyMentionEmailboolean | nullRequired
notifyCommentInAppboolean | nullRequired
notifyCommentEmailboolean | nullRequired
notifyPublishInAppboolean | nullRequired
notifyPublishEmailboolean | nullRequired
notifyPostErrorEmailboolean | nullRequired
notifyApprovalRequestEmailboolean | nullRequired
notifyApprovedInAppboolean | nullRequired
notifyApprovedEmailboolean | nullRequired
notifyRejectedInAppboolean | nullRequired
notifyRejectedEmailboolean | nullRequired
notifyReconnectEmailboolean | nullRequired
notifyWeeklyDigestEmailboolean | nullRequired
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/account
curl -X GET "https://orbitwrite.com/api/v1/account" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "id": "string",
  "email": "string",
  "name": "string",
  "appearance": "string",
  "timezone": "string",
  "weekStartDay": "string",
  "timeFormat": "auto",
  "defaultLandingPage": "string",
  "defaultComposerPanel": "none",
  "defaultOrganizationId": "string",
  "notifyMentionEmail": true,
  "notifyCommentInApp": true,
  "notifyCommentEmail": true,
  "notifyPublishInApp": true,
  "notifyPublishEmail": true,
  "notifyPostErrorEmail": true,
  "notifyApprovalRequestEmail": true,
  "notifyApprovedInApp": true,
  "notifyApprovedEmail": true,
  "notifyRejectedInApp": true,
  "notifyRejectedEmail": true,
  "notifyReconnectEmail": true,
  "notifyWeeklyDigestEmail": true
}

Update the signed-in user's profile and preferences#

PATCH/api/v1/account

Partial update — only the fields present are written. Runs through Better Auth so its user-update hooks apply.

Authentication

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

Body application/json

namestring

Between 1 and 120 characters.

appearancestring
  • "light"
  • "dark"
  • "system"
timezonestring

At most 64 characters.

weekStartDaystring
  • "saturday"
  • "sunday"
  • "monday"
timeFormatstring
  • "auto"
  • "12h"
  • "24h"
defaultLandingPagestring
  • "dashboard"
  • "planner"
  • "schedule"
  • "inbox"
  • "campaigns"
  • "activity"
defaultComposerPanelstring
  • "none"
  • "info"
  • "assistant"
  • "ideas"
  • "hashtags"
  • "preview"
  • "comments"
defaultOrganizationIdstring

At least 1 character.

Responses

200Me

The user after the update

Response attributes
idstringRequired
emailstring | nullRequired
namestring | nullRequired
appearancestring | nullRequired
timezonestring | nullRequired
weekStartDaystring | nullRequired
timeFormatstring | nullRequired
  • "auto"
  • "12h"
  • "24h"
  • null
defaultLandingPagestring | nullRequired
defaultComposerPanelstringRequired
  • "none"
  • "info"
  • "assistant"
  • "ideas"
  • "hashtags"
  • "preview"
  • "comments"
defaultOrganizationIdstring | nullRequired
notifyMentionEmailboolean | nullRequired
notifyCommentInAppboolean | nullRequired
notifyCommentEmailboolean | nullRequired
notifyPublishInAppboolean | nullRequired
notifyPublishEmailboolean | nullRequired
notifyPostErrorEmailboolean | nullRequired
notifyApprovalRequestEmailboolean | nullRequired
notifyApprovedInAppboolean | nullRequired
notifyApprovedEmailboolean | nullRequired
notifyRejectedInAppboolean | nullRequired
notifyRejectedEmailboolean | nullRequired
notifyReconnectEmailboolean | nullRequired
notifyWeeklyDigestEmailboolean | nullRequired
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
PATCH /api/v1/account
curl -X PATCH "https://orbitwrite.com/api/v1/account" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "appearance": "light",
  "timezone": "string",
  "weekStartDay": "saturday",
  "timeFormat": "auto",
  "defaultLandingPage": "dashboard",
  "defaultComposerPanel": "none",
  "defaultOrganizationId": "string",
  "notifyMentionEmail": true,
  "notifyCommentInApp": true,
  "notifyCommentEmail": true,
  "notifyPublishInApp": true,
  "notifyPublishEmail": true,
  "notifyPostErrorEmail": true,
  "notifyApprovalRequestEmail": true,
  "notifyApprovedInApp": true,
  "notifyApprovedEmail": true,
  "notifyRejectedInApp": true,
  "notifyRejectedEmail": true,
  "notifyReconnectEmail": true,
  "notifyWeeklyDigestEmail": true
}'
Response
{
  "id": "string",
  "email": "string",
  "name": "string",
  "appearance": "string",
  "timezone": "string",
  "weekStartDay": "string",
  "timeFormat": "auto",
  "defaultLandingPage": "string",
  "defaultComposerPanel": "none",
  "defaultOrganizationId": "string",
  "notifyMentionEmail": true,
  "notifyCommentInApp": true,
  "notifyCommentEmail": true,
  "notifyPublishInApp": true,
  "notifyPublishEmail": true,
  "notifyPostErrorEmail": true,
  "notifyApprovalRequestEmail": true,
  "notifyApprovedInApp": true,
  "notifyApprovedEmail": true,
  "notifyRejectedInApp": true,
  "notifyRejectedEmail": true,
  "notifyReconnectEmail": true,
  "notifyWeeklyDigestEmail": true
}

List the signed-in user's email addresses#

GET/api/v1/account/emails

Session-only: an email address belongs to a person, and a workspace API key has no person to own one.

Authentication

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

Responses

200UserEmailList

Every address on the account, oldest first

Response attributes
emailsUserEmail[]Required
Child attributes
idstringRequired
emailstringRequired
verifiedbooleanRequired
primarybooleanRequired

The address the account signs in with and receives mail at. Exactly one per user.

createdAtstringRequired

ISO 8601.

401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/account/emails
curl -X GET "https://orbitwrite.com/api/v1/account/emails" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "emails": [
    {
      "id": "string",
      "email": "string",
      "verified": true,
      "primary": true,
      "createdAt": "string"
    }
  ]
}

Add an email address to the signed-in user's account#

POST/api/v1/account/emails

The address starts unverified and a six-digit code is mailed to it. Verify it with POST /account/emails/{emailId}/verify within 10 minutes, or request a new code.

Authentication

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

Body application/json

emailstringRequired

Between 1 and 254 characters.

Responses

200UserEmail

The address was added and a code mailed to it

Response attributes
idstringRequired
emailstringRequired
verifiedbooleanRequired
primarybooleanRequired

The address the account signs in with and receives mail at. Exactly one per user.

createdAtstringRequired

ISO 8601.

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
409Error

Conflicts with an existing resource

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/account/emails
curl -X POST "https://orbitwrite.com/api/v1/account/emails" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "string"
}'
Response
{
  "id": "string",
  "email": "string",
  "verified": true,
  "primary": true,
  "createdAt": "string"
}

Mail a fresh verification code#

POST/api/v1/account/emails/{emailId}/resend

Replaces any code still outstanding for the address. Unlike the code sent when the address is added, this send is awaited: a provider failure is reported as a 502 rather than a false success.

Authentication

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

Path parameters

emailIdstringRequired

At least 1 character.

Responses

200UserEmailResult

The mutation was applied

Response attributes
okbooleanRequired
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

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/account/emails/{emailId}/resend
curl -X POST "https://orbitwrite.com/api/v1/account/emails/{emailId}/resend" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "ok": true
}

Verify an email address with its mailed code#

POST/api/v1/account/emails/{emailId}/verify

A code expires after 10 minutes and allows 5 wrong guesses; the fifth locks it (429) until a new one is requested.

Authentication

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

Path parameters

emailIdstringRequired

At least 1 character.

Body application/json

otpstringRequired

The six-digit code mailed to the address.

Between 1 and 12 characters.

Responses

200UserEmail

The address is verified

Response attributes
idstringRequired
emailstringRequired
verifiedbooleanRequired
primarybooleanRequired

The address the account signs in with and receives mail at. Exactly one per user.

createdAtstringRequired

ISO 8601.

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/account/emails/{emailId}/verify
curl -X POST "https://orbitwrite.com/api/v1/account/emails/{emailId}/verify" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "otp": "string"
}'
Response
{
  "id": "string",
  "email": "string",
  "verified": true,
  "primary": true,
  "createdAt": "string"
}

Make a verified address the account's primary one#

POST/api/v1/account/emails/{emailId}/primary

The primary address is what sign-in and account mail use, so it must be verified first. The previous primary stays on the account, demoted.

Authentication

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

Path parameters

emailIdstringRequired

At least 1 character.

Responses

200UserEmail

The address is now primary

Response attributes
idstringRequired
emailstringRequired
verifiedbooleanRequired
primarybooleanRequired

The address the account signs in with and receives mail at. Exactly one per user.

createdAtstringRequired

ISO 8601.

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/account/emails/{emailId}/primary
curl -X POST "https://orbitwrite.com/api/v1/account/emails/{emailId}/primary" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "id": "string",
  "email": "string",
  "verified": true,
  "primary": true,
  "createdAt": "string"
}

Remove an email address from the account#

DELETE/api/v1/account/emails/{emailId}

The primary address cannot be removed — promote another verified address first.

Authentication

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

Path parameters

emailIdstringRequired

At least 1 character.

Responses

200UserEmailResult

The mutation was applied

Response attributes
okbooleanRequired
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
DELETE /api/v1/account/emails/{emailId}
curl -X DELETE "https://orbitwrite.com/api/v1/account/emails/{emailId}" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "ok": true
}