Skip to content

Task ​

INFO

Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.

POST /task/create ​

Create a task. attached_to selects which FK array is required (trade_uuids/trade_ids, order_ids, customer_ids, supplier_ids, employee_ids).

Request body

FieldTypeRequiredDescription
organization_idstringNo
type_idstringYesTask-type id (see /task-type/get-paging)
datestring (date-time)YesDate the task is scheduled for. When time_type=range, the value is rewritten to start_of_day(date)+start_time using the boss's UTC offset.
time_typestringNoOne of: full_day, range. Default: "full_day"
start_timestringNoRequired when time_type=range. 24h HH:MM.
end_timestringNoRequired when time_type=range. 24h HH:MM.
responsible_idstringYes
descriptionstringNo
attached_tostringNoOne of: trade, order, customer, supplier, employee
trade_uuidsstring[]NoUsed when attached_to=trade. Preferred over trade_ids; first non-empty wins.
trade_idsstring[]NoUsed when attached_to=trade.
order_idsstring[]NoRequired when attached_to=order.
customer_idsstring[]NoRequired when attached_to=customer.
supplier_idsstring[]NoRequired when attached_to=supplier.
employee_idsstring[]NoRequired when attached_to=employee.
json
{
  "organization_id": "67b486d242ed76693cd2cc59",
  "type_id": "67b486d242ed76693cd2cc59",
  "date": "2023-10-01T12:00:00Z",
  "time_type": "full_day",
  "start_time": "09:00",
  "end_time": "10:30",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "description": "string",
  "attached_to": "trade",
  "trade_uuids": [
    "string"
  ],
  "trade_ids": [
    "67b486d242ed76693cd2cc59"
  ],
  "order_ids": [
    "67b486d242ed76693cd2cc59"
  ],
  "customer_ids": [
    "67b486d242ed76693cd2cc59"
  ],
  "supplier_ids": [
    "67b486d242ed76693cd2cc59"
  ],
  "employee_ids": [
    "67b486d242ed76693cd2cc59"
  ]
}

Response

FieldTypeDescription
_idstring
created_atstring (date-time)
updated_atstring (date-time)
type_idstring
typeobject
type._idstring
type.namestring
type.iconstring
type.svgstring
type.colorstring
organization_idstring
datestring (date-time)
time_typestringOne of: full_day, range
start_timestring
end_timestring
created_bystring
created_by_infoobject
created_by_info._idstring
created_by_info.full_namestring
created_by_info.phone_numberstring
responsible_idstring
responsibleobject
responsible._idstring
responsible.full_namestring
responsible.phone_numberstring
descriptionstring
attached_tostringOne of: trade, order, customer, supplier, employee
trade_idsstring[]
order_idsstring[]
customer_idsstring[]
supplier_idsstring[]
employee_idsstring[]
purchase_idsstring[]
statestringOne of: created, completed
result_commentstring
is_postponedboolean
postponed_idstringOn a postponed clone, points back to the original task.
completed_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "67b486d242ed76693cd2cc59",
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z",
    "type_id": "67b486d242ed76693cd2cc59",
    "type": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "svg": "string",
      "color": "string"
    },
    "organization_id": "67b486d242ed76693cd2cc59",
    "date": "2025-05-01T12:00:00Z",
    "time_type": "full_day",
    "start_time": "09:00",
    "end_time": "10:30",
    "created_by": "67b486d242ed76693cd2cc59",
    "created_by_info": {
      "_id": "string",
      "full_name": "string",
      "phone_number": "string"
    },
    "responsible_id": "67b486d242ed76693cd2cc59",
    "responsible": {
      "_id": "string",
      "full_name": "string",
      "phone_number": "string"
    },
    "description": "string",
    "attached_to": "trade",
    "trade_ids": [
      "string"
    ],
    "order_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "supplier_ids": [
      "string"
    ],
    "employee_ids": [
      "string"
    ],
    "purchase_ids": [
      "string"
    ],
    "state": "created",
    "result_comment": "string",
    "is_postponed": false,
    "postponed_id": "67b486d242ed76693cd2cc59",
    "completed_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /task/update ​

Update a task. Rejects when state=completed. Only the creator or boss/additional-boss can update.

Request body

FieldTypeRequiredDescription
_idstringYes
organization_idstringNo
type_idstringNo
datestring (date-time)No
time_typestringNoOne of: full_day, range
start_timestringNo
end_timestringNo
responsible_idstringNo
descriptionstringNo
attached_tostringNoOne of: trade, order, customer, supplier, employee
trade_uuidsstring[]No
trade_idsstring[]No
order_idsstring[]No
customer_idsstring[]No
supplier_idsstring[]No
employee_idsstring[]No
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "organization_id": "67b486d242ed76693cd2cc59",
  "type_id": "67b486d242ed76693cd2cc59",
  "date": "2023-10-01T12:00:00Z",
  "time_type": "full_day",
  "start_time": "09:00",
  "end_time": "10:30",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "description": "string",
  "attached_to": "trade",
  "trade_uuids": [
    "string"
  ],
  "trade_ids": [
    "string"
  ],
  "order_ids": [
    "string"
  ],
  "customer_ids": [
    "string"
  ],
  "supplier_ids": [
    "string"
  ],
  "employee_ids": [
    "string"
  ]
}

Response

Same response shape as POST /task/create.

GET /task/get-by-id/{id} ​

Get a task by _id.

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /task/create.

GET /task/paging ​

Paginated task list. By default hides completed tasks unless state is set or date_type=completed_at. time and times filter by date-buckets (overdue/today/tomorrow/week/month/future) using the boss's UTC offset.

Query parameters

ParameterTypeRequiredDescription
pageintegerYesDefault: 1
limitintegerYesDefault: 20
updated_atstring (date-time)NoSync cursor — only returns rows with updated_at >= this value.
searchstringNo
timestringNoOne of: overdue, today, tomorrow, week, month, future
timesstring[]No
date_typestringNoOne of: created_at, date, completed_at
responsible_idstringNo
type_idstringNo
type_idsstring[]No
attached_tostringNoOne of: trade, order, customer, supplier, employee
statestringNoOne of: created, completed
trade_idstringNo
order_idstringNo
customer_idstringNo
supplier_idstringNo
employee_idstringNo
purchase_idstringNo
organization_idstringNo

Request body

No request body.

Response

data.total is the total number of records and data.data[] holds the current page. The table below describes one record.

FieldTypeDescription
_idstring
created_atstring (date-time)
updated_atstring (date-time)
type_idstring
typeobject
type._idstring
type.namestring
type.iconstring
type.svgstring
type.colorstring
organization_idstring
datestring (date-time)
time_typestringOne of: full_day, range
start_timestring
end_timestring
created_bystring
created_by_infoobject
created_by_info._idstring
created_by_info.full_namestring
created_by_info.phone_numberstring
responsible_idstring
responsibleobject
responsible._idstring
responsible.full_namestring
responsible.phone_numberstring
descriptionstring
attached_tostringOne of: trade, order, customer, supplier, employee
trade_idsstring[]
order_idsstring[]
customer_idsstring[]
supplier_idsstring[]
employee_idsstring[]
purchase_idsstring[]
statestringOne of: created, completed
result_commentstring
is_postponedboolean
postponed_idstringOn a postponed clone, points back to the original task.
completed_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z",
        "type_id": "67b486d242ed76693cd2cc59",
        "type": {
          "_id": "string",
          "name": "string",
          "icon": "string",
          "svg": "string",
          "color": "string"
        },
        "organization_id": "67b486d242ed76693cd2cc59",
        "date": "2025-05-01T12:00:00Z",
        "time_type": "full_day",
        "start_time": "09:00",
        "end_time": "10:30",
        "created_by": "67b486d242ed76693cd2cc59",
        "created_by_info": {
          "_id": "string",
          "full_name": "string",
          "phone_number": "string"
        },
        "responsible_id": "67b486d242ed76693cd2cc59",
        "responsible": {
          "_id": "string",
          "full_name": "string",
          "phone_number": "string"
        },
        "description": "string",
        "attached_to": "trade",
        "trade_ids": [
          "string"
        ],
        "order_ids": [
          "string"
        ],
        "customer_ids": [
          "string"
        ],
        "supplier_ids": [
          "string"
        ],
        "employee_ids": [
          "string"
        ],
        "purchase_ids": [
          "string"
        ],
        "state": "created",
        "result_comment": "string",
        "is_postponed": false,
        "postponed_id": "67b486d242ed76693cd2cc59",
        "completed_at": "2025-05-01T12:00:00Z"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

DELETE /task/delete/{id} ​

Soft-delete a task (sets is_deleted=true). Rejects when state=completed.

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "67b486d242ed76693cd2cc59",
  "time": "2025-05-01T12:00:00Z"
}

GET /task/get-deleted ​

Returns ids of tasks deleted on or after deleted_at (also matches updated_at >= deleted_at).

Query parameters

ParameterTypeRequiredDescription
deleted_atstring (date-time)Yes

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

PUT /task/complete ​

Mark a task as completed. Set is_postponed=true with postponed_date to clone the task at a future date (the original is marked completed; the clone has postponed_id pointing back to it).

Request body

FieldTypeRequiredDescription
_idstringYes
result_commentstringNo
is_postponedbooleanNoDefault: false
postponed_datestring (date-time)NoRequired when is_postponed=true. Must be in the future. The original task is marked completed and a clone with postponed_id pointing to the original is created at this date.
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "result_comment": "string",
  "is_postponed": false,
  "postponed_date": "2023-10-01T12:00:00Z"
}

Response

Same response shape as POST /task/create.

PUT /task/move ​

Move a task into a time-frame bucket. Sets date to the bucket's start (today/tomorrow/week/month) or month_end+1s for future. overdue is rejected.

Request body

FieldTypeRequiredDescription
_idstringYes
timestringYesTarget time-frame bucket. overdue is rejected.. One of: today, tomorrow, week, month, future
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "time": "today"
}

Response

Same response shape as POST /task/create.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API