Skip to content

Entity Invitations

The Entity Invitation object

object

Attributes

idstring

Invitation ID

Other attributes
entity_idstring
emailstring
rolestring
invited_by_user_idstring
expires_atstring<date-time>
accepted_atstring<date-time>
statusstring
created_atstring<date-time>
Examplejson
{
  "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

POST/invitations/accept

Accept 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

tokenstringrequired

Invitation token from the invitation email

Body parameters

namestringrequired

Name of the user accepting the invitation

passwordstringrequired

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

messagestring
user_idstring
entity_idstring
access_tokenstring
json
{
  "user_id": "user_abc123",
  "entity_id": "ent_xyz789",
  "access_token": "token_live_abc123"
}

List entity invitations

GET/entities/invitations

Retrieve all invitations for the current entity, including pending, accepted, and expired.

Header parameters

entity_idstringoptional

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

dataarray of objects
json
{
  "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

GET/entities/invitations/{id}

Retrieve details of a specific invitation.

Header parameters

entity_idstringoptional

Optional entity ID specifying which entity context to use for this operation.

Path parameters

idstring<resource-id>required

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

idstring

Invitation ID

emailstring

Invitee email

rolestring

User role on the entity

Possible values: "viewer", "editor", "admin"

Other parameters
entity_idstring
invited_by_user_idstring
expires_atstring<date-time>
accepted_atstring<date-time>
statusstring
created_atstring<date-time>
json
{
  "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

DELETE/entities/invitations/{id}

Cancel a pending invitation. Cannot cancel already accepted invitations.

Header parameters

entity_idstringoptional

Optional entity ID specifying which entity context to use for this operation.

Path parameters

idstring<resource-id>required

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

messagestring
json
{
  "message": "Invitation cancelled"
}

Resend invitation

POST/entities/invitations/{id}/resend

Resend an invitation email with a new token and extended expiry.

Header parameters

entity_idstringoptional

Optional entity ID specifying which entity context to use for this operation.

Path parameters

idstring<resource-id>required

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

messagestring
expires_atstring<date-time>
json
{
  "message": "Invitation resent"
}