API reference
5 endpoints, served at https://orbitwrite.com/api/v1. Each one lists the credentials it accepts, its parameters and every response it can give.
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.
A signed-in session only. The Orbitwrite app calls this; an API key is refused.
200MyInvitationListThe user's pending invitations
invitationsMyInvitation[]RequiredidstringRequiredorganizationIdstringRequiredorganizationNamestringRequiredorganizationSlugstringRequiredorganizationLogostring | nullRequiredrolestring | nullRequiredcurl -X GET "https://orbitwrite.com/api/v1/invitations" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY"{
"invitations": [
{
"id": "string",
"organizationId": "string",
"organizationName": "string",
"organizationSlug": "string",
"organizationLogo": "string",
"role": "string"
}
]
}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.
A signed-in session only. The Orbitwrite app calls this; an API key is refused.
organizationIdstringRequiredAt least 1 character.
emailstringRequiredFormat email.
rolestringDefaults to "member".
"admin""manager""member"200CreateInvitationResultThe invitation was created and the email sent
okbooleanRequiredinvitationIdstringRequiredcurl -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"
}'{
"ok": true,
"invitationId": "string"
}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.
A signed-in session only. The Orbitwrite app calls this; an API key is refused.
organizationIdstringRequiredAt least 1 character.
200WorkspaceInvitationListThe workspace's pending invitations
invitationsWorkspaceInvitation[]Requiredcurl -X GET "https://orbitwrite.com/api/v1/invitations/workspace?organizationId=organizationId" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY"{
"invitations": [
{
"id": "string",
"email": "string",
"role": "string",
"expiresAt": "string"
}
]
}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.
A signed-in session only. The Orbitwrite app calls this; an API key is refused.
idstringRequiredAt least 1 character.
200AcceptInvitationResultThe invitation was accepted
okbooleanRequiredorganizationobjectRequiredcurl -X POST "https://orbitwrite.com/api/v1/invitations/{id}/accept" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY"{
"ok": true,
"organization": {
"id": "string",
"name": "string",
"slug": "string"
}
}Cancels a pending invitation (Better Auth marks it cancelled — the accept link stops working). Owner/admin only.
A signed-in session only. The Orbitwrite app calls this; an API key is refused.
idstringRequiredAt least 1 character.
200RevokeInvitationResultThe invitation was revoked
okbooleanRequiredcurl -X DELETE "https://orbitwrite.com/api/v1/invitations/{id}" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY"{
"ok": true
}