Client
GET /api/v1/headless/clientsGET /api/v1/headless/usersDELETE /api/v1/headless/client/{identifier}DELETE /api/v1/headless/user/{identifier}
Both clients and users support metadata which can be used to store arbitrary key value pairs. Note that when updating a client or user, metadata will replace the existing metadata and not be merged with it.
Get clients
GET /api/v1/headless/clients
Use this endpoint to get a paginated list of client identifiers.
Query parameters
| Field | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
length | integer | Number of results to return | No | "100" | N/A |
page | integer | Page number | No | "0" | N/A |
Examples
curl -X GET "https://api.coassemble.com/api/v1/headless/clients?length=50&page=0" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Get users
GET /api/v1/headless/users
Use this endpoint to get a paginated list of users. You can optionally filter by clientIdentifier.
Query parameters
| Field | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
length | integer | Number of results to return | No | "100" | N/A |
page | integer | Page number | No | "0" | N/A |
clientIdentifier | string | Filter users by clientIdentifier | No | N/A | N/A |
Examples
curl -X GET "https://api.coassemble.com/api/v1/headless/users?length=50&page=0&clientIdentifier=client456" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Update client
PUT /api/v1/headless/client/{identifier}
Use this endpoint to update a client’s metadata.
Path parameters
| Field | Description | Options |
|---|---|---|
identifier | Client identifier | N/A |
Body properties
| Field | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
metadata | object | Arbitrary key value pairs to set on the client | No | N/A | N/A |
Examples
curl -X PUT "https://api.coassemble.com/api/v1/headless/client/client123" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"department": "Sales",
"region": "North America"
}
}'
Delete client
DELETE /api/v1/headless/client/{identifier}
Use this endpoint to delete all objects associated with a clientIdentifier.
Path parameters
| Field | Description | Options |
|---|---|---|
identifier | Client identifier | N/A |
Examples
curl -X DELETE "https://api.coassemble.com/api/v1/headless/client/client123" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Update user
PUT /api/v1/headless/user/{identifier}
Use this endpoint to update a user’s metadata.
Path parameters
| Field | Description | Options |
|---|---|---|
identifier | Identifier | N/A |
Body properties
| Field | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
clientIdentifier | string | Client identifier to filter the user by | No | N/A | N/A |
metadata | object | Arbitrary key value pairs to set on the user | No | N/A | N/A |
Examples
curl -X PUT "https://api.coassemble.com/api/v1/headless/user/user123" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"clientIdentifier": "client456",
"metadata": {
"role": "Manager",
"team": "Engineering"
}
}'
Delete user
DELETE /api/v1/headless/user/{identifier}
Use this endpoint to delete a user by their identifier. You can choose what to do with any courses associated with this identifier.
Path parameters
| Field | Description | Options |
|---|---|---|
identifier | Identifier | N/A |
Query parameters
| Field | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
action | string | How to handle courses allocated to this user | Yes | N/A | reallocate delete ignore |
reallocateTo | string | If action is reallocate, the identifier to reallocate to | No | N/A | N/A |
clientIdentifier | string | Optionally provide a clientIdentifier to filter the user by | No | N/A | N/A |
Examples
curl -X DELETE "https://api.coassemble.com/api/v1/headless/user/user123" \
-H "Authorization: Bearer YOUR_API_TOKEN"