Entity Invitations
Entity Invitations
Manage entity user invitations - list, accept, cancel, resend.
The Entity Invitation object
Attributes
Invitation ID
{
"id": "einv_abc123def456789012345678",
"entity_id": "ent_abc123def456",
"email": "newuser@example.com",
"name": "John Doe",
"role": "editor",
"status": "pending",
"invited_by": "user_xyz789",
"expires_at": "2024-01-08T00:00:00.000Z",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Accept invitation
/invitations/acceptAccept an entity invitation by providing user details. Creates a new user account and grants entity access. Returns an access token for immediate use.
Query parameters
Invitation token from the invitation email
Body parameters
Name of the user accepting the invitation
Password for the new user account
curl -X POST "https://eu.spaceinvoices.com/invitations/accept" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"password": "string"
}'Returns
{
"user_id": "user_abc123",
"entity_id": "ent_xyz789",
"access_token": "token_live_abc123"
}List entity invitations
/entities/invitationsRetrieve all invitations for the current entity, including pending, accepted, and expired.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
curl "https://eu.spaceinvoices.com/entities/invitations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"data": [
{
"id": "einv_abc123def456789012345678",
"entity_id": "ent_abc123def456",
"email": "newuser@example.com",
"name": "John Doe",
"role": "editor",
"status": "pending",
"invited_by": "user_xyz789",
"expires_at": "2024-01-08T00:00:00.000Z",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]
}Get entity invitation
/entities/invitations/{id}Retrieve details of a specific invitation.
Header parameters
Optional entity ID specifying which entity context to use for this operation.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
curl "https://eu.spaceinvoices.com/entities/invitations/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
Invitation ID
Invitee email
User role on the entity
Possible values: "viewer", "editor", "admin"
{
"id": "einv_abc123def456789012345678",
"entity_id": "ent_abc123def456",
"email": "newuser@example.com",
"name": "John Doe",
"role": "editor",
"status": "pending",
"invited_by": "user_xyz789",
"expires_at": "2024-01-08T00:00:00.000Z",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Cancel invitation
/entities/invitations/{id}Cancel a pending invitation. Cannot cancel already accepted invitations.
Header parameters
Optional entity ID specifying which entity context to use for this operation.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
curl -X DELETE "https://eu.spaceinvoices.com/entities/invitations/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"message": "Invitation cancelled"
}Resend invitation
/entities/invitations/{id}/resendResend an invitation email with a new token and extended expiry.
Header parameters
Optional entity ID specifying which entity context to use for this operation.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
curl -X POST "https://eu.spaceinvoices.com/entities/invitations/{id}/resend" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"message": "Invitation resent"
}