API reference

Invitations

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

List my pending invitations#

GET/api/v1/invitations

Returns the signed-in user's pending workspace invitations, enriched with the inviting workspace's logo and slug. Better Auth's own listUserInvitations joins the organization but only maps organizationName through, dropping logo/slug — and the invitee isn't a member yet, so the client's org list can't supply the logo either. The join here lets the user menu render the real workspace avatar instead of just an initial.

Authentication

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

Responses

200MyInvitationList

The user's pending invitations

Response attributes
invitationsMyInvitation[]Required
Child attributes
idstringRequired
organizationIdstringRequired
organizationNamestringRequired
organizationSlugstringRequired
rolestring | nullRequired
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/invitations
curl -X GET "https://orbitwrite.com/api/v1/invitations" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "invitations": [
    {
      "id": "string",
      "organizationId": "string",
      "organizationName": "string",
      "organizationSlug": "string",
      "organizationLogo": "string",
      "role": "string"
    }
  ]
}

Invite someone to a workspace#

POST/api/v1/invitations

Creates a Better Auth organization invitation and emails the invitee an accept link. Owner/admin only. If the invitee already has an account they also get an in-app notification.

Authentication

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

Body application/json

organizationIdstringRequired

At least 1 character.

emailstringRequired

Format email.

rolestring

Defaults to "member".

  • "admin"
  • "manager"
  • "member"

Responses

200CreateInvitationResult

The invitation was created and the email sent

Response attributes
okbooleanRequired
invitationIdstringRequired
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[]
POST /api/v1/invitations
curl -X POST "https://orbitwrite.com/api/v1/invitations" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "organizationId": "string",
  "email": "you@example.com"
}'
Response
{
  "ok": true,
  "invitationId": "string"
}

List a workspace's pending invitations#

GET/api/v1/invitations/workspace

Returns the organization's pending (not yet accepted/cancelled) invitations, oldest first. Owner/admin only — the same gate the Members settings page applies before showing them.

Authentication

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

Query parameters

organizationIdstringRequired

At least 1 character.

Responses

200WorkspaceInvitationList

The workspace's pending invitations

Response attributes
invitationsWorkspaceInvitation[]Required
Child attributes
idstringRequired
emailstringRequired
rolestring | nullRequired
expiresAtstringRequired

ISO 8601 timestamp

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[]
GET /api/v1/invitations/workspace
curl -X GET "https://orbitwrite.com/api/v1/invitations/workspace?organizationId=organizationId" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "invitations": [
    {
      "id": "string",
      "email": "string",
      "role": "string",
      "expiresAt": "string"
    }
  ]
}

Accept an invitation#

POST/api/v1/invitations/{id}/accept

Accepts one of the signed-in user's pending invitations (Better Auth creates the membership) and tells the inviter. Returns the joined workspace so the client can navigate into it. The email accept link uses the /accept-invitation/:id web route instead — that flow also has to create a fallback personal workspace and redirect.

Authentication

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

Path parameters

idstringRequired

At least 1 character.

Responses

200AcceptInvitationResult

The invitation was accepted

Response attributes
okbooleanRequired
organizationobjectRequired
Child attributes
idstringRequired
namestringRequired
slugstringRequired
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/invitations/{id}/accept
curl -X POST "https://orbitwrite.com/api/v1/invitations/{id}/accept" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "ok": true,
  "organization": {
    "id": "string",
    "name": "string",
    "slug": "string"
  }
}

Revoke a pending invitation#

DELETE/api/v1/invitations/{id}

Cancels a pending invitation (Better Auth marks it cancelled — the accept link stops working). Owner/admin only.

Authentication

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

Path parameters

idstringRequired

At least 1 character.

Responses

200RevokeInvitationResult

The invitation was revoked

Response attributes
okbooleanRequired
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/invitations/{id}
curl -X DELETE "https://orbitwrite.com/api/v1/invitations/{id}" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "ok": true
}