Skip to content

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.

  1. Assigning Tasks to users (assignees).
  2. Designating Task owners.
  3. Locking Tasks.
  4. New Task statuses and response states.

References

Tasks API

POST /api/tasks/

Permissions

Requires authentication and any of:

  1. tasks.create permission, for task_type == tt_object_record_update object_record.edit is required
  2. Object Record Ownership
  3. Object Class Ownership
  4. Object Record Permission Set permission

Request example

  • Headers
Request Method: POST
Location: /api/tasks/
Authorization: JWT access_token
  • Body
json
{
  "name": "Sample Task",
  "object_record":"1",
  "task_template":1,
  "due_date":null,
  "task_type":"tt_object_record_update"
}

Response

KeyTypeNotes
iduuid
namestring
task_templateint
object_classint
object_recordint
instructionsstring
configurationarrayCopy of Task template object
statusenum
created_atdate
created_byuser
modified_atdate
modified_byuser
due_datedate
expiry_datedate
completed_atdate
completed_byuser
responseArrayResponse result
stagesArrayStages result
next_actionsArrayActions schema
_metaObject_meta result

Response response array

KeyTypeNotes
iduuid
stateenum
dataArray
filesArray
modified_atArray
modified_byuser
_meta.labelsObject

data for Response type Object Record Update

::: When task_type is tt_object_record_update the data contains

  • If task is initial and was never saved before: values are taken from recent Object Record related field values.
  • If task was saved with given field: data will 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

KeyTypeNotes
nameenum
statusenum
owneruser
assignees.usersArrayList of users

Response _meta object

KeyTypeNotes
labels.statusenum
labels.filesObject
permissionObject

Response actions array

OwnerAssignCompleteNext 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
json
{
  "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

ErrorResponse codeMessage
name is to long400 Bad Request"detail":
task_template is not set400 Bad Request"detail": {"task_template": ["This field is required."]}
object_record is not set400 Bad Request"detail": {"object_record": ["This field is required."]}
task_template is set with empty value400 Bad Request"detail": {"task_template": ["This field may not be null."]}
object_record is set with empty value400 Bad Request"detail": {"object_record": ["This field may not be null."]}
task_template value is different than expected400 Bad Request"detail": {"task_template": ["Incorrect type. Expected pk value, received list."]}
object_record value is different than expected400 Bad Request"detail": {"object_record": ["Incorrect type. Expected pk value, received list."]}
task_template not exists400 Bad Request"detail": {"task_template": ["Invalid pk "<task_template_id>" - object does not exist."]}
object_record not exists400 Bad Request"detail": {"object_record": ["Invalid pk "<object_record_id>" - object does not exist."]}
object_record and task_template set is not unique400 Bad Request"detail": "The fields task_template, object_record must make a unique set."
Task template configuration class is different than object record class400 Bad Request"detail": "This task cannot be created for this record."
Requesting user is authorized but without view perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 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
json
GET /api/tasks/

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of forms visible to the user (based on permissions).
filtered_countintNumber of forms visible to the user (based on permissions) with filters applied.
nextURL / nullNext page URL (null if there is no next page)
previousURL / nullPrevious page URL (null if there is no previous page)
resultsArrayDescribed in the next table.

Response results array

KeyTypeNotes
idid
namestring
task_templateint
object_classint
object_recordint
object_namestringValue 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.
statusboolValues: not_created, not_started, in_progress, completed, etc.
due_datedatetime
expiry_datedatetime
configurationarrayCopy of Task template object
expiry_atdatetime
created_atdatetime
completed_atdatetime
completed_byuser
modified_byuser
current_owneruser
current_assigneesarrayContains list of assigneed Users and UserGroups
_metaObject_meta result

Response _meta object

KeyTypeNotes
permissionObjectObject describing permissions.
labels.object_classstringObject Class name

Response example

  • Status 200 OK
  • Body
json
{
  "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

ParameterExampleNotes
id{build}/api/tasks/?ordering=idAscending
id{build}/api/tasks/?ordering=-idDescending (-)
name{build}/api/tasks/?ordering=nameAscending
name{build}/api/tasks/?ordering=-nameDescending (-)
object_class{build}/api/tasks/?ordering=object_classAscending
object_class{build}/api/tasks/?ordering=-object_classDescending (-)
object_record{build}/api/tasks/?ordering=object_recordAscending
object_record{build}/api/tasks/?ordering=-object_recordDescending (-)
task_template{build}/api/tasks/?ordering=task_templateAscending
task_template{build}/api/tasks/?ordering=-task_templateDescending (-)
expiry_at{build}/api/tasks/?ordering=expiry_atAscending
expiry_at{build}/api/tasks/?ordering=-expiry_atDescending (-)
due_date{build}/api/tasks/?ordering=due_dateAscending
due_date{build}/api/tasks/?ordering=-due_dateDescending (-)
created_at{build}/api/tasks/?ordering=created_atAscending
created_at{build}/api/tasks/?ordering=-created_atDescending (-)
modified_at{build}/api/tasks/?ordering=modified_atAscending
modified_at{build}/api/tasks/?ordering=-modified_atDescending (-)
completed_at{build}/api/tasks/?ordering=completed_atAscending
completed_at{build}/api/tasks/?ordering=-completed_atDescending (-)

Filtering

For the full description of standard predicates see ALX API standards - Developers guide.

ParameterPredicatesExample
idstandard pk{build}/api/tasks/?id=1
namestandard string{build}/api/tasks/?name__icontains=foobar
task_templatestandard set{build}/api/tasks/?task_template__in=3,33,333
expiry_datestandard datetime{build}/api/tasks/?expiry_date__gte=2022-01-01
created_atstandard datetime{build}/api/tasks/?created_at__gte=2022-01-01
completed_atstandard datetime{build}/api/tasks/?completed_at__gte=2022-01-01
completed_bystandard set{build}/api/tasks/?completed_by__in=123,234,345
statusstandard set{build}/api/tasks/?status__in=completed,created
task_typestandard set{build}/api/tasks/?task_type=tt_form
object_classstandard pk with in predicate{build}/api/tasks/?object_class__in=3,33,333
object_recordstandard set{build}/api/tasks/?object_record__in=3,33,333
due_datestandard datetime{build}/api/tasks/?due_date__range=2022-01-01,2022-01-31
created_atstandard datetime{build}/api/tasks/?created_at__gte=2022-01-01
created_bystandard set{build}/api/tasks/?created_by__in=123,234,345
modified_atstandard datetime{build}/api/tasks/?modified_at__range=2022-01-01,2022-01-31
modified_bystandard set{build}/api/tasks/?modified_by=123
current_ownerstandard set{build}/api/tasks/?current_owner=12
current_assignees__usersisnull, containsall, containssome{build}/api/tasks/?current_assignees__users__containssome=12,48
current_assignees__user_groupsisnull, 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:

json
{
  "filter": {
    "and": [
      {
        "name__icontains": "foo"
      },
      {
        "status": "completed"
      },
    ]
  },
}

Sample usage in url:

json
/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:

json
?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%7D

It could be mixed with regular filters.

json
?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%7D
Special cases

Not recommended but supported in the API in that way:

  • if the same key is used multiple times (duplicated keys) in the same filter
    json
    /api/tasks/?filters={ 
      "or": [ 
               {"current_assignees__users__containsall": "2,31"}, 
               {"current_assignees__users__containsall": "1,2"} 
      ] 
    }
    only last one will be used, all previous occurrences will be ignored
    json
    {"current_assignees__users__containsall": "1,2"}
  • if single condition entry contains multiple conditions
    json
    /api/tasks/?filters={ 
      "or": [ 
               {"current_assignees__users__containsall": "2,31", "id": "1"}, 
               {"current_assignees__user_groups__containssome": "1,2"} 
      ] 
    }
    first multiple condition entry will be used with operator and and the result will be combined with second entry with operator or
    json
    {"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.
    json
    /api/tasks/?filters={ 
      "or": [ 
               {"current_assignees__users__containsall": "2,31"}, 
               {"current_assignees__user_groups__containssome": "1,2", "and": [{"id": "1"}, {"name": "foo"}]} 
      ] 
    }
    will be used as:
    json
    {"current_assignees__users__containsall": "2,31"} or (current_assignees__user_groups__containssome = "1,2" and id = "1" and name = "foo")

Errors

ErrorResponse codeMessage
Requesting user is not authenticated401 Unauthorized"detail": "Authentication credentials were not provided."
Filter task type is not a valid choice400 Bad Request"detail": {"task_type": ["Select a valid choice. fake_type is not one of the available choices."]}
Invalid date/time in date field filter400 Bad Request"detail": {"created_at": ["Enter a valid date/time."]}
Filter completed_by with wrong user id400 Bad Request"detail": {"task_type": ["Select a valid choice. completed_by is not one of the available choices."]}
Filter invalid object400 Bad Request{"filters": ["Value must be a JSON object."]}
Filter invalid single operator400 Bad Request{"filters": ["JSON must contain exactly one key: 'or' or 'and'."]}
Filter invalid list400 Bad Request{"filters": ["The value of "logic_key" must be a list."]}
Filter max items exceeded400 Bad Request{"filters": ["List cannot contain more than 10 elements."]}
Filter invalid single key400 Bad Request{"filters": ["Value must have exactly one key."]}
Filter invalid nested operators400 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
json
OPTIONS /api/tasks/

Response

  • Successful status 200 OK
  • Response body:
json
{
    "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

  1. tasks.view permission
  2. Object Record Ownership
  3. Object Class Ownership
  4. Object Record Permission Set permission
  5. Object Class Permission Set permission

Request

  • URL parameters
KeyTypeNotes
task_idid
  • Headers
<!-- Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/tasks/`task_id`/

Response

KeyTypeNotes
iduuid
namestring
task_templateint
object_classint
object_recordint
instructionsstring
configurationarrayCopy of Task template object
statusenum
created_atdate
created_byuser
modified_atdate
modified_byuser
due_datedate
expiry_datedate
completed_atdate
completed_byuser
responseArrayResponse result
stagesArrayStages result
next_actionsArrayActions schema
_metaObject_meta result

Response response array

KeyTypeNotes
iduuid
stateenum
dataArray
filesArray
modified_atArray
modified_byuser
_meta.labelsObject
_meta.usersObjectOnly for User field type
_meta.user_groupsObjectOnly 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 initial and was never saved before: values are taken from recent Object Record related field values.
  • If task was saved with given field: data will 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

KeyTypeNotes
nameenum
statusenum
owneruser
assignees.usersArrayList of users
assignees.user_groupsArrayList of user_groups

Response _meta object

KeyTypeNotes
labels.statusenum
labels.filesObject
permissionObject

Response actions array

OwnerAssignCompleteNext 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
json
{
  "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

ErrorResponse codeMessage
A non-existent task_id was given404 Not Found"detail": "Not found."
Requesting user is authorized but without view perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 Unauthorized"detail": "Authentication credentials were not provided."

PATCH /api/tasks/task_id/

Permissions

Requires authentication and any of:

  1. tasks.edit permission
  2. Object Record Ownership
  3. Object Class Ownership
  4. Object Record Permission Set permission

Request

  • URL parameters
KeyTypeNotes
task_idid
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Body
KeyTypeRequiredNotes
due_datedatefalse
  • Schema
json
PATCH /api/tasks/`task_id`/

Response

KeyTypeNotes
iduuid
namestring
task_templateint
object_classint
object_recordint
instructionsstring
configurationarrayCopy of Task template object
statusenum
created_atdate
created_byuser
modified_atdate
modified_byuser
due_datedate
expiry_datedate
completed_atdate
completed_byuser
responseArrayResponse result
stagesArrayStages result
next_actionsArrayActions schema
_metaObject_meta result

Response response array

KeyTypeNotes
iduuid
stateenum
dataArray
filesArray
modified_atArray
modified_byuser
_meta.labelsObject

data for Response type Object Record Update

::: When task_type is tt_object_record_update the data contains

  • If task is initial and was never saved before: values are taken from recent Object Record related field values.
  • If task was saved with given field: data will 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

KeyTypeNotes
nameenum
statusenum
owneruser
assignees.usersArrayList of users
assignees.user_groupsArrayList of user_groups

Response _meta object

KeyTypeNotes
labels.statusenum
labels.filesObject
permissionObject

Response actions array

OwnerAssignCompleteNext 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
json
{
  "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

ErrorResponse codeMessage
name is to long400 Bad Request"detail":
A non-existent task_id was given404 Not Found"detail": "Not found."
Requesting user is authorized but without perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 Unauthorized"detail": "Authentication credentials were not provided."

DELETE /api/tasks/task_id/

Remove a Task.

Permissions

Requires authentication and any of:

  1. tasks.delete permission
  2. Object Record Ownership
  3. Object Class Ownership
  4. Object Record Permission Set permission

Request example

  • Headers
Request Method: DELETE
Location: /api/tasks/1/
Authorization: JWT access_token

Response example

  • Status 204 No Content
  • Body

Errors

ErrorResponse codeMessage
A non-existent task_id was given404 Not Found"detail": "Not found."
Requesting user is authorized but without perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 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
KeyTypeNotes
datajsonStructure contains fields
files.file_listArray

Any parameter not listed above are silently ignored if passed.

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
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

KeyTypeNotes
iduuidAutomatically generated by the backend.
statestring
dataObject
filesObject
modified_atdatetime
modified_byuser
_meta.labelsObject"object_class":

Response example

  • Status 201 CREATED
  • Body
json
{
    "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

ErrorResponse codeMessage
files invalid data400 Bad Request'files': {'file_slug': "Invalid data. Expected a list, but got /type/."}
files invalid token400 Bad Request'files': {'file_slug': ["Invalid token /token/."] }
files invalid id400 Bad Request'files': {'file_slug': ["Invalid file_id /id/."] }
files duplicates400 Bad Request{'files': ["'file_slug' cannot contain duplicates."]}
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

Field type Errors

CauseResponse codeMessage
string is too long400 Bad Request"field_{string}": ["Ensure this field has no more than {max} characters."]
string is required400 Bad Request"field_{string}": ["This field is required."]
string is not unique400 Bad Request"field_{string}": ["This field must be unique."]
integer value is invalid400 Bad Request"field_{integer}": ["A valid integer is required."]
integer is required400 Bad Request"field_{integer}": ["This field is required."]
integer value is below the limit400 Bad Request"field_{integer}": ["Ensure this value is greater than or equal to {min}."]
integer value is above the limit400 Bad Request"field_{integer}": ["Ensure this value is less than or equal to {max}."]
integer is not unique400 Bad Request"field_{integer}": ["This field must be unique."]
float value is invalid400 Bad Request"field_{float}": ["A valid number is required."]
float is required400 Bad Request"field_{float}": ["This field is required."]
float value is below the limit400 Bad Request"field_{float}": ["Ensure this value is greater than or equal to {min}."]
float value is above the limit400 Bad Request"field_{float}": ["Ensure this value is less than or equal to {max}."]
float is not unique400 Bad Request"field_{float}": ["This field must be unique."]
bool value is invalid400 Bad Request"field_{bool}": ["Must be a valid boolean."]
bool value different than required400 Bad Request"field_{bool}": ["Field contains a value other than required."]
email value is invalid400 Bad Request"field_{email}": ["Enter a valid email address."]
email is required400 Bad Request"field_{email}": ["This field is required."]
email value is above the limit400 Bad Request"field_{email}": ["Ensure this field has no more than {max} characters."]
email is not unique400 Bad Request"field_{email}": ["This field must be unique."]
phone value is invalid400 Bad Request"field_{phone}": ["Enter a valid email address."]
phone is required400 Bad Request"field_{phone}": ["This field is required."]
phone value is above the limit400 Bad Request"field_{phone}": ["Ensure this field has no more than {max} characters."]
phone is not unique400 Bad Request"field_{phone}": ["This field must be unique."]
date value is in wrong format400 Bad Request"field_{date}": ["Date has wrong format. Use one of these formats instead: YYYY-MM-DD."]
date is required400 Bad Request"field_{date}": ["This field is required."]
date is not unique400 Bad Request"field_{date}": ["This field must be unique."]
time value is in wrong format400 Bad Request"field_{time}": ["Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]."]
time is required400 Bad Request"field_{time}": ["This field is required."]
time is not unique400 Bad Request"field_{time}": ["This field must be unique."]
datetime value is in wrong format400 Bad Request"field_{datetime}": ["Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM
datetime is required400 Bad Request"field_{datetime}": ["This field is required."]
datetime is not unique400 Bad Request"field_{datetime}": ["This field must be unique."]
enum value is invalid400 Bad Request"field_{enum}": ["{value} is not a valid choice.]
enum is required400 Bad Request"field_{enum}": ["This field is required."]
enum is not unique400 Bad Request"field_{enum}": ["This field must be unique."]
set value is invalid400 Bad Request"field_{set}": ["Value must be valid Set."]
set is not a list400 Bad Request"field_{set}": ["Value must be valid Set."]
set value is below the limit400 Bad Request"field_{set}": ["The number of elements must be greater than or equal to {min}."]
set value is above the limit400 Bad Request"field_{set}": ["The number of elements must be less than or equal to {max}."]
url value is invalid400 Bad Request"field_{url}": ["Enter a valid URL."]
url is required400 Bad Request"field_{url}": ["This field is required."]
url value is above the limit400 Bad Request"field_{url}": ["Ensure this field has no more than {max} characters."]
url is not unique400 Bad Request"field_{url}": ["This field must be unique."]
json value is invalid400 Bad Request"field_{json}": ["Value must be valid JSON."]
json is required400 Bad Request"field_{json}": ["This field is required."]
json value is above the limit400 Bad Request"field_{json}": ["Ensure this field has no more than {max} characters."]
json is not unique400 Bad Request"field_{json}": ["This field must be unique."]
document value is invalid400 Bad Request"field_{document}": ["Value must be valid list."]
document token is invalid400 Bad Request"field_{document}": ["Invalid token {token}."]
document number files is above the limit400 Bad Request"field_{document}": ["The number of elements must be less than or equal to {max}."]
user is not a object400 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 permitted400 Bad Request"field_{user}": ["user_groups field is not allowed."]
user field - attempted to pass values in the users field when it was not permitted400 Bad Request"field_{user}": ["users field is not allowed."]

Response type Form

Complete task for tt_form.

Request

  • URL parameters
KeyTypeNotes
idid
  • Body parameters
KeyTypeNotes
dataObjectStructure contains field
files.file_listArray

Any parameter not listed above are silently ignored if passed.

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/tasks/`id`/complete/

{
    "data": {
        "first_name": "John",
        "last_name": "Doe"
    },
    "files": {
        "file_list": [“e4e633c6-8abb-4756-9ba6-4b9be539e956]
    }
}

Response

KeyTypeNotes
iduuidAutomatically generated by the backend.
statestring
dataObject
filesObject
modified_atdatetime
modified_byuser
_meta.labelsObject"object_class":

Response example

  • Status 201 CREATED
  • Body
json
{
    "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

ErrorResponse codeMessage
data value missing400 Bad Request"data": ["This field is required."]
data value is NULL400 Bad Request"data": ["This list may not be null."]
files invalid data400 Bad Request'files': {'file_slug': "Invalid data. Expected a list, but got /type/."}
files invalid token400 Bad Request'files': {'file_slug': ["Invalid token /token/."] }
files invalid id400 Bad Request'files': {'file_slug': ["Invalid file_id /id/."] }
files duplicates400 Bad Request{'files': ["'file_slug' cannot contain duplicates."]}
Insufficient permissions403 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
KeyTypeNotes
datajsonStructure contains fields
files.file_listArray

Any parameter not listed above are silently ignored if passed.

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
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

KeyTypeNotes
iduuidAutomatically generated by the backend.
statestring
dataObject
filesObject
modified_atdatetime
modified_byuser
_meta.labelsObject"object_class":

Response example

  • Status 201 CREATED
  • Body
json
{
    "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

ErrorResponse codeMessage
data value missing400 Bad Request"data": ["This field is required."]
data value is NULL400 Bad Request"data": ["This list may not be null."]
data does not contain all record fields required by task template configuration400 Bad Request"data": {"field_{alias}": ["Field is required"]}
data value is different type than a list400 Bad Request"data": ["Expected a list of items but got type "{type}"."]
data contains more than 2000 items400 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 data400 Bad Request'files': {'file_slug': "Invalid data. Expected a list, but got /type/."}
files invalid token400 Bad Request'files': {'file_slug': ["Invalid token /token/."] }
files invalid id400 Bad Request'files': {'file_slug': ["Invalid file_id /id/."] }
files duplicates400 Bad Request{'files': ["'file_slug' cannot contain duplicates."]}
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

Field type Errors

CauseResponse codeMessage
string is too long400 Bad Request"field_{string}": ["Ensure this field has no more than {max} characters."]
string is required400 Bad Request"field_{string}": ["This field is required."]
string is not unique400 Bad Request"field_{string}": ["This field must be unique."]
integer value is invalid400 Bad Request"field_{integer}": ["A valid integer is required."]
integer is required400 Bad Request"field_{integer}": ["This field is required."]
integer value is below the limit400 Bad Request"field_{integer}": ["Ensure this value is greater than or equal to {min}."]
integer value is above the limit400 Bad Request"field_{integer}": ["Ensure this value is less than or equal to {max}."]
integer is not unique400 Bad Request"field_{integer}": ["This field must be unique."]
float value is invalid400 Bad Request"field_{float}": ["A valid number is required."]
float is required400 Bad Request"field_{float}": ["This field is required."]
float value is below the limit400 Bad Request"field_{float}": ["Ensure this value is greater than or equal to {min}."]
float value is above the limit400 Bad Request"field_{float}": ["Ensure this value is less than or equal to {max}."]
float is not unique400 Bad Request"field_{float}": ["This field must be unique."]
bool value is invalid400 Bad Request"field_{bool}": ["Must be a valid boolean."]
bool value different than required400 Bad Request"field_{bool}": ["Field contains a value other than required."]
email value is invalid400 Bad Request"field_{email}": ["Enter a valid email address."]
email is required400 Bad Request"field_{email}": ["This field is required."]
email value is above the limit400 Bad Request"field_{email}": ["Ensure this field has no more than {max} characters."]
email is not unique400 Bad Request"field_{email}": ["This field must be unique."]
phone value is invalid400 Bad Request"field_{phone}": ["Enter a valid email address."]
phone is required400 Bad Request"field_{phone}": ["This field is required."]
phone value is above the limit400 Bad Request"field_{phone}": ["Ensure this field has no more than {max} characters."]
phone is not unique400 Bad Request"field_{phone}": ["This field must be unique."]
date value is in wrong format400 Bad Request"field_{date}": ["Date has wrong format. Use one of these formats instead: YYYY-MM-DD."]
date is required400 Bad Request"field_{date}": ["This field is required."]
date is not unique400 Bad Request"field_{date}": ["This field must be unique."]
time value is in wrong format400 Bad Request"field_{time}": ["Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]."]
time is required400 Bad Request"field_{time}": ["This field is required."]
time is not unique400 Bad Request"field_{time}": ["This field must be unique."]
datetime value is in wrong format400 Bad Request"field_{datetime}": ["Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM
datetime is required400 Bad Request"field_{datetime}": ["This field is required."]
datetime is not unique400 Bad Request"field_{datetime}": ["This field must be unique."]
enum value is invalid400 Bad Request"field_{enum}": ["{value} is not a valid choice.]
enum is required400 Bad Request"field_{enum}": ["This field is required."]
enum is not unique400 Bad Request"field_{enum}": ["This field must be unique."]
set value is invalid400 Bad Request"field_{set}": ["Value must be valid Set."]
set is not a list400 Bad Request"field_{set}": ["Value must be valid Set."]
set value is below the limit400 Bad Request"field_{set}": ["The number of elements must be greater than or equal to {min}."]
set value is above the limit400 Bad Request"field_{set}": ["The number of elements must be less than or equal to {max}."]
url value is invalid400 Bad Request"field_{url}": ["Enter a valid URL."]
url is required400 Bad Request"field_{url}": ["This field is required."]
url value is above the limit400 Bad Request"field_{url}": ["Ensure this field has no more than {max} characters."]
url is not unique400 Bad Request"field_{url}": ["This field must be unique."]
json value is invalid400 Bad Request"field_{json}": ["Value must be valid JSON."]
json is required400 Bad Request"field_{json}": ["This field is required."]
json value is above the limit400 Bad Request"field_{json}": ["Ensure this field has no more than {max} characters."]
json is not unique400 Bad Request"field_{json}": ["This field must be unique."]
document value is invalid400 Bad Request"field_{document}": ["Value must be valid list."]
document token is invalid400 Bad Request"field_{document}": ["Invalid token {token}."]
document number files is above the limit400 Bad Request"field_{document}": ["The number of elements must be less than or equal to {max}."]
user is not a object400 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 permitted400 Bad Request"field_{user}": ["user_groups field is not allowed."]
user field - attempted to pass values in the users field when it was not permitted400 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
KeyTypeNotes
task_idid
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/tasks/`task_id`/class-fields/

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of forms visible to the user (based on permissions).
filtered_countintNumber of forms visible to the user (based on permissions) with filters applied.
nexturl / nullNext page URL (null if there is no next page)
previousurl / nullPrevious page URL (null if there is no previous page)
resultsArrayList of fields

Response example

  • Status 200 OK
  • Body
json
{ 
  "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

ParameterTypeExample
idint + enum{build}/api/object-records/?id__in=1,2

Errors

ErrorResponse codeMessage
Given {task_id} is for task of different task_type than tt_object_record_update404 Not Found
Requesting user is authorized but without view perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 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_token

Response

  • Successful status 200 OK
  • Response body:
json
{
    "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

json
   [user_id_1, user_id_2]

Response

KeyTypeNotes
usersArrayArray of users objects
  • Successful status 201 Created
  • Response body schema
json
[
   {
      "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

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid task_id404 Not Found"detail": ["Not found."]
Invalid payload schema400 Bad Request"detail": ["Invalid payload schema"]
list is empty400 Bad Request"detail": ["This list of assignees may not be empty."]
list contains different type than integer400 Bad Request"detail": ["Incorrect type. Expected pk value, received {type}."]
User with given ID does not exist400 Bad Request"detail": ["Invalid pk "{id}" - object does not exist."]
Exceeded max batch size400 Bad Request"detail": ["Up to {BATCH_LIMIT} items allowed."]
Exceeded max number of standard assignees400 Bad Request"detail": ["Limit of 100 standard assignees has been exceeded."]
1TC user sent in request's body400 Bad Request"detail": ["1 Time Completion users are not allowed."]
1TC user sent when group added as assignees400 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 payload400 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

json
  [user_id_1, user_id_2]

Response

  • Successful status 204 NO CONTENT

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid task_id404 Not Found"detail": ["Not found."]
Invalid payload schema400 Bad Request"detail": ["Invalid payload schema"]
"users" list is empty400 Bad Request"detail": ["This list of assignees may not be empty."]
"users" list contains different type than integer400 Bad Request"detail": ["Incorrect type. Expected pk value, received {type}."]
Exceeded max batch size400 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_token

Response

  • Successful status 200 OK
  • Response body:
json
{
    "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

json
    [group_id_1, group_id_2]

Response

KeyTypeNotes
user-groupsArrayArray of users-group objects
  • Successful status 201 Created
  • Response body schema
json
[
   {
      "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

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid task_id404 Not Found"detail": ["Not found."]
Invalid payload schema400 Bad Request"detail": ["Invalid payload schema"]
"user_groups" is passed when 1TC user is already an assignee400 Bad Request"detail": ["One 1 Time Completion user already in assignees.]
"user_groups" list is empty400 Bad Request"detail": ["This list of assignees may not be empty."]
"user_groups" list contains different type than integer400 Bad Request"detail": ["Incorrect type. Expected pk value, received {type}."]
Users Group with given ID does not exist400 Bad Request"detail": ["Invalid pk "{id}" - object does not exist."]
Insufficient permissions to Users Group400 Bad Request"detail": ["Invalid pk "{id}" - You do not have permission for this Group."]
Exceeded max batch size400 Bad Request"detail": ["Up to 10 items allowed."]
Exceeded max number of Users Group assignees400 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

json
   [group_id_1, group_id_2]

Response

  • Successful status 204 NO CONTENT

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid task_id404 Not Found"detail": ["Not found."]
Invalid payload schema400 Bad Request"detail": ["Invalid payload schema"]
"user-groups" list is empty400 Bad Request"detail": ["This list of assignees may not be empty."]
"user-groups" list contains different type than integer400 Bad Request"detail": ["Incorrect type. Expected pk value, received {type}."]
Exceeded max batch size400 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_token

Response

  • Successful status 200 OK
  • Response body:
json
{
    "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
KeyTypeNotes
task_idid
stage_idid
  • Body parameters
KeyTypeRequiredNotes
ownerintTrue
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
PATCH /api/task/`task_id`/stages/`stage_id`/owner/me/

{
  "owner": <int>,
}

Validations

  • owner
    • Valid user ID with task.complete permission.

Sample request body

json
{
  "owner": <int>
}

Response

KeyTypeNotes
namestrStage name. Ex. stage_1
statusstrTask status
owneruser
  • Successful status 200 OK
  • Response body schema
json
{
    "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

CauseResponse codeMessage
“owner” is missing400 Bad Request“owner”: [“This field is required.”]
“owner” is not an integer400 Bad Request“owner”: ["Incorrect type. Expected pk value, received {type}."]
Invalid user ID400 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 owner400 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 exceed400 Bad Request“detail”: "Limit of 100 standard assignees has been exceeded.", "error_code": "ERR_LIMIT_EXCEEDED"
Stage is completed400 Bad Request“detail”: ["Stage {stage name} is completed. Owner cannot be changed.”]
Insufficient permissions403 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
KeyTypeNotes
task_idid
stage_idid
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
PATCH /api/task/`task_id`/stages/`stage_id`/owner/me/

Response

KeyTypeNotes
namestrStage name. Ex. stage_1
statusstrTask status
owneruser
  • Successful status 200 OK
  • Response body schema
json
{
    "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

CauseResponse codeMessage
Stage is completed400 Bad Request“detail”: ["Stage {stage name} is completed. Owner cannot be changed.”]
Insufficient permissions403 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
KeyTypeNotes
task_idid
stage_idid
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
DELETE /api/task/`task_id`/stages/`stage_id`/owner/me/

Response

  • Successful status 204 No Content

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Caller is not the owner400 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
KeyTypeNotes
tokenstring
  • Headers
Content-Type: application/json
  • Schema
json
GET /api/tasks/1tc/`token`/

Response

KeyTypeNotes
iduuid
namestring
task_templateint
object_recordint
instructionsstring
configurationarrayCopy of Task template object
statusenum
due_datedate
responseArrayResponse result
_metaObject_meta result. Does not contain permissions.

Response response array

KeyTypeNotes
iduuid
stateenum
dataArray
filesArray
modified_atArray
modified_byuser
_meta.labelsObject

Response _meta object

KeyTypeNotes
labels.statusenum

Response example

  • Status 200 OK
  • Body
json
{
    "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

ErrorResponse codeMessage
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
KeyTypeNotes
tokenstring
  • Headers
Content-Type: application/json
  • Schema
json
GET /api/tasks/1tc/`token`/class-fields/

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of fields visible to the user.
filtered_countintNumber of fields visible to the user with filters applied.
nexturl / nullNext page URL (null if there is no next page)
previousurl / nullPrevious page URL (null if there is no previous page)
resultsArrayList of fields used in specific Update Object Record task

Response example

  • Status 200 OK
  • Body
json
{ 
  "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.

ParameterTypeExample
idint + enum{build}/api/tasks/1tc/4b48-1m-736...b86/class-fields/?id__in=1,2

Allowed predicates:

PredicateQuery paramAllowed value
=id=int
!=id!=int
inid__in=array of ints
not inid__in!=array of ints

Errors

ErrorResponse codeMessage
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
KeyTypeNotes
tokenstring
  • Body parameters

Request's body contains binary data of uploaded file.

  • Headers
Content-Disposition: attachment; filename=<filename>
  • Schema
json
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

KeyTypeNotes
tokenstringAutomatically generated by the backend.
  • Successful status 201 Created
  • Response body schema
json
{
  "token": <string>
}

Errors

CauseResponse codeMessage
Binary data is empty400 Bad Request"detail": ["Empty content."]
Missing Content-Disposition header with filename400 Bad Request"detail": ["Missing filename. Request should include a Content-Disposition header with a filename parameter."]
Not allowed file extension400 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 big400 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."
Timeout504 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
KeyTypeNotes
tokenstring
  • Body parameters
KeyTypeNotes
datajsonStructure contains fields
filesArray

Any parameter not listed above are silently ignored if passed.

  • Headers
Content-Type: application/json
  • Schema
json
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

KeyTypeNotes
iduuidAutomatically generated by the backend.
statestring
dataObject
filesObject
modified_atdatetime
modified_byuser
_meta.labels.statestring
_meta.labels.filesObject

Response example

  • Status 201 CREATED
  • Body
json
{
    "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

ErrorResponse codeMessage
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 data400 Bad Request"files": {"file_slug": "Invalid data. Expected a list, but got /type/."}
files invalid token400 Bad Request"files": {"file_slug": ["Invalid token /token/."] }
files invalid id400 Bad Request"files": {"file_slug": ["Invalid file_id /id/."] }
files duplicates400 Bad Request"files": ["file_slug cannot contain duplicates."]
data value is different type than an object or NULL400 Bad Request"data": {"non_field_errors": ["Invalid data. Expected a dictionary, but got /type/."]}
data contains more than 2000 items400 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
KeyTypeNotes
tokenstring
  • Body parameters
KeyTypeNotes
datajsonStructure contains fields
filesArray

Any parameter not listed above are silently ignored if passed.

  • Headers
Content-Type: application/json
  • Schema
json
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

KeyTypeNotes
iduuidAutomatically generated by the backend.
statestring
dataObject
filesObject
modified_atdatetime
modified_byuser
_meta.labels.statestring
_meta.labels.filesObject

Response example

  • Status 201 CREATED
  • Body
json
{
    "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

ErrorResponse codeMessage
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 data400 Bad Request"files": {"file_slug": "Invalid data. Expected a list, but got /type/."}
files invalid token400 Bad Request"files": {"file_slug": ["Invalid token /token/."] }
files invalid id400 Bad Request"files": {"file_slug": ["Invalid file_id /id/."] }
files duplicates400 Bad Request"files": ["/file_slug/ cannot contain duplicates."]
data value is NULL400 Bad Request"detail": "This field may not be null."
data value is different type than an object or NULL400 Bad Request"data": {"non_field_errors": ["Invalid data. Expected a dictionary, but got /type/."]}
data contains more than 2000 items400 Bad Request"data": {"non_field_errors": ["Up to 2000 items allowed."]}
data.field_/alias/ is missing400 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
KeyTypeNotes
task_idid
field_aliasslugfield_alias used in a task configuration.
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/tasks/1/field/field_user

Response

KeyTypeNotes
ididTask id
namestringTask name
task_templateint
object_recordint
field_aliasObjectStructure depends on field type
_metaObject

Response _meta array

KeyTypeNotes
iduuid
stateenum
dataArray
filesArray
modified_atArray
modified_byuser
_meta.labels.statusenum
_meta.labels.filesObject
_meta.usersObjectReturned only for User field type
_meta.user_groupsObjectReturned only for User field type
_meta.is_min_users_fulfilledboolReturned only for User field type

Response example

  • Status 200 OK
  • Body
json
{
  "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

ErrorResponse codeMessage
Given {task_id} is for task of different task_type than tt_object_record_update404 Not Found
Given {task_id} is not exists404 Not Found
Given {field_alis} is not a class field404 Not Found
Given {field_alis} is not used in task configuration404 Not Found
Given {field_alis} is not exists404 Not Found
Requesting user is authorized but without view perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Requesting user is not authenticated401 Unauthorized