Allocate a task to a user
curl --request POST \
--url https://clarus-api.com/api/tasks/{id}/allocate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '{
"user_id": 5
}'import requests
url = "https://clarus-api.com/api/tasks/{id}/allocate"
payload = { "user_id": 5 }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({user_id: 5})
};
fetch('https://clarus-api.com/api/tasks/{id}/allocate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Tasks
Allocate a task to a user
Allocate a task to a specific user. If no user_id is provided, the task is allocated to the currently authenticated user. Sets the task status to ALLOCATED and records the assignment timestamp.
POST
/
api
/
tasks
/
{id}
/
allocate
Allocate a task to a user
curl --request POST \
--url https://clarus-api.com/api/tasks/{id}/allocate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '{
"user_id": 5
}'import requests
url = "https://clarus-api.com/api/tasks/{id}/allocate"
payload = { "user_id": 5 }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({user_id: 5})
};
fetch('https://clarus-api.com/api/tasks/{id}/allocate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"user_id": 5
}
Key Fields
| Field | Required | Description |
|---|---|---|
user_id | No | User ID to allocate the task to. Defaults to the current authenticated user if omitted |
Behavior
- Sets task status to ALLOCATED
- Records
assigned_attimestamp - Associates the task with the specified (or current) user
- Returns 204 No Content on success
- Returns 422 if the task is already completed or cannot be allocated
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the task to allocate
Body
application/json
User ID to allocate the task to. Defaults to the current authenticated user if omitted
Response
Operation completed successfully with no content to return

