Accounts
CRUD endpoints for managing accounts — contacts, companies, venues, and users.
Accounts API
CRUD endpoints for managing accounts (contacts, companies, venues, and users).
Endpoints
| Method | URL | Description |
|---|---|---|
| GET | /api/v1/accounts |
List accounts |
| GET | /api/v1/accounts/{id} |
Show a account |
| POST | /api/v1/accounts |
Create a account |
| PUT | /api/v1/accounts/{id} |
Update a account |
| DELETE | /api/v1/accounts/{id} |
Delete (soft-delete) a account |
| POST | /api/v1/accounts/{id}/merge |
Merge a secondary account into this account |
| POST | /api/v1/accounts/{id}/anonymise |
Erase a account's personally identifiable information |
| POST | /api/v1/accounts/{id}/restore |
Restore a soft-deleted (archived) account |
Nested Resources
| Method | URL | Description |
|---|---|---|
| GET/POST/PUT/DELETE | /api/v1/accounts/{id}/addresses |
Account addresses |
| GET/POST/PUT/DELETE | /api/v1/accounts/{id}/emails |
Account emails |
| GET/POST/PUT/DELETE | /api/v1/accounts/{id}/phones |
Account phones |
| GET/POST/PUT/DELETE | /api/v1/accounts/{id}/links |
Account links |
| GET/POST/DELETE | /api/v1/accounts/{id}/relationships |
Account relationships |
| GET | /api/v1/accounts/{id}/attachments |
Account attachments |
Authentication
Requires a Sanctum bearer token with accounts:read (GET) or accounts:write (POST/PUT/DELETE) ability.
List Accounts
GET /api/v1/accounts
Filters
| Parameter | Description |
|---|---|
q[name_cont]=acme |
Name contains |
q[account_type_eq]=company |
Filter by type |
q[is_active_eq]=true |
Filter by active status |
q[cf.field_name_eq]=value |
Filter by custom field |
Includes
Eager-load relationships with ?include=addresses,emails,phones,links,contacts,companies
Live filters
Apply a saved view with ?filter_id=42. See Live filters API for details.
Sort
sort=name, sort=account_type, sort=created_at, sort=updated_at
Merge Accounts
POST /api/v1/accounts/{id}/merge
Merges a secondary account into the primary account (identified by {id}). The secondary account's relationships, contact details, custom field values, and memberships are transferred to the primary; the secondary is then archived. Both accounts must share the same account_type.
Requires accounts:write ability and accounts.delete permission.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
secondary_id |
integer | Yes | ID of the account to merge into the primary |
Response
Returns the updated primary account under the account key.
Error Cases
| Status | Condition |
|---|---|
| 422 | secondary_id is missing or does not reference an existing, non-archived account |
| 422 | secondary_id is the same as the primary account (self-merge) |
| 422 | The two accounts have different account_type values |
Anonymise Account
POST /api/v1/accounts/{id}/anonymise
Erases a account's personally identifiable information to fulfil data removal requests. Replaces the account's name and description with anonymised placeholders, removes the icon, and deletes all linked emails, phones, addresses, and links. This operation is irreversible.
Requires accounts:write ability and accounts.delete permission. A user cannot anonymise their own account record.
Response
Returns the anonymised account under the account key.
Error Cases
| Status | Condition |
|---|---|
| 422 | The authenticated user is attempting to anonymise their own account record |
Restore Account
POST /api/v1/accounts/{id}/restore
Restores a soft-deleted (archived) account, reversing a DELETE. The account is undeleted and its is_active flag is set back to true. The route resolves archived accounts, so {id} may reference a soft-deleted record. Restoring a account that is not archived is a no-op and still returns the account.
Requires accounts:write ability and accounts.delete permission.
Response
Returns the restored account under the account key.
Error Cases
| Status | Condition |
|---|---|
| 404 | No account (archived or active) exists for the given {id} |
Account Types
| Type | Description |
|---|---|
company |
Companies, businesses |
contact |
Individual people |
venue |
Locations, event spaces |
user |
System users |