Tasks
Initial implementation of Tasks was based on the original “v4” architecture. This document describes the new architecture. The key changes include:
Creating Tasks directly from Task Templates (in addition to creating them via Task Group Templates).
Creating multiple Tasks from the same Task Template and Object Record.
- Assigning Tasks to users (assignees).
- Designating Task owners.
- Locking Tasks.
- New Task statuses and response states.
References
Tasks API
POST /api/tasks/
Permissions
Requires authentication and any of:
tasks.createpermission, fortask_type==tt_object_record_updateobject_record.editis required- Object Record Ownership
- Object Class Ownership
- Object Record Permission Set permission
Request example
- Headers
Request Method: POST
Location: /api/tasks/
Authorization: JWT access_token- Body
{
"name": "Sample Task",
"object_record":"1",
"task_template":1,
"due_date":null,
"task_type":"tt_object_record_update"
}Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| task_template | int | |
| object_class | int | |
| object_record | int | |
| instructions | string | |
| configuration | array | Copy of Task template object |
| status | enum | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| due_date | date | |
| expiry_date | date | |
| completed_at | date | |
| completed_by | user | |
| response | Array | Response result |
| stages | Array | Stages result |
| next_actions | Array | Actions schema |
| _meta | Object | _meta result |
Response response array
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| state | enum | |
| data | Array | |
| files | Array | |
| modified_at | Array | |
| modified_by | user | |
| _meta.labels | Object |
data for Response type Object Record Update
::: When task_type is tt_object_record_update the data contains
- If task is
initialand was never saved before: values are taken from recent Object Record related field values. - If task was saved with given field:
datawill contain this field and value from the saved task. - If task was saved before and given field was not saved in there: value is taken from recent Object Record related field value. :::
Response stages array
| Key | Type | Notes |
|---|---|---|
| name | enum | |
| status | enum | |
| owner | user | |
| assignees.users | Array | List of users |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| labels.status | enum | |
| labels.files | Object | |
| permission | Object |
Response actions array
| Owner | Assign | Complete | Next actions |
|---|---|---|---|
| ✔️ | ✔️ | ✔️ | view, save, complete, give_up_ownership, change_ownership |
| ✔️ | ✔️ | view, save, complete, give_up_ownership | |
| ✔️ | ✔️ | view, save, complete, take_ownership, change_ownership | |
| ✔️ | view, save, complete, take_ownership | ||
| view |
Response example
- Status
200 OK - Body
{
"id": 1,
"name": "Test",
"task_template": 2,
"object_class": 1,
"object_record": 1,
"instructions": "",
"configuration": {
"expiry": "date",
"renewals": [],
"reminders": [],
"expiry_day": null,
"complete_by": "asap",
"description": "",
"expiry_date": "2022-05-21",
"modified_by": {
"id": 2,
"username": "John.Kowalsky@autologyx.com",
"last_name": "Kowalsky",
"first_name": "John",
"is_deleted": false,
"company_name": ""
},
"instructions": "",
"plugin_config": {
"prompt": "",
"task_type": "tt_form",
"allow_comment": false,
"configuration": {},
"approval_required": false,
"approval_conditions": []
},
"task_creation": "automatic",
"complete_by_date": null,
"expiry_time_unit": null,
"expiry_time_value": null,
"expiry_time_rel_to": null,
"expiry_periodic_day": null,
"task_group_templates": [],
"complete_by_time_unit": null,
"expiry_periodic_month": null,
"complete_by_time_value": null
},
"status": "completed",
"created_at": "2022-05-17T13:49:06.100636+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:49:37.246827+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"due_date": null,
"expiry_date": null,
"completed_at": "2022-05-17T13:49:37.243158+02:00",
"completed_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"response": null,
"stages": [
{
"name": "stage_1",
"status": "outstanding",
"assignees": {
"users": [
{
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
],
},
"owner": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
}
],
"next_actions": [
"view",
"save",
"complete",
"give_up_ownership",
"change_ownership"
],
"_meta": {
"labels": {
"status": "Completed"
},
"permissions": {
"list": true,
"view": true,
"edit": true,
"delete": true,
"create": true,
"complete": true,
"assign": true
}
}
}Sorting
Not supported
Filtering
Not supported
Errors
| Error | Response code | Message |
|---|---|---|
name is to long | 400 Bad Request | "detail": |
task_template is not set | 400 Bad Request | "detail": {"task_template": ["This field is required."]} |
object_record is not set | 400 Bad Request | "detail": {"object_record": ["This field is required."]} |
task_template is set with empty value | 400 Bad Request | "detail": {"task_template": ["This field may not be null."]} |
object_record is set with empty value | 400 Bad Request | "detail": {"object_record": ["This field may not be null."]} |
task_template value is different than expected | 400 Bad Request | "detail": {"task_template": ["Incorrect type. Expected pk value, received list."]} |
object_record value is different than expected | 400 Bad Request | "detail": {"object_record": ["Incorrect type. Expected pk value, received list."]} |
task_template not exists | 400 Bad Request | "detail": {"task_template": ["Invalid pk "<task_template_id>" - object does not exist."]} |
object_record not exists | 400 Bad Request | "detail": {"object_record": ["Invalid pk "<object_record_id>" - object does not exist."]} |
object_record and task_template set is not unique | 400 Bad Request | "detail": "The fields task_template, object_record must make a unique set." |
| Task template configuration class is different than object record class | 400 Bad Request | "detail": "This task cannot be created for this record." |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
GET /api/tasks/
List Tasks based on query parameters and caller permissions.
Permissions
Requires authentication.
Request
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/tasks/Response
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | URL / null | Next page URL (null if there is no next page) |
| previous | URL / null | Previous page URL (null if there is no previous page) |
| results | Array | Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| id | id | |
| name | string | |
| task_template | int | |
| object_class | int | |
| object_record | int | |
| object_name | string | Value equal to Object Record name. If the user that calls GET /api/tasks/ does not have object_record: view permissions for the records the tasks were created for, the object_name returns null. Object Record identifier is object_record_id if the Object class from which the Record was created does not have an identifier field. |
| status | bool | Values: not_created, not_started, in_progress, completed, etc. |
| due_date | datetime | |
| expiry_date | datetime | |
| configuration | array | Copy of Task template object |
| expiry_at | datetime | |
| created_at | datetime | |
| completed_at | datetime | |
| completed_by | user | |
| modified_by | user | |
| current_owner | user | |
| current_assignees | array | Contains list of assigneed Users and UserGroups |
| _meta | Object | _meta result |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| permission | Object | Object describing permissions. |
| labels.object_class | string | Object Class name |
Response example
- Status
200 OK - Body
{
"limit": 10,
"offset": 0,
"filtered_count": 566,
"total_count": 566,
"next": "{build}/api/tasks/?limit=10&offset=10&ordering=-id",
"previous": null,
"results": [
{
"id": 2251,
"name": "New task JW",
"task_template": 513,
"object_class": 5422,
"object_record": 2274,
"object_name": "Details restricted due to permissions.",
"status": "overdue",
"due_date": "2022-07-31",
"expiry_date": null,
"configuration": {
"plugin_config": {
"task_type": "tt_form",
"_meta": {
"labels": {
"task_type": "Complete standalone form"
}
}
}
},
"completed_at": null,
"completed_by": null,
"current_owner": null,
"current_assignees": {
"users": [
{
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
}
],
"user_groups": [
{
"id": 256,
"name": "ALX Group"
}
]
}
"created_at": "2022-08-17T10:37:10.721179+02:00",
"modified_at": "2022-08-17T10:37:10.728901+02:00",
"_meta": {
"permissions": {
"list": true,
"view": true,
"edit": true,
"delete": true,
"create": true,
"complete": true,
"assign": true
}
}
},
{
"id": 2250,
"name": "Update Record Form",
"task_template": 864,
"object_record": 1120,
"status": "outstanding",
"due_date": null,
"expiry_date": null,
"configuration": {
"plugin_config": {
"task_type": "tt_object_record_update",
"_meta": {
"labels": {
"task_type": "Object Record update"
}
}
}
},
"completed_at": null,
"completed_by": null,
"current_owner": null,
"current_assignees": null,
"created_at": "2022-08-17T08:13:20.842772+02:00",
"modified_at": "2022-08-17T08:13:20.853851+02:00",
"_meta": {
"permissions": {
"list": true,
"view": true,
"edit": true,
"delete": true,
"create": true,
"complete": true,
"assign": true
},
"labels": {
"object_class": "Object Class name"
}
}
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| id | {build}/api/tasks/?ordering=id | Ascending |
| id | {build}/api/tasks/?ordering=-id | Descending (-) |
| name | {build}/api/tasks/?ordering=name | Ascending |
| name | {build}/api/tasks/?ordering=-name | Descending (-) |
| object_class | {build}/api/tasks/?ordering=object_class | Ascending |
| object_class | {build}/api/tasks/?ordering=-object_class | Descending (-) |
| object_record | {build}/api/tasks/?ordering=object_record | Ascending |
| object_record | {build}/api/tasks/?ordering=-object_record | Descending (-) |
| task_template | {build}/api/tasks/?ordering=task_template | Ascending |
| task_template | {build}/api/tasks/?ordering=-task_template | Descending (-) |
| expiry_at | {build}/api/tasks/?ordering=expiry_at | Ascending |
| expiry_at | {build}/api/tasks/?ordering=-expiry_at | Descending (-) |
| due_date | {build}/api/tasks/?ordering=due_date | Ascending |
| due_date | {build}/api/tasks/?ordering=-due_date | Descending (-) |
| created_at | {build}/api/tasks/?ordering=created_at | Ascending |
| created_at | {build}/api/tasks/?ordering=-created_at | Descending (-) |
| modified_at | {build}/api/tasks/?ordering=modified_at | Ascending |
| modified_at | {build}/api/tasks/?ordering=-modified_at | Descending (-) |
| completed_at | {build}/api/tasks/?ordering=completed_at | Ascending |
| completed_at | {build}/api/tasks/?ordering=-completed_at | Descending (-) |
Filtering
For the full description of standard predicates see ALX API standards - Developers guide.
| Parameter | Predicates | Example |
|---|---|---|
| id | standard pk | {build}/api/tasks/?id=1 |
| name | standard string | {build}/api/tasks/?name__icontains=foobar |
| task_template | standard set | {build}/api/tasks/?task_template__in=3,33,333 |
| expiry_date | standard datetime | {build}/api/tasks/?expiry_date__gte=2022-01-01 |
| created_at | standard datetime | {build}/api/tasks/?created_at__gte=2022-01-01 |
| completed_at | standard datetime | {build}/api/tasks/?completed_at__gte=2022-01-01 |
| completed_by | standard set | {build}/api/tasks/?completed_by__in=123,234,345 |
| status | standard set | {build}/api/tasks/?status__in=completed,created |
| task_type | standard set | {build}/api/tasks/?task_type=tt_form |
| object_class | standard pk with in predicate | {build}/api/tasks/?object_class__in=3,33,333 |
| object_record | standard set | {build}/api/tasks/?object_record__in=3,33,333 |
| due_date | standard datetime | {build}/api/tasks/?due_date__range=2022-01-01,2022-01-31 |
| created_at | standard datetime | {build}/api/tasks/?created_at__gte=2022-01-01 |
| created_by | standard set | {build}/api/tasks/?created_by__in=123,234,345 |
| modified_at | standard datetime | {build}/api/tasks/?modified_at__range=2022-01-01,2022-01-31 |
| modified_by | standard set | {build}/api/tasks/?modified_by=123 |
| current_owner | standard set | {build}/api/tasks/?current_owner=12 |
| current_assignees__users | isnull, containsall, containssome | {build}/api/tasks/?current_assignees__users__containssome=12,48 |
| current_assignees__user_groups | isnull, containsall, containssome | {build}/api/tasks/?current_assignees__user_groups__containssome=12,48 |
Complex filtering
Filtering using a JSON-like structure in the query string see Complex Filtering Technical Design . A specified query parameter that contains JSON data representing filtering logic, allowing for both (AND, OR) conditions to be combined in a flexible manner. Performance degradation in case of very complex queries is possible especially if the query contains multiple or conditions. For example, to filter tasks with a name containing "foo" and a status of "completed", you can use the following query:
{
"filter": {
"and": [
{
"name__icontains": "foo"
},
{
"status": "completed"
},
]
},
}Sample usage in url:
/api/tasks/?filters={
"or": [
{"current_assignees__users__containsall": "2,31"},
{"current_assignees__user_groups__containssome": "1,2"}
]
}In the example above, the JSON in query param is shown in raw form for better readability. The JSON must be URL-encoded to be transmitted correctly over the HTTP protocol. The above example would be sent as:
?filters=%7B%22or%22%3A+%5B%7B%22current_assignees__users__containsall%22%3A+%222%2C31%22%7D%2C+%7B%22current_assignees__user_groups__containssome%22%3A+%221%2C2%22%7D%5D%7DIt could be mixed with regular filters.
?id=1&filters=%7B%22or%22%3A+%5B%7B%22current_assignees__users__containsall%22%3A+%222%2C31%22%7D%2C+%7B%22current_assignees__user_groups__containssome%22%3A+%221%2C2%22%7D%5D%7DSpecial cases
Not recommended but supported in the API in that way:
- if the same key is used multiple times (duplicated keys) in the same filterjsononly last one will be used, all previous occurrences will be ignored
/api/tasks/?filters={ "or": [ {"current_assignees__users__containsall": "2,31"}, {"current_assignees__users__containsall": "1,2"} ] }json{"current_assignees__users__containsall": "1,2"} - if single condition entry contains multiple conditionsjsonfirst multiple condition entry will be used with operator
/api/tasks/?filters={ "or": [ {"current_assignees__users__containsall": "2,31", "id": "1"}, {"current_assignees__user_groups__containssome": "1,2"} ] }andand the result will be combined with second entry with operatororjson{"current_assignees__users__containsall": "2,31", "id": "1"} (current_assignees__users__containsall = "2,31" and id = "1") or current_assignees__user_groups__containssome = "1,2" - nested conditions support is possible but strongly not recommended.jsonwill be used as:
/api/tasks/?filters={ "or": [ {"current_assignees__users__containsall": "2,31"}, {"current_assignees__user_groups__containssome": "1,2", "and": [{"id": "1"}, {"name": "foo"}]} ] }json{"current_assignees__users__containsall": "2,31"} or (current_assignees__user_groups__containssome = "1,2" and id = "1" and name = "foo")
Errors
| Error | Response code | Message |
|---|---|---|
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
| Filter task type is not a valid choice | 400 Bad Request | "detail": {"task_type": ["Select a valid choice. fake_type is not one of the available choices."]} |
| Invalid date/time in date field filter | 400 Bad Request | "detail": {"created_at": ["Enter a valid date/time."]} |
| Filter completed_by with wrong user id | 400 Bad Request | "detail": {"task_type": ["Select a valid choice. completed_by is not one of the available choices."]} |
| Filter invalid object | 400 Bad Request | {"filters": ["Value must be a JSON object."]} |
| Filter invalid single operator | 400 Bad Request | {"filters": ["JSON must contain exactly one key: 'or' or 'and'."]} |
| Filter invalid list | 400 Bad Request | {"filters": ["The value of "logic_key" must be a list."]} |
| Filter max items exceeded | 400 Bad Request | {"filters": ["List cannot contain more than 10 elements."]} |
| Filter invalid single key | 400 Bad Request | {"filters": ["Value must have exactly one key."]} |
| Filter invalid nested operators | 400 Bad Request | {"filters": ["Nested logical operators are not allowed."]} |
OPTIONS /api/tasks/
Permissions
Requires authentication only.
Request
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
OPTIONS /api/tasks/Response
- Successful status
200 OK - Response body:
{
"list": {
"columns": [
{
"alias": "id",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "name",
"type": "string",
"predicates": [
"exact",
"iexact",
"contains",
"icontains",
"startswith",
"istartswith",
"endswith",
"iendswith"
],
"sort_ok": true
},
{
"alias": "task_template",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "object_class",
"type": "enum",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"autocomplete": "/api/object-classes/autocomplete/?text__icontains="
},
{
"alias": "object_record",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "object_name",
"type": "string",
"predicates": [],
"sort_ok": false
},
{
"alias": "status",
"type": "enum",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"values": [
{
"value": "outstanding",
"text": "Outstanding"
},
{
"value": "overdue",
"text": "Overdue"
},
{
"value": "completed",
"text": "Completed"
}
]
},
{
"alias": "due_date",
"type": "date",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range",
"isnull"
],
"sort_ok": true
},
{
"alias": "expiry_date",
"type": "date",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range",
"isnull"
],
"sort_ok": true
},
{
"alias": "configuration",
"schema": {
"alias": "plugin_config",
"schema": [
{
"alias": "task_type",
"type": "enum",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"values": [
{
"value": "tt_form",
"text": "Complete standalone form"
},
{
"value": "tt_object_record_update",
"text": "Object Record update"
}
]
}
]
}
},
{
"alias": "current_owner",
"type": "user",
"predicates": [
"exact",
"in",
"isnull"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
{
"alias": "current_assignees",
"type": "user_and_group",
"predicates": [
"containsall",
"containssome",
"isnull"
],
"sort_ok": false,
"autocomplete_users": "/api/users/autocomplete/?text__icontains=",
"autocomplete_user_groups": "/api/user-groups/autocomplete/?text__icontains="
},
{
"alias": "completed_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range",
"isnull"
],
"sort_ok": true
},
{
"alias": "completed_by",
"type": "user",
"predicates": [
"exact",
"in",
"isnull"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
{
"alias": "created_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "modified_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
}
]
},
"details": {
"schema": [
{
"alias": "name",
"type": "string",
"required": true,
"validators": [
{
"type": "min_length",
"length": 1
},
{
"type": "max_length",
"length": 100
}
]
},
{
"alias": "task_template",
"type": "int",
"required": true,
"autocomplete": "/api/task-templates/autocomplete/?creation=manual&text__icontains="
},
{
"alias": "expiry_date",
"type": "date",
"required": false
},
{
"alias": "configuration",
"schema": {
"alias": "plugin_config",
"schema": [
{
"alias": "task_type",
"editable": false,
"type": "enum",
"required": true,
"values": [
{
"value": "tt_form",
"text": "Complete standalone form"
},
{
"value": "tt_object_record_update",
"text": "Object Record update"
}
]
}
],
"schema_by_type": [
{
"task_type": "tt_form",
"schema": [
{
"autocomplete": "/api/task-templates/autocomplete/?task_type=tt_form&creation=manual&text__icontains="
}
]
},
{
"task_type": "tt_object_record_update",
"schema": [
{
"autocomplete": "/api/task-templates/autocomplete/?task_type=tt_object_record_update&object_class={object_id}&creation=manual&text__icontains="
}
]
}
]
}
},
{
"alias": "due_date",
"type": "date",
"required": false
}
]
}
}GET /api/tasks/task_id/
Permissions
Requires authentication and any of
tasks.viewpermission- Object Record Ownership
- Object Class Ownership
- Object Record Permission Set permission
- Object Class Permission Set permission
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id |
- Headers
<!-- Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/tasks/`task_id`/Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| task_template | int | |
| object_class | int | |
| object_record | int | |
| instructions | string | |
| configuration | array | Copy of Task template object |
| status | enum | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| due_date | date | |
| expiry_date | date | |
| completed_at | date | |
| completed_by | user | |
| response | Array | Response result |
| stages | Array | Stages result |
| next_actions | Array | Actions schema |
| _meta | Object | _meta result |
Response response array
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| state | enum | |
| data | Array | |
| files | Array | |
| modified_at | Array | |
| modified_by | user | |
| _meta.labels | Object | |
| _meta.users | Object | Only for User field type |
| _meta.user_groups | Object | Only for User field type |
data for Response type Object Record Update
::: When task_type is tt_object_record_update the data contains
- If task is
initialand was never saved before: values are taken from recent Object Record related field values. - If task was saved with given field:
datawill contain this field and value from the saved task. - If task was saved before and given field was not saved in there: value is taken from recent Object Record related field value. :::
Response stages array
| Key | Type | Notes |
|---|---|---|
| name | enum | |
| status | enum | |
| owner | user | |
| assignees.users | Array | List of users |
| assignees.user_groups | Array | List of user_groups |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| labels.status | enum | |
| labels.files | Object | |
| permission | Object |
Response actions array
| Owner | Assign | Complete | Next actions |
|---|---|---|---|
| ✔️ | ✔️ | ✔️ | view, save, complete, give_up_ownership, change_ownership |
| ✔️ | ✔️ | view, save, complete, give_up_ownership | |
| ✔️ | ✔️ | view, save, complete, take_ownership, change_ownership | |
| ✔️ | view, save, complete, take_ownership | ||
| view |
Response example
- Status
200 OK - Body
{
"id": 1,
"name": "Test",
"task_template": 2,
"object_class": 1,
"object_record": 1,
"instructions": "",
"configuration": {
"expiry": "date",
"renewals": [],
"reminders": [],
"expiry_day": null,
"complete_by": "asap",
"description": "",
"expiry_date": "2022-05-21",
"modified_by": {
"id": 2,
"username": "John.Kowalsky@autologyx.com",
"last_name": "Kowalsky",
"first_name": "John",
"is_deleted": false,
"company_name": ""
},
"instructions": "",
"plugin_config": {
"prompt": "",
"task_type": "tt_form",
"allow_comment": false,
"configuration": {},
"approval_required": false,
"approval_conditions": []
},
"task_creation": "automatic",
"complete_by_date": null,
"expiry_time_unit": null,
"expiry_time_value": null,
"expiry_time_rel_to": null,
"expiry_periodic_day": null,
"task_group_templates": [],
"complete_by_time_unit": null,
"expiry_periodic_month": null,
"complete_by_time_value": null
},
"status": "completed",
"created_at": "2022-05-17T13:49:06.100636+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:49:37.246827+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"due_date": null,
"expiry_date": "2022-05-21",
"completed_at": "2022-05-17T13:49:37.243158+02:00",
"completed_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"response": {
"id": 30,
"state": "saved",
"data": {},
"files": {},
"modified_at": "2022-07-14T23:41:11.912516+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "full"
},
"_meta": {
"labels": {
"state": "Saved",
"files": null
}
}
},
"stages": [
{
"name": "stage_1",
"status": "outstanding",
"assignees": {
"users": [
{
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
],
"user_groups": [
{
"id": 222,
"name": "Group 222"
}
]
},
"owner": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
}
],
"next_actions": [
"view",
"save",
"complete",
"give_up_ownership",
"change_ownership"
],
"_meta": {
"labels": {
"status": "Completed"
},
"permissions": {
"list": true,
"view": true,
"edit": true,
"delete": true,
"create": true,
"complete": true,
"assign": true
}
}
}Sorting
Not supported
Filtering
Not supported
Errors
| Error | Response code | Message |
|---|---|---|
A non-existent task_id was given | 404 Not Found | "detail": "Not found." |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
PATCH /api/tasks/task_id/
Permissions
Requires authentication and any of:
tasks.editpermission- Object Record Ownership
- Object Class Ownership
- Object Record Permission Set permission
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Body
| Key | Type | Required | Notes |
|---|---|---|---|
| due_date | date | false |
- Schema
PATCH /api/tasks/`task_id`/Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| task_template | int | |
| object_class | int | |
| object_record | int | |
| instructions | string | |
| configuration | array | Copy of Task template object |
| status | enum | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| due_date | date | |
| expiry_date | date | |
| completed_at | date | |
| completed_by | user | |
| response | Array | Response result |
| stages | Array | Stages result |
| next_actions | Array | Actions schema |
| _meta | Object | _meta result |
Response response array
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| state | enum | |
| data | Array | |
| files | Array | |
| modified_at | Array | |
| modified_by | user | |
| _meta.labels | Object |
data for Response type Object Record Update
::: When task_type is tt_object_record_update the data contains
- If task is
initialand was never saved before: values are taken from recent Object Record related field values. - If task was saved with given field:
datawill contain this field and value from the saved task. - If task was saved before and given field was not saved in there: value is taken from recent Object Record related field value. :::
Response stages array
| Key | Type | Notes |
|---|---|---|
| name | enum | |
| status | enum | |
| owner | user | |
| assignees.users | Array | List of users |
| assignees.user_groups | Array | List of user_groups |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| labels.status | enum | |
| labels.files | Object | |
| permission | Object |
Response actions array
| Owner | Assign | Complete | Next actions |
|---|---|---|---|
| ✔️ | ✔️ | ✔️ | view, save, complete, give_up_ownership, change_ownership |
| ✔️ | ✔️ | view, save, complete, give_up_ownership | |
| ✔️ | ✔️ | view, save, complete, take_ownership, change_ownership | |
| ✔️ | view, save, complete, take_ownership | ||
| view |
Response example
- Status
200 OK - Body
{
"id": 1,
"name": "Test",
"task_template": 2,
"object_class": 1,
"object_record": 1,
"instructions": "",
"configuration": {
"expiry": "date",
"renewals": [],
"reminders": [],
"expiry_day": null,
"complete_by": "asap",
"description": "",
"expiry_date": "2022-05-21",
"modified_by": {
"id": 2,
"username": "John.Kowalsky@autologyx.com",
"last_name": "Kowalsky",
"first_name": "John",
"is_deleted": false,
"company_name": ""
},
"instructions": "",
"plugin_config": {
"prompt": "",
"task_type": "tt_form",
"allow_comment": false,
"configuration": {},
"approval_required": false,
"approval_conditions": []
},
"task_creation": "automatic",
"complete_by_date": null,
"expiry_time_unit": null,
"expiry_time_value": null,
"expiry_time_rel_to": null,
"expiry_periodic_day": null,
"task_group_templates": [],
"complete_by_time_unit": null,
"expiry_periodic_month": null,
"complete_by_time_value": null
},
"status": "completed",
"created_at": "2022-05-17T13:49:06.100636+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:49:37.246827+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"due_date": null,
"expiry_date": "2022-05-21",
"completed_at": "2022-05-17T13:49:37.243158+02:00",
"completed_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"response": {
"id": 30,
"state": "saved",
"data": {},
"files": {},
"modified_at": "2022-07-14T23:41:11.912516+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "full"
},
"_meta": {
"labels": {
"state": "Saved",
"files": null
}
}
},
"stages": [
{
"name": "stage_1",
"status": "outstanding",
"assignees": {
"users": [
{
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
],
"user_groups": [
{
"id": 222,
"name": "Group 222"
}
]
},
"owner": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
}
}
],
"next_actions": [
"view",
"save",
"complete",
"give_up_ownership",
"change_ownership"
],
"_meta": {
"labels": {
"status": "Completed"
},
"permissions": {
"list": true,
"view": true,
"edit": true,
"delete": true,
"create": true,
"complete": true,
"assign": true
}
}
}Sorting
Not supported
Filtering
Not supported
Errors
| Error | Response code | Message |
|---|---|---|
name is to long | 400 Bad Request | "detail": |
A non-existent task_id was given | 404 Not Found | "detail": "Not found." |
| Requesting user is authorized but without perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
DELETE /api/tasks/task_id/
Remove a Task.
Permissions
Requires authentication and any of:
tasks.deletepermission- Object Record Ownership
- Object Class Ownership
- Object Record Permission Set permission
Request example
- Headers
Request Method: DELETE
Location: /api/tasks/1/
Authorization: JWT access_tokenResponse example
- Status
204 No Content - Body
Errors
| Error | Response code | Message |
|---|---|---|
A non-existent task_id was given | 404 Not Found | "detail": "Not found." |
| Requesting user is authorized but without perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
POST /api/tasks/id/complete/
Complete task.
Automatic Task ownership assignment
- If the Task does not have an owner, the caller is automatically assigned as the Task owner.
- If the Task does have an owner, the current Task owner remains unchanged.
Permissions
Requires authentication and task complete permission, records in classes where user owns.
The following table contains supported values of task_type field:
POST /api/tasks/id/save/
Save settings for task.
Automatic Task ownership assignment
- If the Task does not have an owner, the caller is automatically assigned as the Task owner.
- If the Task does have an owner, the current Task owner remains unchanged.
Permissions
Requires authentication and task complete permission, records in classes where user owns.
The following table contains supported values of task_type field:
Save task for tt_object_record_update.
Request
- Body parameters
| Key | Type | Notes |
|---|---|---|
| data | json | Structure contains fields |
| files.file_list | Array |
Any parameter not listed above are silently ignored if passed.
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/tasks/`id`/save/
{
"data": {
"field_test_string": <str>,
"field_test_integer": <integer>,
"field_test_datetime": <datetime>,
"field_test_user": <user>,
"other_2": <str>,
},
"files": {
"field_test_4": <document>
},
}Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | Automatically generated by the backend. |
| state | string | |
| data | Object | |
| files | Object | |
| modified_at | datetime | |
| modified_by | user | |
| _meta.labels | Object | "object_class": |
Response example
- Status
201 CREATED - Body
{
"id": 1,
"state": "saved",
"data": {
"field_test_string": "John",
"field_test_integer": 1,
"field_test_user": '{"users": [13], "user_groups": [1]}',
"other_2": "Test",
},
"files": {
"field_test_4": [1]
},
"modified_at": "2022-03-04T09:20:38.357221Z",
"modified_by": {
"id": 1,
"first_name": "Firstname",
"last_name": "Lastname",
"username": "username",
"company_name": "alx",
"is_deleted": false
},
"_meta": {
"labels": {
"state": "Saved",
"files": {
"1": {
"name": "file1.pdf",
"url": "https://test.test/api/files/response/file/3ec2175c-fcc5-4afa-922d-d52460866411/",
"size": "13264",
"type": "application/pdf"
}
}
}
}
}Restriction
- Maximum number of fields: 2000.
Errors
| Error | Response code | Message |
|---|---|---|
files invalid data | 400 Bad Request | 'files': {'file_slug': "Invalid data. Expected a list, but got /type/."} |
files invalid token | 400 Bad Request | 'files': {'file_slug': ["Invalid token /token/."] } |
files invalid id | 400 Bad Request | 'files': {'file_slug': ["Invalid file_id /id/."] } |
files duplicates | 400 Bad Request | {'files': ["'file_slug' cannot contain duplicates."]} |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
Field type Errors
| Cause | Response code | Message |
|---|---|---|
| string is too long | 400 Bad Request | "field_{string}": ["Ensure this field has no more than {max} characters."] |
| string is required | 400 Bad Request | "field_{string}": ["This field is required."] |
| string is not unique | 400 Bad Request | "field_{string}": ["This field must be unique."] |
| integer value is invalid | 400 Bad Request | "field_{integer}": ["A valid integer is required."] |
| integer is required | 400 Bad Request | "field_{integer}": ["This field is required."] |
| integer value is below the limit | 400 Bad Request | "field_{integer}": ["Ensure this value is greater than or equal to {min}."] |
| integer value is above the limit | 400 Bad Request | "field_{integer}": ["Ensure this value is less than or equal to {max}."] |
| integer is not unique | 400 Bad Request | "field_{integer}": ["This field must be unique."] |
| float value is invalid | 400 Bad Request | "field_{float}": ["A valid number is required."] |
| float is required | 400 Bad Request | "field_{float}": ["This field is required."] |
| float value is below the limit | 400 Bad Request | "field_{float}": ["Ensure this value is greater than or equal to {min}."] |
| float value is above the limit | 400 Bad Request | "field_{float}": ["Ensure this value is less than or equal to {max}."] |
| float is not unique | 400 Bad Request | "field_{float}": ["This field must be unique."] |
| bool value is invalid | 400 Bad Request | "field_{bool}": ["Must be a valid boolean."] |
| bool value different than required | 400 Bad Request | "field_{bool}": ["Field contains a value other than required."] |
| email value is invalid | 400 Bad Request | "field_{email}": ["Enter a valid email address."] |
| email is required | 400 Bad Request | "field_{email}": ["This field is required."] |
| email value is above the limit | 400 Bad Request | "field_{email}": ["Ensure this field has no more than {max} characters."] |
| email is not unique | 400 Bad Request | "field_{email}": ["This field must be unique."] |
| phone value is invalid | 400 Bad Request | "field_{phone}": ["Enter a valid email address."] |
| phone is required | 400 Bad Request | "field_{phone}": ["This field is required."] |
| phone value is above the limit | 400 Bad Request | "field_{phone}": ["Ensure this field has no more than {max} characters."] |
| phone is not unique | 400 Bad Request | "field_{phone}": ["This field must be unique."] |
| date value is in wrong format | 400 Bad Request | "field_{date}": ["Date has wrong format. Use one of these formats instead: YYYY-MM-DD."] |
| date is required | 400 Bad Request | "field_{date}": ["This field is required."] |
| date is not unique | 400 Bad Request | "field_{date}": ["This field must be unique."] |
| time value is in wrong format | 400 Bad Request | "field_{time}": ["Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]."] |
| time is required | 400 Bad Request | "field_{time}": ["This field is required."] |
| time is not unique | 400 Bad Request | "field_{time}": ["This field must be unique."] |
| datetime value is in wrong format | 400 Bad Request | "field_{datetime}": ["Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM |
| datetime is required | 400 Bad Request | "field_{datetime}": ["This field is required."] |
| datetime is not unique | 400 Bad Request | "field_{datetime}": ["This field must be unique."] |
| enum value is invalid | 400 Bad Request | "field_{enum}": ["{value} is not a valid choice.] |
| enum is required | 400 Bad Request | "field_{enum}": ["This field is required."] |
| enum is not unique | 400 Bad Request | "field_{enum}": ["This field must be unique."] |
| set value is invalid | 400 Bad Request | "field_{set}": ["Value must be valid Set."] |
| set is not a list | 400 Bad Request | "field_{set}": ["Value must be valid Set."] |
| set value is below the limit | 400 Bad Request | "field_{set}": ["The number of elements must be greater than or equal to {min}."] |
| set value is above the limit | 400 Bad Request | "field_{set}": ["The number of elements must be less than or equal to {max}."] |
| url value is invalid | 400 Bad Request | "field_{url}": ["Enter a valid URL."] |
| url is required | 400 Bad Request | "field_{url}": ["This field is required."] |
| url value is above the limit | 400 Bad Request | "field_{url}": ["Ensure this field has no more than {max} characters."] |
| url is not unique | 400 Bad Request | "field_{url}": ["This field must be unique."] |
| json value is invalid | 400 Bad Request | "field_{json}": ["Value must be valid JSON."] |
| json is required | 400 Bad Request | "field_{json}": ["This field is required."] |
| json value is above the limit | 400 Bad Request | "field_{json}": ["Ensure this field has no more than {max} characters."] |
| json is not unique | 400 Bad Request | "field_{json}": ["This field must be unique."] |
| document value is invalid | 400 Bad Request | "field_{document}": ["Value must be valid list."] |
| document token is invalid | 400 Bad Request | "field_{document}": ["Invalid token {token}."] |
| document number files is above the limit | 400 Bad Request | "field_{document}": ["The number of elements must be less than or equal to {max}."] |
| user is not a object | 400 Bad Request | "field_{user}": ["Expected a dictionary of items but got type "{type}"."] |
| user value not in the class field definition or not existing user ID (users) | 400 Bad Request | "field_{user}": [""{value}" is not a valid choice."] |
| user value is below the limit (users) | 400 Bad Request | "field_{user}": ["The number of users elements must be greater than or equal to {min}."] |
| user value is above the limit (users) | 400 Bad Request | "field_{user}": ["The number of users elements must be less than or equal to {max}."] |
| user value is not an array of integers (users) | 400 Bad Request | "field_{user}": {"users": ["The value must be an array of integers."]} |
| user value not in the class field definition or not existing users group ID (user_groups) | 400 Bad Request | "field_{user}": [""{value}" is not a valid choice."] |
| user value is below the limit (user_groups) | 400 Bad Request | "field_{user}": ["The number of user_groups elements must be greater than or equal to {min}."] |
| user value is above the limit (user_groups) | 400 Bad Request | "field_{user}": ["The number of user_groups elements must be less than or equal to {max}."] |
| user value is not an array of integers (user_groups) | 400 Bad Request | "field_{user}": {"user_groups": ["The value must be an array of integers."]} |
| user field - attempted to pass values in the user_groups field when it was not permitted | 400 Bad Request | "field_{user}": ["user_groups field is not allowed."] |
| user field - attempted to pass values in the users field when it was not permitted | 400 Bad Request | "field_{user}": ["users field is not allowed."] |
Response type Form
Complete task for tt_form.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| id | id |
- Body parameters
| Key | Type | Notes |
|---|---|---|
| data | Object | Structure contains field |
| files.file_list | Array |
Any parameter not listed above are silently ignored if passed.
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/tasks/`id`/complete/
{
"data": {
"first_name": "John",
"last_name": "Doe"
},
"files": {
"file_list": [“e4e633c6-8abb-4756-9ba6-4b9be539e956”]
}
}Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | Automatically generated by the backend. |
| state | string | |
| data | Object | |
| files | Object | |
| modified_at | datetime | |
| modified_by | user | |
| _meta.labels | Object | "object_class": |
Response example
- Status
201 CREATED - Body
{
"id": 1,
"state": "accepted",
"data": {
"first_name": "John",
"last_name": "Doe"
},
"files": {
"file_list": [1]
},
"modified_at": "2022-03-04T09:20:38.357221Z",
"modified_by": {
"id": 1,
"first_name": "Firstname",
"last_name": "Lastname",
"username": "username",
"company_name": "alx",
"is_deleted": false
},
"_meta": {
"labels": {
"state": "Accepted",
"files": {
"1": {
"name": "file1.pdf",
"url": "https://test.test/api/files/response/file/3ec2175c-fcc5-4afa-922d-d52460866411/",
"size": "13264",
"type": "application/pdf"
}
}
}
}
}Errors
| Error | Response code | Message |
|---|---|---|
data value missing | 400 Bad Request | "data": ["This field is required."] |
data value is NULL | 400 Bad Request | "data": ["This list may not be null."] |
files invalid data | 400 Bad Request | 'files': {'file_slug': "Invalid data. Expected a list, but got /type/."} |
files invalid token | 400 Bad Request | 'files': {'file_slug': ["Invalid token /token/."] } |
files invalid id | 400 Bad Request | 'files': {'file_slug': ["Invalid file_id /id/."] } |
files duplicates | 400 Bad Request | {'files': ["'file_slug' cannot contain duplicates."]} |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
Response type Object Record Update
Complete task for tt_object_record_update.
Request
- Body parameters
| Key | Type | Notes |
|---|---|---|
| data | json | Structure contains fields |
| files.file_list | Array |
Any parameter not listed above are silently ignored if passed.
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/tasks/`id`/complete/
{
"data": {
"field_test_string": <str>,
"field_test_integer": <integer>,
"field_test_datetime": <datetime>,
"field_test_user": <user>,
"other_2": <str>,
},
"files": {
"field_test_4": <document>
},
}Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | Automatically generated by the backend. |
| state | string | |
| data | Object | |
| files | Object | |
| modified_at | datetime | |
| modified_by | user | |
| _meta.labels | Object | "object_class": |
Response example
- Status
201 CREATED - Body
{
"id": 1,
"state": "completed",
"data": {
"field_test_string": "John",
"field_test_integer": 1,
"field_test_user": '{"users": [13], "user_groups": [1]}',
"other_2": "Test",
},
"files": {
"field_test_4": [1]
},
"modified_at": "2022-03-04T09:20:38.357221Z",
"modified_by": {
"id": 1,
"first_name": "Firstname",
"last_name": "Lastname",
"username": "username",
"company_name": "alx",
"is_deleted": false
},
"_meta": {
"labels": {
"state": "Completed",
"files": {
"1": {
"name": "file1.pdf",
"url": "https://test.test/api/files/response/file/3ec2175c-fcc5-4afa-922d-d52460866411/",
"size": "13264",
"type": "application/pdf"
}
}
}
}
}Restriction
- Maximum number of fields: 2000.
Errors
| Error | Response code | Message |
|---|---|---|
data value missing | 400 Bad Request | "data": ["This field is required."] |
data value is NULL | 400 Bad Request | "data": ["This list may not be null."] |
data does not contain all record fields required by task template configuration | 400 Bad Request | "data": {"field_{alias}": ["Field is required"]} |
data value is different type than a list | 400 Bad Request | "data": ["Expected a list of items but got type "{type}"."] |
data contains more than 2000 items | 400 Bad Request | 'data': {'non_field_errors': ['Up to 2000 items allowed.']} |
data contains invalid date in some field. | 400 Bad Request | "data": {"field_{alias}": ""} |
files invalid data | 400 Bad Request | 'files': {'file_slug': "Invalid data. Expected a list, but got /type/."} |
files invalid token | 400 Bad Request | 'files': {'file_slug': ["Invalid token /token/."] } |
files invalid id | 400 Bad Request | 'files': {'file_slug': ["Invalid file_id /id/."] } |
files duplicates | 400 Bad Request | {'files': ["'file_slug' cannot contain duplicates."]} |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
Field type Errors
| Cause | Response code | Message |
|---|---|---|
| string is too long | 400 Bad Request | "field_{string}": ["Ensure this field has no more than {max} characters."] |
| string is required | 400 Bad Request | "field_{string}": ["This field is required."] |
| string is not unique | 400 Bad Request | "field_{string}": ["This field must be unique."] |
| integer value is invalid | 400 Bad Request | "field_{integer}": ["A valid integer is required."] |
| integer is required | 400 Bad Request | "field_{integer}": ["This field is required."] |
| integer value is below the limit | 400 Bad Request | "field_{integer}": ["Ensure this value is greater than or equal to {min}."] |
| integer value is above the limit | 400 Bad Request | "field_{integer}": ["Ensure this value is less than or equal to {max}."] |
| integer is not unique | 400 Bad Request | "field_{integer}": ["This field must be unique."] |
| float value is invalid | 400 Bad Request | "field_{float}": ["A valid number is required."] |
| float is required | 400 Bad Request | "field_{float}": ["This field is required."] |
| float value is below the limit | 400 Bad Request | "field_{float}": ["Ensure this value is greater than or equal to {min}."] |
| float value is above the limit | 400 Bad Request | "field_{float}": ["Ensure this value is less than or equal to {max}."] |
| float is not unique | 400 Bad Request | "field_{float}": ["This field must be unique."] |
| bool value is invalid | 400 Bad Request | "field_{bool}": ["Must be a valid boolean."] |
| bool value different than required | 400 Bad Request | "field_{bool}": ["Field contains a value other than required."] |
| email value is invalid | 400 Bad Request | "field_{email}": ["Enter a valid email address."] |
| email is required | 400 Bad Request | "field_{email}": ["This field is required."] |
| email value is above the limit | 400 Bad Request | "field_{email}": ["Ensure this field has no more than {max} characters."] |
| email is not unique | 400 Bad Request | "field_{email}": ["This field must be unique."] |
| phone value is invalid | 400 Bad Request | "field_{phone}": ["Enter a valid email address."] |
| phone is required | 400 Bad Request | "field_{phone}": ["This field is required."] |
| phone value is above the limit | 400 Bad Request | "field_{phone}": ["Ensure this field has no more than {max} characters."] |
| phone is not unique | 400 Bad Request | "field_{phone}": ["This field must be unique."] |
| date value is in wrong format | 400 Bad Request | "field_{date}": ["Date has wrong format. Use one of these formats instead: YYYY-MM-DD."] |
| date is required | 400 Bad Request | "field_{date}": ["This field is required."] |
| date is not unique | 400 Bad Request | "field_{date}": ["This field must be unique."] |
| time value is in wrong format | 400 Bad Request | "field_{time}": ["Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]."] |
| time is required | 400 Bad Request | "field_{time}": ["This field is required."] |
| time is not unique | 400 Bad Request | "field_{time}": ["This field must be unique."] |
| datetime value is in wrong format | 400 Bad Request | "field_{datetime}": ["Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM |
| datetime is required | 400 Bad Request | "field_{datetime}": ["This field is required."] |
| datetime is not unique | 400 Bad Request | "field_{datetime}": ["This field must be unique."] |
| enum value is invalid | 400 Bad Request | "field_{enum}": ["{value} is not a valid choice.] |
| enum is required | 400 Bad Request | "field_{enum}": ["This field is required."] |
| enum is not unique | 400 Bad Request | "field_{enum}": ["This field must be unique."] |
| set value is invalid | 400 Bad Request | "field_{set}": ["Value must be valid Set."] |
| set is not a list | 400 Bad Request | "field_{set}": ["Value must be valid Set."] |
| set value is below the limit | 400 Bad Request | "field_{set}": ["The number of elements must be greater than or equal to {min}."] |
| set value is above the limit | 400 Bad Request | "field_{set}": ["The number of elements must be less than or equal to {max}."] |
| url value is invalid | 400 Bad Request | "field_{url}": ["Enter a valid URL."] |
| url is required | 400 Bad Request | "field_{url}": ["This field is required."] |
| url value is above the limit | 400 Bad Request | "field_{url}": ["Ensure this field has no more than {max} characters."] |
| url is not unique | 400 Bad Request | "field_{url}": ["This field must be unique."] |
| json value is invalid | 400 Bad Request | "field_{json}": ["Value must be valid JSON."] |
| json is required | 400 Bad Request | "field_{json}": ["This field is required."] |
| json value is above the limit | 400 Bad Request | "field_{json}": ["Ensure this field has no more than {max} characters."] |
| json is not unique | 400 Bad Request | "field_{json}": ["This field must be unique."] |
| document value is invalid | 400 Bad Request | "field_{document}": ["Value must be valid list."] |
| document token is invalid | 400 Bad Request | "field_{document}": ["Invalid token {token}."] |
| document number files is above the limit | 400 Bad Request | "field_{document}": ["The number of elements must be less than or equal to {max}."] |
| user is not a object | 400 Bad Request | "field_{user}": ["Expected a dictionary of items but got type "{type}"."] |
| user value not in the class field definition or not existing user ID (users) | 400 Bad Request | "field_{user}": [""{value}" is not a valid choice."] |
| user value is below the limit (users) | 400 Bad Request | "field_{user}": ["The number of users elements must be greater than or equal to {min}."] |
| user value is above the limit (users) | 400 Bad Request | "field_{user}": ["The number of users elements must be less than or equal to {max}."] |
| user value is not an array of integers (users) | 400 Bad Request | "field_{user}": {"users": ["The value must be an array of integers."]} |
| user value not in the class field definition or not existing users group ID (user_groups) | 400 Bad Request | "field_{user}": [""{value}" is not a valid choice."] |
| user value is below the limit (user_groups) | 400 Bad Request | "field_{user}": ["The number of user_groups elements must be greater than or equal to {min}."] |
| user value is above the limit (user_groups) | 400 Bad Request | "field_{user}": ["The number of user_groups elements must be less than or equal to {max}."] |
| user value is not an array of integers (user_groups) | 400 Bad Request | "field_{user}": {"user_groups": ["The value must be an array of integers."]} |
| user field - attempted to pass values in the user_groups field when it was not permitted | 400 Bad Request | "field_{user}": ["user_groups field is not allowed."] |
| user field - attempted to pass values in the users field when it was not permitted | 400 Bad Request | "field_{user}": ["users field is not allowed."] |
GET /api/tasks/task_id/class-fields/
Lists Object Class fields used in the task.
Permissions
Requires authentication and view for a specific task and task_type = tt_object_record_update.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/tasks/`task_id`/class-fields/Response
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | url / null | Next page URL (null if there is no next page) |
| previous | url / null | Previous page URL (null if there is no previous page) |
| results | Array | List of fields |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 3,
"total_count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 13,
"label": "JSON",
"type": "json",
"alias": "json",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"sort_ok": false,
"order": 0,
"extras": {}
},
{
"id": 12,
"label": "URL",
"type": "url",
"alias": "url",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"sort_ok": false,
"order": 1,
"extras": {}
},
{
"id": 11,
"label": "Time",
"type": "time",
"alias": "time",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"sort_ok": false,
"order": 2,
"extras": {}
},
{
"id": 14,
"label": "User",
"type": "user",
"alias": "user",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"sort_ok": false,
"order": 3,
"extras": {
"options" {
"users": [1],
"user_groups": []
}
"allow_members_selection": false
"allow_sync": false
}
},
]
}Sorting
Not supported
Filtering
| Parameter | Type | Example |
|---|---|---|
| id | int + enum | {build}/api/object-records/?id__in=1,2 |
Errors
| Error | Response code | Message |
|---|---|---|
| Given {task_id} is for task of different task_type than tt_object_record_update | 404 Not Found | |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized |
OPTIONS /api/tasks/task_id/stages/
Permissions
Requires authentication only.
Request
- Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/tasks/1/stages/
Authorization: JWT access_tokenResponse
- Successful status
200 OK - Response body:
{
"details": {
"schema": [
{
"alias": "owner",
"type": "user",
"required": false
}
]
}
}POST /api/tasks/task_id/stages/stage_id/assignees/users/
Assign additional users to stage 1 of a Task
Permissions
Requires authentication, and task.assign permissions.
Validations
- Invalid task_id
- Invalid payload schema
- list is empty
- list contains different type than integer
- Exceeded max batch size
- Insufficient permissions
- 1TC user sent in request's body
Request
- Headers
Request Method: POST
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/users/
Authorization: JWT access_token- Body
Sample request body
[user_id_1, user_id_2]Response
| Key | Type | Notes |
|---|---|---|
| users | Array | Array of users objects |
- Successful status
201 Created - Response body schema
[
{
"name": <string>,
"status": <string>,
"assignees":{
"users":[
{
"id": <user_id>,
"first_name": <string>,
"last_name": <string>,
"username": <string>,
"company_name": <string>,
"account_type": <enum>
}
]
},
"owner":{
"id": <user_id>,
"first_name": <string>,
"last_name": <string>,
"username": <string>,
"company_name": <string>,
"account_type": <enum>
}
}
]Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Invalid task_id | 404 Not Found | "detail": ["Not found."] |
| Invalid payload schema | 400 Bad Request | "detail": ["Invalid payload schema"] |
| list is empty | 400 Bad Request | "detail": ["This list of assignees may not be empty."] |
| list contains different type than integer | 400 Bad Request | "detail": ["Incorrect type. Expected pk value, received {type}."] |
| User with given ID does not exist | 400 Bad Request | "detail": ["Invalid pk "{id}" - object does not exist."] |
| Exceeded max batch size | 400 Bad Request | "detail": ["Up to {BATCH_LIMIT} items allowed."] |
| Exceeded max number of standard assignees | 400 Bad Request | "detail": ["Limit of 100 standard assignees has been exceeded."] |
| 1TC user sent in request's body | 400 Bad Request | "detail": ["1 Time Completion users are not allowed."] |
| 1TC user sent when group added as assignees | 400 Bad Request | "detail": ["1 Time Completion user is not allowed because there is at least one group added as assignees."] |
| Request user does not have "users.list" permission for some users passed in the payload | 400 Bad Request | “detail”: ["You do not have permission to assign user "{user_id}" to the task "{task_id}"."] |
DELETE /api/tasks/task_id/stages/stage_id/assignees/users/
Unassign users from stage 1 of a Task
Permissions
Requires authentication, and task.assign permissions.
Request
- Headers
Request Method: DELETE
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/users/
Authorization: JWT access_token- Body
Sample request body
[user_id_1, user_id_2]Response
- Successful status
204 NO CONTENT
Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Invalid task_id | 404 Not Found | "detail": ["Not found."] |
| Invalid payload schema | 400 Bad Request | "detail": ["Invalid payload schema"] |
| "users" list is empty | 400 Bad Request | "detail": ["This list of assignees may not be empty."] |
| "users" list contains different type than integer | 400 Bad Request | "detail": ["Incorrect type. Expected pk value, received {type}."] |
| Exceeded max batch size | 400 Bad Request | "detail": ["Up to {BATCH_LIMIT} items allowed."] |
OPTIONS /api/tasks/task_id/stages/stage_id/assignees/users/
Permissions
Requires authentication only.
Request
- Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/users/
Authorization: JWT access_tokenResponse
- Successful status
200 OK - Response body:
{
"batch": {
"type": "set",
"required": true,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
"restrictions": {
"limit_assignees_standard": 100,
"limit_assignees_one_time_completion": 1,
"limit_items_in_batch": 100
}
}POST /api/tasks/task_id/stages/stage_id/assignees/user-groups/
Assign users group to stage 1 of a Task
Permissions
Requires authentication, and task.assign permissions.
Validations
- Invalid task_id
- Invalid payload schema
- Users group with given ID does not exist
- "user_groups" list is empty
- "user_groups" list contains different type than integer
- "user_groups" is passed when 1TC user is already an assignee
- Exceeded max batch size
- Insufficient permissions to specific Users Group
Request
- Headers
Request Method: POST
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/user-groups/
Authorization: JWT access_token- Body
Sample request body
[group_id_1, group_id_2]Response
| Key | Type | Notes |
|---|---|---|
| user-groups | Array | Array of users-group objects |
- Successful status
201 Created - Response body schema
[
{
"name": <string>,
"status": <string>,
"assignees":{
"user_groups":[
{
"id": <group_id>,
"name": <string>
}
]
},
"owner":{
"id": <user_id>,
"first_name": <string>,
"last_name": <string>,
"username": <string>,
"company_name": <string>,
"account_type": <enum>
}
}
]Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Invalid task_id | 404 Not Found | "detail": ["Not found."] |
| Invalid payload schema | 400 Bad Request | "detail": ["Invalid payload schema"] |
| "user_groups" is passed when 1TC user is already an assignee | 400 Bad Request | "detail": ["One 1 Time Completion user already in assignees.] |
| "user_groups" list is empty | 400 Bad Request | "detail": ["This list of assignees may not be empty."] |
| "user_groups" list contains different type than integer | 400 Bad Request | "detail": ["Incorrect type. Expected pk value, received {type}."] |
| Users Group with given ID does not exist | 400 Bad Request | "detail": ["Invalid pk "{id}" - object does not exist."] |
| Insufficient permissions to Users Group | 400 Bad Request | "detail": ["Invalid pk "{id}" - You do not have permission for this Group."] |
| Exceeded max batch size | 400 Bad Request | "detail": ["Up to 10 items allowed."] |
| Exceeded max number of Users Group assignees | 400 Bad Request | "detail": ["Limit of 10 group assignees has been exceeded."] |
DELETE /api/tasks/task_id/stages/stage_id/assignees/user-groups/
Unassign user groups from stage 1 of a Task
Permissions
Requires authentication, and task.assign permissions.
Request
- Headers
Request Method: DELETE
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/user-groups/
Authorization: JWT access_token- Body
Sample request body
[group_id_1, group_id_2]Response
- Successful status
204 NO CONTENT
Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Invalid task_id | 404 Not Found | "detail": ["Not found."] |
| Invalid payload schema | 400 Bad Request | "detail": ["Invalid payload schema"] |
| "user-groups" list is empty | 400 Bad Request | "detail": ["This list of assignees may not be empty."] |
| "user-groups" list contains different type than integer | 400 Bad Request | "detail": ["Incorrect type. Expected pk value, received {type}."] |
| Exceeded max batch size | 400 Bad Request | "detail": ["Up to {BATCH_LIMIT} items allowed."] |
OPTIONS /api/tasks/task_id/stages/stage_id/assignees/user-groups/
Permissions
Requires authentication only.
Request
- Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/tasks/1/stages/stage_1/assignees/user-groups/
Authorization: JWT access_tokenResponse
- Successful status
200 OK - Response body:
{
"batch": {
"type": "set",
"required": true,
"autocomplete": "/api/user-groups/autocomplete/?text__icontains="
},
"restrictions": {
"limit_items": 10,
"limit_items_in_batch": 10
}
}PATCH /api/task/task_id/stages/stage_id/owner/
Creates/Modified task owner.
Permissions
Requires authentication, task.assign and task.complete permissions.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id | |
| stage_id | id |
- Body parameters
| Key | Type | Required | Notes |
|---|---|---|---|
| owner | int | True |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
PATCH /api/task/`task_id`/stages/`stage_id`/owner/me/
{
"owner": <int>,
}Validations
- owner
- Valid user ID with
task.completepermission.
- Valid user ID with
Sample request body
{
"owner": <int>
}Response
| Key | Type | Notes |
|---|---|---|
| name | str | Stage name. Ex. stage_1 |
| status | str | Task status |
| owner | user |
- Successful status
200 OK - Response body schema
{
"name": "stage_1",
"status": "outstanding",
"owner": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
}
}Errors
| Cause | Response code | Message |
|---|---|---|
| “owner” is missing | 400 Bad Request | “owner”: [“This field is required.”] |
| “owner” is not an integer | 400 Bad Request | “owner”: ["Incorrect type. Expected pk value, received {type}."] |
| Invalid user ID | 400 Bad Request | “owner”: ["Invalid pk {id} - object does not exist."] |
| Request user does not have "users.list" permission for the user to be set as task stage owner | 400 Bad Request | “owner”: ["You do not have permission to make user "{user_id}" the owner of Task "{task_id}"."] |
| “owner” does not have “complete task” permission and assignee limit exceed | 400 Bad Request | “detail”: "Limit of 100 standard assignees has been exceeded.", "error_code": "ERR_LIMIT_EXCEEDED" |
| Stage is completed | 400 Bad Request | “detail”: ["Stage {stage name} is completed. Owner cannot be changed.”] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
PATCH /api/task/task_id/stages/stage_id/owner/me/
Assigning the caller as task owner.
Permissions
Requires authentication and task.complete permissions.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id | |
| stage_id | id |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
PATCH /api/task/`task_id`/stages/`stage_id`/owner/me/Response
| Key | Type | Notes |
|---|---|---|
| name | str | Stage name. Ex. stage_1 |
| status | str | Task status |
| owner | user |
- Successful status
200 OK - Response body schema
{
"name": "stage_1",
"status": "outstanding",
"owner": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
}
}Errors
| Cause | Response code | Message |
|---|---|---|
| Stage is completed | 400 Bad Request | “detail”: ["Stage {stage name} is completed. Owner cannot be changed.”] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
DELETE /api/task/task_id/stages/stage_id/owner/me/
API for removing the caller as task owner.
Permissions
Requires authentication and task.complete permissions.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id | |
| stage_id | id |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
DELETE /api/task/`task_id`/stages/`stage_id`/owner/me/Response
- Successful status
204 No Content
Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Caller is not the owner | 400 Bad Request | "detail": ["You are not the owner of {stage name} stage.”] |
GET /api/tasks/1tc/token/
Permissions
Requires valid token matching one time completion user and task. Token is sent by email message to a user on assigning him to a task (as task assignee).
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| token | string |
- Headers
Content-Type: application/json- Schema
GET /api/tasks/1tc/`token`/Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| task_template | int | |
| object_record | int | |
| instructions | string | |
| configuration | array | Copy of Task template object |
| status | enum | |
| due_date | date | |
| response | Array | Response result |
| _meta | Object | _meta result. Does not contain permissions. |
Response response array
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| state | enum | |
| data | Array | |
| files | Array | |
| modified_at | Array | |
| modified_by | user | |
| _meta.labels | Object |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| labels.status | enum |
Response example
- Status
200 OK - Body
{
"id": 58,
"name": "Some task",
"task_template": 37,
"object_record": 191211,
"instructions": "",
"configuration": {
"expiry": null,
"renewals": [],
"reminders": [],
"expiry_day": null,
"complete_by": "user_defined",
"description": "",
"expiry_date": null,
"instructions": "",
"plugin_config": {
"_meta": {
"labels": {
"task_type": "Object Record update",
"object_class": "some class"
}
},
"prompt": "",
"task_type": "tt_object_record_update",
"object_class": 9542,
"allow_comment": false,
"configuration": {},
"approval_required": false,
"approval_conditions": [],
"object_class_fields": [
41,
43,
44
]
},
"task_creation": "manual",
"complete_by_date": null,
"expiry_time_unit": null,
"expiry_time_value": null,
"expiry_time_rel_to": null,
"expiry_periodic_day": null,
"complete_by_time_unit": null,
"expiry_periodic_month": null,
"complete_by_time_value": null
},
"status": "outstanding",
"due_date": null,
"response": {
"id": 38,
"state": "initial",
"data": {
"field_enum": null
},
"modified_at": "2023-02-16T11:09:19.958434+01:00",
"modified_by": null,
"_meta": {
"labels": {
"state": "initial",
"files": {
"177": {
"name": "doc.docx",
"url": "https://alx.test/api/files/response/file/18d5168c-c058-4d95-8ef8-a2bf89f7bd40/doc.docx",
"size": "111303",
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
}
}
},
"files": {
"field_doc1": [
177
]
}
},
"_meta": {
"labels": {
"status": "Outstanding"
}
}
}Sorting
Not supported
Filtering
Not supported
Errors
| Error | Response code | Message |
|---|---|---|
| Task has been reassigned. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been completed. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been deleted. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Token has been tampered with. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
GET /api/tasks/1tc/token/class-fields/
Returns class fields used in specific Update Object Record task. token contains task's id.
Permissions
Requires valid token matching one time completion user and task.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| token | string |
- Headers
Content-Type: application/json- Schema
GET /api/tasks/1tc/`token`/class-fields/Response
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of fields visible to the user. |
| filtered_count | int | Number of fields visible to the user with filters applied. |
| next | url / null | Next page URL (null if there is no next page) |
| previous | url / null | Previous page URL (null if there is no previous page) |
| results | Array | List of fields used in specific Update Object Record task |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 3,
"total_count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 13,
"label": "JSON",
"type": "json",
"alias": "json",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"order": 0,
"extras": {}
},
{
"id": 12,
"label": "URL",
"type": "url",
"alias": "url",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"order": 1,
"extras": {}
}
]
}Sorting
Not supported
Filtering
List can be Filtered by id parameter.
| Parameter | Type | Example |
|---|---|---|
| id | int + enum | {build}/api/tasks/1tc/4b48-1m-736...b86/class-fields/?id__in=1,2 |
Allowed predicates:
| Predicate | Query param | Allowed value |
|---|---|---|
| = | id= | int |
| != | id!= | int |
| in | id__in= | array of ints |
| not in | id__in!= | array of ints |
Errors
| Error | Response code | Message |
|---|---|---|
| Task has been reassigned. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been completed. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been deleted. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Token has been tampered with. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Task type is "Complete standalone form" | 404 Not Found | "detail": "Not found." |
POST /api/tasks/1tc/token/upload/
Uploads single file as temporary file to be used in other places in the ALX system. Unique token is returned in a response, to identify file on backend side. The token can be used for any compatible endpoint supporting uploaded files.
References
Permissions
Requires valid token matching one time completion user and task. Token is sent by email message to a user on assigning him to a task (as task assignee).
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| token | string |
- Body parameters
Request's body contains binary data of uploaded file.
- Headers
Content-Disposition: attachment; filename=<filename>- Schema
POST /api/tasks/1tc/`token`/upload/
<binary data>Validations
- Allowed File Extensions
- Content-Disposition header:
- filename is required
- Binary data:
- cannot be empty
- file extension should be allowed
- max size 50 MB
Response
| Key | Type | Notes |
|---|---|---|
| token | string | Automatically generated by the backend. |
- Successful status
201 Created - Response body schema
{
"token": <string>
}Errors
| Cause | Response code | Message |
|---|---|---|
| Binary data is empty | 400 Bad Request | "detail": ["Empty content."] |
| Missing Content-Disposition header with filename | 400 Bad Request | "detail": ["Missing filename. Request should include a Content-Disposition header with a filename parameter."] |
| Not allowed file extension | 400 Bad Request | "detail": ["File extension “<extension>” is not allowed. Allowed extensions are: <allowed_extensions>."] |
| Task has been reassigned. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been completed. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Size of file is too big | 400 Bad Request | "detail": ["Max file size is 50.0 MB."] |
| Task has been deleted. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Token has been tampered with. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Timeout | 504 Timeout |
POST /api/tasks/1tc/token/save/
Saves response for task before completing it.
Permissions
Requires valid token matching one time completion user and task. Token is sent by email message to a user on assigning him to a task (as task assignee).
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| token | string |
- Body parameters
| Key | Type | Notes |
|---|---|---|
| data | json | Structure contains fields |
| files | Array |
Any parameter not listed above are silently ignored if passed.
- Headers
Content-Type: application/json- Schema
POST /api/tasks/1tc/`token`/save/
{
"data": {
"field_name": <str>,
"field_number": <integer>,
"field_some_date": <datetime>,
"other_2": <str>,
},
"files": {
"field_test_4": <document>
},
}Fields from above example depend on task template configuration.
Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | Automatically generated by the backend. |
| state | string | |
| data | Object | |
| files | Object | |
| modified_at | datetime | |
| modified_by | user | |
| _meta.labels.state | string | |
| _meta.labels.files | Object |
Response example
- Status
201 CREATED - Body
{
"id": 1,
"state": "saved",
"data": {
"field_name": "John",
"field_surname": "Doe",
"other_field": "Test"
},
"files": {
"field_test_4": [1]
},
"modified_at": "2022-03-04T09:20:38.357221Z",
"modified_by": {
"id": 1,
"first_name": "Firstname",
"last_name": "Lastname",
"username": "username",
"company_name": "Company",
"is_deleted": false
},
"_meta": {
"labels": {
"state": "Saved",
"files": {
"file_list": [{"name": "file1.jpg", "url": "http://test.test/api/files/response/file/4fef1510-7b0b-46fd-84d4-7b933d3b6f72/sample.docx"}]
}
}
}
}Restriction
- Maximum number of fields: 2000.
Errors
| Error | Response code | Message |
|---|---|---|
| Task has been reassigned. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been completed. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been deleted. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Token has been tampered with. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
files invalid data | 400 Bad Request | "files": {"file_slug": "Invalid data. Expected a list, but got /type/."} |
files invalid token | 400 Bad Request | "files": {"file_slug": ["Invalid token /token/."] } |
files invalid id | 400 Bad Request | "files": {"file_slug": ["Invalid file_id /id/."] } |
files duplicates | 400 Bad Request | "files": ["file_slug cannot contain duplicates."] |
data value is different type than an object or NULL | 400 Bad Request | "data": {"non_field_errors": ["Invalid data. Expected a dictionary, but got /type/."]} |
data contains more than 2000 items | 400 Bad Request | "data": {"non_field_errors": ["Up to 2000 items allowed."]} |
POST /api/tasks/1tc/token/complete/
Complete task.
Permissions
Requires valid token matching one time completion user and task. Token is sent by email message to a user on assigning him to a task (as task assignee).
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| token | string |
- Body parameters
| Key | Type | Notes |
|---|---|---|
| data | json | Structure contains fields |
| files | Array |
Any parameter not listed above are silently ignored if passed.
- Headers
Content-Type: application/json- Schema
POST /api/tasks/1tc/`token`/complete/
{
"data": {
"field_name": <str>,
"field_number": <integer>,
"field_some_date": <datetime>,
"other_2": <str>,
},
"files": {
"field_test_4": <document>
},
}Fields from above example depend on task template configuration.
Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | Automatically generated by the backend. |
| state | string | |
| data | Object | |
| files | Object | |
| modified_at | datetime | |
| modified_by | user | |
| _meta.labels.state | string | |
| _meta.labels.files | Object |
Response example
- Status
201 CREATED - Body
{
"id": 1,
"state": "accepted",
"data": {
"field_name": "John",
"field_surname": "Doe",
"other_field": "Test"
},
"files": {
"field_test_4": [1]
},
"modified_at": "2022-03-04T09:20:38.357221Z",
"modified_by": {
"id": 1,
"first_name": "Firstname",
"last_name": "Lastname",
"username": "username",
"company_name": "Company",
"is_deleted": false
},
"_meta": {
"labels": {
"state": "Saved",
"files": {
"file_list": [{"name": "file1.jpg", "url": "http://test.test/api/files/response/file/4fef1510-7b0b-46fd-84d4-7b933d3b6f72/sample.docx"}]
}
}
}
}Restriction
- Maximum number of fields: 2000.
Errors
| Error | Response code | Message |
|---|---|---|
| Task has been reassigned. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been completed. | 400 Bad Request | "detail": "Task no longer available.", "error_code": "ERR_INVALID_TOKEN" |
| Task has been deleted. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Token has been tampered with. | 403 Forbidden | "detail": "You do not have permission to perform this action." |
files invalid data | 400 Bad Request | "files": {"file_slug": "Invalid data. Expected a list, but got /type/."} |
files invalid token | 400 Bad Request | "files": {"file_slug": ["Invalid token /token/."] } |
files invalid id | 400 Bad Request | "files": {"file_slug": ["Invalid file_id /id/."] } |
files duplicates | 400 Bad Request | "files": ["/file_slug/ cannot contain duplicates."] |
data value is NULL | 400 Bad Request | "detail": "This field may not be null." |
data value is different type than an object or NULL | 400 Bad Request | "data": {"non_field_errors": ["Invalid data. Expected a dictionary, but got /type/."]} |
data contains more than 2000 items | 400 Bad Request | "data": {"non_field_errors": ["Up to 2000 items allowed."]} |
data.field_/alias/ is missing | 400 Bad Request | "data": {"/alias/": ["This field is required."]} |
GET /api/tasks/task_id/field/field_alias
Task response field details based on query parameters and caller permissions.
Permissions
Requires authentication and view for a specific task.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_id | id | |
| field_alias | slug | field_alias used in a task configuration. |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/tasks/1/field/field_userResponse
| Key | Type | Notes |
|---|---|---|
| id | id | Task id |
| name | string | Task name |
| task_template | int | |
| object_record | int | |
field_alias | Object | Structure depends on field type |
| _meta | Object |
Response _meta array
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| state | enum | |
| data | Array | |
| files | Array | |
| modified_at | Array | |
| modified_by | user | |
| _meta.labels.status | enum | |
| _meta.labels.files | Object | |
| _meta.users | Object | Returned only for User field type |
| _meta.user_groups | Object | Returned only for User field type |
| _meta.is_min_users_fulfilled | bool | Returned only for User field type |
Response example
- Status
200 OK - Body
{
"id": 1,
"name": "Test",
"task_template": 2,
"object_record": 1,
"field_user": {
"users": [
520,
642
],
"user_groups": [
761
]
},
},
"_meta": {
"is_min_users_fulfilled": true,
"users": {
"520": {
"id": 520,
"first_name": "Kamille",
"last_name": "Kohler",
"username": "kamille.kohler11@example.com",
"company_name": "",
"is_deleted": false,
"account_type": "full"
},
"642": {
"id": 642,
"first_name": "a",
"last_name": "b",
"username": "ab@example.test",
"company_name": "",
"is_deleted": false,
"account_type": "full"
},
...
}
},
"user_groups": {
"761": {
"id": 761,
"name": "54fd57"
}
}
}
}Errors
| Error | Response code | Message |
|---|---|---|
| Given {task_id} is for task of different task_type than tt_object_record_update | 404 Not Found | |
| Given {task_id} is not exists | 404 Not Found | |
| Given {field_alis} is not a class field | 404 Not Found | |
| Given {field_alis} is not used in task configuration | 404 Not Found | |
| Given {field_alis} is not exists | 404 Not Found | |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized |