Help Center

Tasks

There are two types of tasks in Pyrus: simple tasks and form tasks.

A Simple task contains a fixed set of fields: Subject and Text, as well as an array of participants.

A Form task differs from the simple task in that it can have a pre-configured workflow and a custom set of fields.

Any change to the task, like altering the field values or downloading attachments, is done by adding a comment.

You can find more information on tasks and forms in Help.

Methods

GET /tasks/{task-id}

Getting a simple task with all comments A simple task has three fields that a form task doesn't have. These are text, responsible, and participants — an array of task participants from which you can assign a responsible person.

GET https://api.pyrus.com/v4/tasks/11611

Response body

{
  "task": {
    "id": 11611,
    "text": "Help with printer",
    "create_date": "2017-08-17T15:32:11Z",
    "last_modified_date": "2017-08-17T15:32:11Z",
    "author": {
      "id": 1731,
      "first_name": "Bob",
      "last_name": "Smith",
      "email": "Bob.Smith@gmail.com",
      "type": "user"
    },
    "responsible": {
      "id": 1733,
      "first_name": "John",
      "last_name": "Snow",
      "email": "John.Snow@gmail.com",
      "type": "user"
    },
    "participants": [
      {
        "id": 1733,
        "first_name": "John",
        "last_name": "Snow",
        "email": "John.Snow@gmail.com",
        "type": "user"
      },
      {
        "id": 1731,
        "first_name": "Bob",
        "last_name": "Smith",
        "email": "Bob.Smith@gmail.com",
        "type": "user"
      }
    ],
    "comments": [
      {
        "id": 13767,
        "create_date": "2017-08-17T15:32:11Z",
        "text": "Help with printer",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "reassigned_to": {
          "id": 1730,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        "participants_added": [
          {
            "id": 1733,
            "first_name": "John",
            "last_name": "Snow",
            "email": "John.Snow@gmail.com",
            "type": "user"
          },
          {
            "id": 1731,
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "Bob.Smith@gmail.com",
            "type": "user"
          }
        ],
        "reply_note_id": "13768"
      }
    ]
  }
}

curl

curl -X GET \
  'https://api.pyrus.com/v4/tasks/11611' \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json'

Getting a form task with all comments

A form task has three fields that a simple task doesn't have: form_id, a form template identifier; fields, an array of form fields; and approvals, an array of approval steps.

GET https://api.pyrus.com/v4/tasks/11613

Response body

{
  "task": {
    "id": 11613,
    "text": "Payments",
    "create_date": "2017-08-17T14:31:18Z",
    "last_modified_date": "2017-08-18T10:00:11Z",
    "author": {
      "id": 1731,
      "first_name": "Bob",
      "last_name": "Smith",
      "email": "Bob.Smith@gmail.com",
      "type": "user"
    },
    "form_id": 1345,
    "responsible": {
      "id": 1733,
      "first_name": "John",
      "last_name": "Snow",
      "email": "John.Snow@gmail.com",
      "type": "user"
    },
    "approvals": [
      [
        {
          "person": {
            "id": 1733,
            "first_name": "John",
            "last_name": "Snow",
            "email": "John.Snow@gmail.com",
            "type": "user"
          },
          "approval_choice": "waiting"
        }
      ],
      [
        {
          "person": {
            "id": 1731,
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "Bob.Smith@gmail.com",
            "type": "user"
          },
          "approval_choice": "waiting"
        }
      ]
    ],
    "fields": [
      {
        "id": 1,
        "type": "text",
        "name": "Purpose",
        "value": "IT conference in Amsterdam"
      },
      {
        "id": 2,
        "type": "money",
        "name": "Amount",
        "value": 10306.25
      },
      {
        "id": 3,
        "type": "catalog",
        "name": "Payment type",
        "value": {
          "item_id": 845,
          "headers": [
            "Payment types"
          ],
          "values": [
            "IT Conference"
          ]
        }
      },
      {
        "id": 4,
        "type": "table",
        "name": "Payment Schedule",
        "value" : [
          {
            "row_id": 0,
            "cells": [
              {
                "id": 9,
                "type": "date",
                "name": "Date",
                "value": "2017-08-26",
                "parent_id": 4,
                "row_id": 0
              },
              {
                "id": 6,
                "type": "money",
                "name": "Amount",
                "value": 10000,
                "parent_id": 4,
                "row_id": 0
              }
            ]
          },
          {
            "row_id": 1,
            "cells": [
              {
                "id": 9,
                "type": "date",
                "name": "Date",
                "value": "2017-08-27",
                "parent_id": 4,
                "row_id": 1
              },
              {
                "id": 6,
                "type": "money",
                "name": "Amount",
                "value": 306.25,
                "parent_id": 4,
                "row_id": 1
              }
            ]
          }
        ]
      }
    ],
    "comments": [
      {
        "id": 13767,
        "create_date": "2017-08-17T14:31:18Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "reassigned_to": {
          "id": 1730,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        "approvals_added": [
          [
            {
              "person": {
                "id": 1733,
                "first_name": "John",
                "last_name": "Snow",
                "email": "John.Snow@gmail.com",
                "type": "user"
              },
              "step": 1
            },
            {
              "person": {
                "id": 1725,
                "first_name": "Jane",
                "last_name": "Doe",
                "email": "Jane.Doe@gmail.com",
                "type": "user"
              },
              "step": 1
            }
          ],
          [
            {
              "person": {
                "id": 1731,
                "first_name": "Bob",
                "last_name": "Smith",
                "email": "Bob.Smith@gmail.com",
                "type": "user"
              },
              "step": 2
            }
          ]
        ],
        "field_updates": [
          {
            "id": 1,
            "type": "text",
            "name": "Purpose",
            "value": "IT conference in Amsterdam"
          },
          {
            "id": 2,
            "type": "money",
            "name": "Amount",
            "value": 10306.25
          },
          {
            "id": 3,
            "type": "catalog",
            "name": "Payment type",
            "value": {
              "item_id": 845,
              "headers": [
                "Payment types"
              ],
              "values": [
                "IT Conference"
              ]
            }
          },
          {
            "id": 4,
            "type": "table",
            "name": "Payment Schedule",
            "value" : [
              {
                "row_id": 0,
                "cells": [
                  {
                    "id": 9,
                    "type": "date",
                    "name": "Date",
                    "value": "2017-08-26",
                    "parent_id": 4,
                    "row_id": 0
                  },
                  {
                    "id": 6,
                    "type": "money",
                    "name": "Amount",
                    "value": 10000,
                    "parent_id": 4,
                    "row_id": 0
                  }
                ]
              },
              {
                "row_id": 1,
                "cells": [
                  {
                    "id": 9,
                    "type": "date",
                    "name": "Date",
                    "value": "2017-08-27",
                    "parent_id": 4,
                    "row_id": 1
                  },
                  {
                    "id": 6,
                    "type": "money",
                    "name": "Amount",
                    "value": 306.25,
                    "parent_id": 4,
                    "row_id": 1
                  }
                ]
              }
            ]
          },
          {
            "id": 13768,
            "create_date": "2017-08-18T10:00:11Z",
            "author": {
              "id": 1731,
              "first_name": "Bob",
              "last_name": "Smith",
              "email": "Bob.Smith@gmail.com",
              "type": "user"
            },
            "text": "",
            "approvals_removed": [
              [{
                "person": {
                  "id": 1725,
                  "first_name": "Jane",
                  "last_name": "Doe",
                  "email": "Jane.Doe@gmail.com",
                  "type": "user"
                },
                "step": 1
              }]
            ]
          }
        ]
      }
    ]
  }
}

curl

curl -X GET \
  'https://api.pyrus.com/v4/tasks/11613' \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json'

POST /tasks

Creating a simple task

This method returns a created task with a comment.

POST https://api.pyrus.com/v4/tasks

Request body

{
  "text": "Help with printer",
  "responsible": {
    "id": 1733
  },
  "participants": [
    {
      "id": 1733
    },
    {
      "email": "Bob.Smith@gmail.com"
    }
  ]
}

Response body

{
  "task": {
    "id": 11611,
    "text": "Help with printer",
    "create_date": "2017-08-17T15:32:11Z",
    "last_modified_date": "2017-08-17T15:32:11Z",
    "author": {
      "id": 1731,
      "first_name": "Bob",
      "last_name": "Smith",
      "email": "Bob.Smith@gmail.com",
      "type": "user"
    },
    "responsible": {
      "id": 1733,
      "first_name": "John",
      "last_name": "Snow",
      "email": "John.Snow@gmail.com",
      "type": "user"
    },
    "participants": [
      {
        "id": 1733,
        "first_name": "John",
        "last_name": "Snow",
        "email": "John.Snow@gmail.com",
        "type": "user"
      },
      {
        "id": 1731,
        "first_name": "Bob",
        "last_name": "Smith",
        "email": "Bob.Smith@gmail.com",
        "type": "user"
      }
    ],
    "comments": [
      {
        "id": 13767,
        "text": "Help with printer",
        "create_date": "2017-08-17T15:32:11Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
         "type": "user"
        },
        "reassigned_to": {
          "id": 1733,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        "participants_added": [
          {
            "id": 1733,
            "first_name": "John",
            "last_name": "Snow",
            "email": "John.Snow@gmail.com",
            "type": "user"
          },
          {
            "id": 1731,
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "Bob.Smith@gmail.com",
            "type": "user"
          }
        ]
      }
    ]
  }
}

curl

curl -X POST \
  https://api.pyrus.com/v4/tasks/ \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Help with printer",
  "responsible": {
    "id": 1733
  },
  "participants": [
    {
      "id": 1733
    },
    {
      "email": "Bob.Smith@gmail.com"
    }
  ]
}'

Creating a form task

This method returns a created task with a comment.

POST https://api.pyrus.com/v4/tasks

Request body

{
  "form_id": 1345,
  "fields": [
    {
      "id": 1,
      "value": "IT conference in Amsterdam"
    },
    {
      "code": "TicketPrice",
      "value": 10306.25
    },
    {
      "id": 3,
      "value": {
        "item_id": 845
      }
    },
    {
      "id": 4,
      "value": [
        {
          "row_id": 0,
          "cells": [
            {
              "id": 6,
              "value": "2017-08-26"
            },
            {
              "id": 9,
              "value": 10000
            }
          ]
        }
      ]
    },
    {
      "name": "Comment",
      "value": "Additional information about choice"
    }
  ]
}

Response body

{
  "task": {
    "id": 11615,
    "text": "Payments",
    "create_date": "2017-08-17T14:31:18Z",
    "last_modified_date": "2017-08-17T14:31:18Z",
    "author": {
      "id": 1731,
      "first_name": "Bob",
      "last_name": "Smith",
      "email": "Bob.Smith@gmail.com",
      "type": "user"
    },
    "form_id": 1345,
    "approvals": [
      [
        {
          "id": 1733,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        {
          "id": 1725,
          "first_name": "Jane",
          "last_name": "Doe",
          "email": "Jane.Doe@gmail.com",
          "type": "user"
        }
      ],
      [
        {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        }
      ]
    ],
    "fields": [
      {
        "id": 1,
        "type": "text",
        "name": "Purpose",
        "value": "IT conference in Amsterdam"
      },
      {
        "id": 2,
        "type": "money",
        "name": "Amount",
        "value": 10306.25
      },
      {
        "id": 3,
        "type": "catalog",
        "name": "Payment type",
        "value": {
          "item_id": 845,
          "headers": [
            "Payment types"
          ],
          "values": [
            "IT Conference"
          ]
        }
      },
      {
        "id": 4,
        "type": "table",
        "name": "Payment Schedule",
        "value" : [
          {
            "row_id": 0,
            "cells": [
              {
                "id": 9,
                "type": "date",
                "name": "Date",
                "value": "2017-08-26",
                "parent_id": 4,
                "row_id": 0
              },
              {
                "id": 6,
                "type": "money",
                "name": "Amount",
                "value": 10000,
                "parent_id": 4,
                "row_id": 0
              }
            ]
          }
        ]
      }
    ],
    "comments": [
      {
        "id": 13767,
        "create_date": "2017-08-17T14:31:18Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "reassigned_to": {
          "id": 1730,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        "approvals_added": [
          [
            {
              "person": {
                "id": 1733,
                "first_name": "John",
                "last_name": "Snow",
                "email": "John.Snow@gmail.com",
                "type": "user"
              },
              "step": 1
            },
            {
              "person": {
                "id": 1725,
                "first_name": "Jane",
                "last_name": "Doe",
                "email": "Jane.Doe@gmail.com",
                "type": "user"
              },
              "step": 1
            }
          ],
          [
            {
              "person": {
                "id": 1731,
                "first_name": "Bob",
                "last_name": "Smith",
                "email": "Bob.Smith@gmail.com",
                "type": "user"
              },
              "step": 2
            }
          ]
        ],
        "field_updates": [
          {
            "id": 1,
            "type": "text",
            "name": "Purpose",
            "value": "IT conference in Amsterdam"
          },
          {
            "id": 2,
            "type": "money",
            "name": "Amount",
            "value": 10306.25
          },
          {
            "id": 3,
            "type": "catalog",
            "name": "Payment type",
            "value": {
              "item_id": 845,
              "headers": [
                "Payment types"
              ],
              "values": [
                "IT Conference"
              ]
            }
          },
          {
            "id": 4,
            "type": "table",
            "name": "Payment Schedule",
            "value" : [
              {
                "row_id": 0,
                "cells": [
                  {
                    "id": 9,
                    "type": "date",
                    "name": "Date",
                    "value": "2017-08-26",
                    "parent_id": 4,
                    "row_id": 0
                  },
                  {
                    "id": 6,
                    "type": "money",
                    "name": "Amount",
                    "value": 10000,
                    "parent_id": 4,
                    "row_id": 0
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

curl

curl -X POST \
  https://api.pyrus.com/v4/tasks/ \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "form_id": 1345,
  "fields": [
    {
      "id": 1,
      "value": "IT conference in Amsterdam"
    },
    {
      "code": "TicketPrice",
      "value": 10306.25
    },
    {
      "id": 3,
      "value": {
        "item_id": 845
      }
    },
    {
      "id": 4,
      "value": [
        {
          "row_id": 0,
          "cells": [
            {
              "id": 6,
              "value": "2017-08-26"
            },
            {
              "id": 9,
              "value": 10000
            }
          ]
        }
      ]
    },
    {
      "name": "Comment",
      "value": "Additional information about choice"
    }
  ]
}'

Parameters

NameDescriptionSimple taskForm task
text *Text of the task.
responsibleId or email of the person responsible for the task.
due_dateThe task due date. Date format: YYYY-MM-DD
dueTask due date with time (either due_date or due can be used). Date format: YYYY-MM-DDThh:mm:ssZ.
durationThe duration of the event in minutes (it can only be used with due or due_date).
subjectTask subject. If not filled out, the first line of the task text will be used as the subject.
participantsAn array of people's id or email.
subscribersAn array of subscriber's and their decisions. Subscriber is a person receiving notification on task changes in their Inbox.
parent_task_id

attachments**

Two formats are supported for file information:

Option 1: An array of strings, each of which can be:

  • guid of an uploaded file. You can upload the file and get its identifier using the files/upload method.
  • id of a file already attached to a task.
  • url of a file already attached to a task (you can also specify a URL of an arbitrary file from the web, but in this case you cannot specify a link name for it).

Option 2: An array of objects that can contain the following fields:

  • guid — unique identifier of the uploaded file.

  • root_id — ID of an already attached file for creating a new version (optional). or

  • attachment_id — ID of a file already attached to a task. or

  • url — URL of a file already attached to a task, or URL of an arbitrary file from the web (in this case you should specify name).

  • name — the name that will be displayed for the link (optional; ignored for Pyrus file URLs).

scheduled_dateSchedule a task on a specified date. Task will be returned to the inbox at 7 am in the client's timezone. Date format: YYYY-MM-DD.
scheduled_datetime_utcSchedule a task for a specified time in the utc time zone. Date format: YYYY-MM-DDThh:mm:ssZ
list_idsAn array of list identifiers.
approvalsAn array of approval steps that contains an array of people's id or email.
form_id *Form template identifier.
fieldsAn array of field values. Every field contains an id (or name, or code) and value. You can find additional information about field types in the Form fields format section.
fill_defaultsThe flag indicating whether the form fields should be filled with default values from the form template. By default: false

formatted_text

Comment text containing HTML formatting. Allowed HTML tags:

  • <i>text</i> — italic;
  • <br/> — line break;
  • <code>text</code> — code;
  • <b>text</b> — bold;
  • <s>text</s> — strikethrough;
  • <div data-type=\"heading\">text</div> — heading;
  • <q>text</q> — quote;
  • <mark data-color=\"red\">text</mark> — red color;
  • <mark data-color=\"yellow\">text</mark> — yellow color;
  • <mark data-color=\"green\">text</mark> — green color;
  • <mark data-color=\"blue\">text</mark> — blue color;
  • <ul><li>text1</li><li>text2</li></ul> — bulleted list;
  • <ol><li>text1</li><li>text2</li></ol> — numbered list;
  • <a href="url">text</a> — hyperlink;
  • <button>text</button> — button.

* Required field.

** A file guid can only be used once (it cannot be passed twice within a single request). When re-attaching files to a task, new attached files will be created.

POST /tasks/{task-id}/comments

Adding a task comment. This method returns a task with all comments, including the added one.

POST https://api.pyrus.com/v4/tasks/11613/comments

Request body

{
  "text": "It's done.",
  "action": "finished"
}

Response body

{
  "task": {
    "id": 11613,
    "text": "Payments",
    "create_date": "2017-08-17T14:31:18Z",
    "last_modified_date": "2017-08-18T10:02:23Z",
    "author": {
      "id": 1731,
      "first_name": "Bob",
      "last_name": "Smith",
      "email": "Bob.Smith@gmail.com",
      "type": "user"
    },
    "form_id": 1345,
    "approvals": [
      [
        {
          "person": {
            "id": 1733,
            "first_name": "John",
            "last_name": "Snow",
            "email": "John.Snow@gmail.com",
            "type": "user"
          },
          "approval_choice": "waiting"
        }
      ],
      [
        {
          "person": {
            "id": 1731,
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "Bob.Smith@gmail.com",
            "type": "user"
          },
          "approval_choice": "waiting"
        }
      ]
    ],
    "fields": [
      {
        "id": 1,
        "type": "text",
        "name": "Purpose",
        "value": "IT conference in Amsterdam"
      },
      {
        "id": 2,
        "type": "money",
        "name": "Amount",
        "value": 10306.25
      },
      {
        "id": 3,
        "type": "catalog",
        "name": "Payment type",
        "value": {
          "item_id": 845,
          "headers": [
            "Payment types"
          ],
          "values": [
            "IT Conference"
          ]
        }
      },
      {
        "id": 4,
        "type": "table",
        "name": "Payment Schedule",
        "value": [
          {
            "row_id": 0,
            "cells": [
              {
                "id": 9,
                "type": "date",
                "name": "Date",
                "value": "2017-08-26",
                "parent_id": 4,
                "row_id": 0
              },
              {
                "id": 6,
                "type": "money",
                "name": "Amount",
                "value": 10000,
                "parent_id": 4,
                "row_id": 0
              }
            ]
          },
          {
            "row_id": 1,
            "cells": [
              {
                "id": 9,
                "type": "date",
                "name": "Date",
                "value": "2017-08-27",
                "parent_id": 4,
                "row_id": 1
              },
              {
                "id": 6,
                "type": "money",
                "name": "Amount",
                "value": 306.25,
                "parent_id": 4,
                "row_id": 1
              }
            ]
          }
        ]
      }
    ],
    "comments": [
      {
        "id": 13767,
        "create_date": "2017-08-17T14:31:18Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "reassigned_to": {
          "id": 1730,
          "first_name": "John",
          "last_name": "Snow",
          "email": "John.Snow@gmail.com",
          "type": "user"
        },
        "approvals_added": [
          [
            {
              "person": {
                "id": 1733,
                "first_name": "John",
                "last_name": "Snow",
                "email": "John.Snow@gmail.com",
                "type": "user"
              },
              "step": 1
            },
            {
              "person": {
                "id": 1725,
                "first_name": "Jane",
                "last_name": "Doe",
                "email": "Jane.Doe@gmail.com",
                "type": "user"
              },
              "step": 1
            }
          ],
          [
            {
              "person": {
                "id": 1731,
                "first_name": "Bob",
                "last_name": "Smith",
                "email": "Bob.Smith@gmail.com",
                "type": "user"
              },
              "step": 2
            }
          ]
        ],
        "field_updates": [
          {
            "id": 1,
            "type": "text",
            "name": "Purpose",
            "text": "IT conference in Amsterdam"
          },
          {
            "id": 2,
            "type": "money",
            "name": "Amount",
            "number": 10306.25
          },
          {
            "id": 3,
            "type": "catalog",
            "name": "Payment type",
            "value": {
              "item_id": 845,
              "headers": [
                "Payment types"
              ],
              "values": [
                "IT Conference"
              ]
            }
          },
          {
            "id": 4,
            "type": "table",
            "name": "Payment Schedule",
            "value": [
              {
                "row_id": 0,
                "cells": [
                  {
                    "id": 9,
                    "type": "date",
                    "name": "Date",
                    "value": "2017-08-26",
                    "parent_id": 4,
                    "row_id": 0
                  },
                  {
                    "id": 6,
                    "type": "money",
                    "name": "Amount",
                    "value": 10000,
                    "parent_id": 4,
                    "row_id": 0
                  }
                ]
              },
              {
                "row_id": 1,
                "cells": [
                  {
                    "id": 9,
                    "type": "date",
                    "name": "Date",
                    "value": "2017-08-27",
                    "parent_id": 4,
                    "row_id": 1
                  },
                  {
                    "id": 6,
                    "type": "money",
                    "name": "Amount",
                    "value": 306.25,
                    "parent_id": 4,
                    "row_id": 1
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 13768,
        "create_date": "2017-08-18T10:00:11Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "text": "",
        "approvals_removed": [
          [{
            "id": 1725,
            "first_name": "Jane",
            "last_name": "Doe",
            "email": "Jane.Doe@gmail.com",
            "type": "user"
          },
          "step": 1
          ]
        ]
      },
      {
        "id": 13768,
        "create_date": "2017-08-18T10:02:23Z",
        "author": {
          "id": 1731,
          "first_name": "Bob",
          "last_name": "Smith",
          "email": "Bob.Smith@gmail.com",
          "type": "user"
        },
        "text": "It's done.",
        "action": "finished"
      }
    ]
  }
}

curl

curl -X POST \
  https://api.pyrus.com/v4/tasks/11613/comments \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "It's done.",
  "action": "finished"
}'

Parameters

At least one of the fields below must be filled in the task comment. Only the values of the fields that you have passed in the request will be updated.

textComment text.

formatted_text

Comment text containing HTML formatting. Allowed HTML tags:

  • <i>text</i> — italic;
  • <br/> — line break;
  • <code>text</code> — code;
  • <b>text</b> — bold;
  • <s>text</s> — strikethrough;
  • <div data-type=\"heading\">text</div> — heading;
  • <q>text</q> — quote;
  • <mark data-color=\"red\">text</mark> — red color;
  • <mark data-color=\"yellow\">text</mark> — yellow color;
  • <mark data-color=\"green\">text</mark> — green color;
  • <mark data-color=\"blue\">text</mark> — blue color;
  • <ul><li>text1</li><li>text2</li></ul> — bulleted list;
  • <ol><li>text1</li><li>text2</li></ol> — numbered list;
  • <a href="url">text</a> — hyperlink;
  • <button>text</button> — button.
subjectTask subject. Applicable only for a simple task.
edit_comment_idEdit an existing comment. An optional parameter, the integer id of an existing comment that needs to be edited.
due_dateThe task due date. Date format: YYYY-MM-DD.
dueThe task due date with time. Date format: YYYY-MM-DDThh:mm:ssZ.
durationThe duration of the event in minutes (it can only be used with due or due_date).
cancel_dueCancel deadline (due_date, due and duration will be removed).
action
  • finished — close task
  • reopened — reopen task
approval_choice
  • approved — to approve
  • acknowledged — to mark that the task was viewed
  • rejected — to reject
  • revoked — to revoke your agreement
reassign_toId or email of a new responsible person.

approvals_added

An array of approval steps that contains an array of people's id or email. Applicable only for a form task.For example:

"approvals_added": [
  [
    {
      "id": 1234
    }
  ],
  [],
  [
    {
      "id": 4321
    }
  ]
]
approvals_removed*An array of approval steps that contains an array of people's id or email. Applicable only for a form task.
approvals_rerequestedAn array of approval steps that contains an array of people's id or email. Applicable only for a form task.
subscribers_addedAn array of people's id or email.
subscribers_removedAn array of people's id or email.
subscribers_rerequestedAn array of people's id or email.
participants_addedAn array of people's id or email. Applicable only for a simple task.
participants_removedAn array of people's id or email. Applicable only for a simple task.
field_updatesAn array of new form values. Every value includes a field's id and value. You can find additional information about the field types in the Form fields format section.

attachments

Two formats are supported for file information:

Option 1: An array of strings, each of which can be:

  • guid of an uploaded file. You can upload the file and get its identifier using the files/upload method.

  • id of a file already attached to a task.

  • url of a file already attached to a task (you can also specify a URL of an arbitrary file from the web, but in this case you cannot specify a link name for it).

    Option 2: An array of objects that can contain the following fields:

  • guid — unique identifier of the uploaded file.

  • root_id — ID of an already attached file for creating a new version (optional). or

  • attachment_id — ID of a file already attached to a task. or

  • url — URL of a file already attached to a task, or URL of an arbitrary file from the web (in this case you should specify name).

  • name — the name that will be displayed for the link (optional; ignored for Pyrus file URLs).

added_list_idsAn array of identifiers of lists to which you want to add the task.
removed_list_idsAn array of identifiers of lists from which you want to remove the task.
scheduled_dateSchedule a task on a specified date. Task will be returned to the inbox at 7 am in the client's timezone. Date Format: YYYY-MM-DD.
scheduled_datetime_utcSchedule a task for a specified time in the utc time zone. Date format: YYYY-MM-DDThh:mm:ssZ
cancel_scheduleCancel schedule. Task will be returned to the inbox.

channel

The comment will be sent via the external channel. Applicable only for a form task.

Possible type values: email, telegram, viber, private_channel, whats_app, web_widget, mobile_app, avito_job, avito_messenger.

"channel": { "type": "email" }
spent_minutesTime spent in minutes.
skip_satisfactionDo not ask for client feedback to rate service quality upon completing a request.
skip_notificationEnables you to comment on a task without notifying the participants. Your comment will not be marked unread.
skip_auto_reopenControls whether a finished task will be reopened. Can be false (the default, including if the parameter is not specified) or true:
  • skip_auto_reopen=true — a finished task will not be reopened;
  • skip_auto_reopen=false — a finished task will be reopened.

* If approvers have been added to a task through the form routing settings, they cannot be removed. If an approver is added to an already created form task, they can be removed.

DELETE /tasks/{task-id}

Deleting a task

This method returns a confirmation of task deletion.

DELETE https://api.pyrus.com/v4/tasks/11611 

Response body

{
   "deleted": true
}

curl

curl -X DELETE \
 'https://api.pyrus.com/v4/tasks/11613' \
 -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
 -H 'Content-Type: application/json'

{

Was this article helpful?