Create Task

The Create Task API will allow you to create and update a task within Zenput.

Below is a sample call and a full description of input format, input parameters, and success and error output formats.

POST: /api/v1/tasks/task/save/

$ curl -X POST \
  https://www.zenput.com/api/v1/tasks/task/save/ \ 
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
    "title": "Bathroom Cleanliness",
    "reply": {
        "type": "form_submission",
        "form_template": {"id": 27}
    },
    "assignee": {"id": 1},
    "followers": [{"id": 2}],
    "date_due": "2018-07-01"
}'

Input format

{
  "title": title,
  "description": description,
  "reply": {
    "type": reply-type,
    "form_template": format-template-id
  },
  "time_zone": time_zone,
  "project": {
    "id": project-id
  },
  "account": {
    id: account-id
  },
  "reporter": {
    id: reporter-id
  },
  "assignee": {
    id: assignee-id
  },
  "date_start": date-start,
  "date_due": date-due,
  "date_due_naive": date-due-naive,
  "date_start_naive": date-start-naive,
  "followers": [
    { "id": follower-id }, ...
  ]
}

Input parameters

NameRequiredTypeDescription
titleRequiredtext or html (50 character limit), bleachedTask title.
descriptiontext or html (no length limit), bleachedTask description.
reply‑typeRequired"quick" or "click_done" or "form_submission"Basic, Photo, and Form task completion requirements, respectively.
form-template-idRequired if reply-type is "form_submission"integerTask form submission id.
time_zonetime_zone (See below)Time zone for location of task activity.
project‑idintegerTask project id.
account‑idintegerTask account id.
reporter‑idintegerTask reporter user id.
assignee‑idintegerTask assignee user id. Must be visible to reporter.
date‑starttimestamp (See below)Datetime task is available in UTC.
date‑duetimestamp (See below)Datetime task is due in UTC.
date-start-naivetimestamp (See below)Datetime task is available in the timezone of the account associated with the task.*
date-due-naivetimestamp (See below)Datetime task is due in the timezone of the account associated with the task.*
follower‑idintegerTask follower user id.
  • For using date start and date due naive - This will assign the time in the local time task's timezone (example: 9pm for the store - in whatever timezone the store exists). The assignment of time zone to the task is based on the following fallback logic. Account's timezone, then assignee user's timezone, then the company's time zone.
    Note: time_zone cannot be sent over in the task generation POST if using naive timezones.
    Note: naive and non-naive dates cannot be mixed, only one type may be sent.

Parameter type descriptions

Parameter typeDetails
time_zoneTZ column of https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
timestamp- Any format supported by https://labix.org/python-dateutil, in particular ISO 8601 as described in https://en.wikipedia.org/wiki/ISO_8601
- A MongoDB Extended JSON date as described in https://docs.mongodb.com/manual/reference/mongodb-extended-json/#date

Output format, success

{
    "status": 200,
    "message": "Task saved",
    "results": {
        "id": task-id
    },
    "success": true
}

Output format, failure

{
    "status": 500,
    "message": "Problem saving task",
    "exception": "Error detail appears here",
    "success": false
}