← Back to API Reference

/invitations

Tag: invitations

getThe invitations for an account

Parameters

NameInTypeFormatRequiredDescription
idquerystring
emailquerystringThe email of the user being invited
account_idquerystringThe account the invitation is for
invited_byquerystringThe user who invited the user
rolequerystringThe role for the invitation
invite_tokenquerystringThe token for the invitation
created_atquerystring
updated_atquerystring
expires_atquerystringThe expiry date for the invitation
selectquerystringFiltering Columns
orderquerystringOrdering
RangeheaderstringLimiting and Pagination
Range-UnitheaderstringLimiting and Pagination
offsetquerystringLimiting and Pagination
limitquerystringLimiting and Pagination
PreferheaderstringPreference

Example

bash
curl "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/invitations?select=*&limit=10" \
  -H "apikey: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Responses

200OK
206Partial Content

postThe invitations for an account

Parameters

NameInTypeFormatRequiredDescription
invitationsbodyobjectinvitations
selectquerystringFiltering Columns
PreferheaderstringPreference

Example

bash
curl -X POST "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/invitations" \
  -H "apikey: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Prefer: return=representation" \
  -d '{
  "email": "example",
  "account_id": "00000000-0000-0000-0000-000000000000",
  "invited_by": "00000000-0000-0000-0000-000000000000",
  "role": "example",
  "invite_token": "example"
}'

Responses

201Created

patchThe invitations for an account

Parameters

NameInTypeFormatRequiredDescription
idquerystring
emailquerystringThe email of the user being invited
account_idquerystringThe account the invitation is for
invited_byquerystringThe user who invited the user
rolequerystringThe role for the invitation
invite_tokenquerystringThe token for the invitation
created_atquerystring
updated_atquerystring
expires_atquerystringThe expiry date for the invitation
invitationsbodyobjectinvitations
PreferheaderstringPreference

Example

bash
curl -X PATCH "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/invitations?id=eq.YOUR_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Prefer: return=representation" \
  -d '{"email": "example"}'

Responses

204No Content

deleteThe invitations for an account

Parameters

NameInTypeFormatRequiredDescription
idquerystring
emailquerystringThe email of the user being invited
account_idquerystringThe account the invitation is for
invited_byquerystringThe user who invited the user
rolequerystringThe role for the invitation
invite_tokenquerystringThe token for the invitation
created_atquerystring
updated_atquerystring
expires_atquerystringThe expiry date for the invitation
PreferheaderstringPreference

Example

bash
curl -X DELETE "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/invitations?id=eq.YOUR_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Responses

204No Content

Schema

The invitations for an account

ColumnTypeFormatNullableDefaultNotes
idPK
integerintegerThis is a Primary Key.
email
stringcharacter varyingThe email of the user being invited
account_id
stringuuidFK → accounts.id
invited_by
stringuuidThe user who invited the user
role
stringcharacter varyingFK → roles.name
invite_token
stringcharacter varyingThe token for the invitation
created_at
stringtimestamp with time zoneCURRENT_TIMESTAMP
updated_at
stringtimestamp with time zoneCURRENT_TIMESTAMP
expires_at
stringtimestamp with time zone(CURRENT_TIMESTAMP + '7 days'::interval)The expiry date for the invitation