Moonborn — API · memberships
Accept a pending invitation token (signed by inviter)
POST/v1/memberships/invitations/acceptscope · Bearer (API key or session JWT)
Request body
| Field | Type | Description |
|---|---|---|
| tokenreq | string |
Responses
200Membership activated
Body
| Field | Type | Description |
|---|---|---|
| idreq | string | |
| orgIdreq | string | |
| userIdreq | string | |
| rolereq | string · "Owner" | "Admin" | "Editor" | "Viewer" | |
| statusreq | string · "active" | "suspended" | |
| invitedAtreq | string | |
| acceptedAtreq | string |
410Invitation expired or already accepted
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
422Invalid token
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/memberships/invitations/accept \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token": "<string>"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.memberships.acceptInvitation({
token: "<string>",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.memberships.accept_invitation(
token="<string>",
)