Tasks

Get all tasks

GET /tasks

Query string parameters

  • show string
    • completed, overdue, pending or later
    • Will be overwritten if start_date or end_date used
  • start_date date - Only show tasks after this date
    • Y-m-d H:i:s format
  • end_date date - Only show tasks before this date
    • Y-m-d H:i:s format
    • Must be after start_date
  • relations_paths UUID - Only show tasks with one of these relations path ids (comma separated)
  • users integer - Comma separated list of ids.
  • teams integer - Comma separated list of ids.
  • types string - Comma separated list of types.
    • email, call, meeting, remind_me, letter
  • relations_path_id UUID - Comma separated list of ids.
  • include_external boolean - If set to true, the response includes external tasks
    • default: false
  • Supports Searching
  • Supports Pagination

Deprecated parameters

  • relations_path deprecated in favor of relations_paths
    • Removal: 2018/04/01
  • type deprecated in favor of types
    • Removal: 2018/04/01

Response
Status code 200

{
  "data": [
    {
      "id": "5b0601ef-6005-414c-9132-0d735bc738b8",
      "type": "meeting",
      "case": {
        "id": "045c9c3b-8761-3523-8f33-6c6020768dc8",
        "case_number": 3
      },
      "activity_id": "3b646013-a0ab-49cd-8bf0-d1b4dd26c64e",
      "account": {
        "id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
        "name": "Some account"
      },
      "contact": {
        "id": "068c7b4e-0bf5-3b97-9978-2be606e83df2",
        "name": "Some contact"
      },
      "team": {
        "id": 1,
        "name": "Team 1",
        "address_1": "Savannah 123",
        "address_2": "Under the tree on the left",
        "zip_code": "4730",
        "city": "Umzimkulu",
        "state": "KwaZulu-Natal",
        "country": null,
        "phone_number": "031 308 7900",
        "website": "https:\/\/easir.com",
        "vat": "1234567890123456",
        "team_type": null,
        "group_id": 1,
        "use_social_lookup": false,
        "created_at": "2014-01-01 12:45:56",
        "updated_at": "2014-01-02 00:11:22"
      },
      "user": {
        "id": 1,
        "first_name": "Jane",
        "last_name": "Doe",
        "phone_number": "+4588888888",
        "job_title": "Sales Executive",
        "email": "demo@easir.com",
        "email_notifications": false,
        "profile_picture": "https:\/\/randomuser.me\/api\/portraits\/thumb\/women\/5.jpg",
        "system_user": false,
        "created_at": "2014-01-01 12:45:56",
        "updated_at": "2017-08-01 13:36:26"
      },
      "next_activity": {
        "id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
        "name": "Contract"
      },
      "status": "pending",
      "start_at": "2015-03-26 12:00:00",
      "end_at": "2015-03-26 13:30:00",
      "completed_at": null,
      "created_at": "2015-03-26 12:23:45",
      "updated_at": "2015-03-26 12:23:45"
    },
    {
      "id": "3cb87c2f-6005-414c-9132-f5a56f0615f6",
      "user": {
        "id": 1,
        "first_name": "Jane",
        "last_name": "Doe",
        "phone_number": "+4588888888",
        "job_title": "Sales Executive",
        "email": "demo@easir.com",
        "email_notifications": false,
        "profile_picture": "https:\/\/randomuser.me\/api\/portraits\/thumb\/women\/5.jpg",
        "system_user": false,
        "created_at": "2014-01-01 12:45:56",
        "updated_at": "2017-08-01 13:36:26"
      },
      "title": "Shopping",
      "source": "my source",
      "start_at": "2018-07-04 12:05:00",
      "end_at": "2018-07-04 12:10:00",
      "created_at": "2018-02-19 16:27:26",
      "updated_at": "2018-02-19 16:27:26"
    }
  ],
  "pagination": {
    "total": 20,
    "page": 1,
    "per_page": 15,
    "urls": {
      "previous": null,
      "next": "http://api.easir.com/tasks/?page=2"
    }
  },
  "current_status": {
      "overdue": 100,
      "later": 0,
      "pending": 0,
      "completed": 100
  }
}

Get a task

GET /tasks/:task_id

Response
Status code 200

{
  "id": "5b0601ef-6005-414c-9132-0d735bc738b8",
  "type": "meeting",
  "case": {
    "id": "218f158d-c063-3815-8573-880aca0a4566",
    "case_number": 688,
    "status": "declined",
    "account": {
      "id": "b3be1219-2f58-31db-aba1-ea84f5ef25de",
      "b2c": false,
      "user": {
        "id": 14,
        "first_name": "Yasmine",
        "last_name": "Nader",
        "phone_number": "817-100-8292x3752",
        "job_title": "Director of Research",
        "email": "notifications@example.com",
        "email_notifications": false,
        "profile_picture": null,
        "created_at": "2016-07-21 09:33:37",
        "updated_at": "2016-07-25 08:03:16"
      },
      "team_id": 1,
      "fixed_fields": [
        {
          "id": 1,
          "type": "text",
          "name": "name",
          "label": "Name",
          "value": "Elkjær K/S",
          "validation": null,
          "required": true,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 2,
          "type": "text",
          "name": "address",
          "label": "Address",
          "value": "Kjeldgaardshaven 9P, 8. tv.\n5345 Toreby",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 3,
          "type": "text",
          "name": "zip_code",
          "label": "Zip code",
          "value": 5640,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 4,
          "type": "text",
          "name": "city",
          "label": "City",
          "value": "Allerød",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 5,
          "type": "text",
          "name": "state_region",
          "label": "State/Region",
          "value": "Roskilde",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 6,
          "type": "single_choice",
          "name": "country",
          "label": "Country",
          "value": {
            "id": 93,
            "value": "CM"
          },
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 7,
          "type": "text",
          "name": "vat",
          "label": "VAT",
          "value": 12437647429,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 8,
          "type": "text",
          "name": "website",
          "label": "Website",
          "value": "http://Laursen.org/quis-debitis-aperiam-ut-rerum.html",
          "validation": "url",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        }
      ],
      "custom_fields": [
        {
          "id": 6,
          "type": "multiple_choice",
          "name": "multiple_choice",
          "label": "Custom Multiple Choice",
          "value": null,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 13
        },
        {
          "id": 5,
          "type": "single_choice",
          "name": "single_choice",
          "label": "Custom Single Choice",
          "value": null,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 14
        },
        {
          "id": 4,
          "type": "boolean",
          "name": "boolean",
          "label": "Custom Boolean",
          "value": null,
          "validation": "boolean",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 15
        },
        {
          "id": 3,
          "type": "date",
          "name": "date",
          "label": "Custom Date",
          "value": null,
          "validation": "date",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 16
        },
        {
          "id": 2,
          "type": "numeric",
          "name": "number",
          "label": "Custom Number",
          "value": null,
          "validation": "numeric",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 17
        },
        {
          "id": 1,
          "type": "text",
          "name": "email",
          "label": "Custom E-mail",
          "value": null,
          "validation": "email",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 18
        }
      ],
      "created_at": "2015-02-24 12:34:56",
      "updated_at": "2015-02-24 12:34:56",
      "latest_activity_at": null
    },
    "contact": {
      "id": "cec88fc8-2c87-34fb-9598-eeed4d002abb",
      "b2c": false,
      "account": {
        "id": "b3be1219-2f58-31db-aba1-ea84f5ef25de",
        "name": "Elkjær K/S"
      },
      "user": {
        "id": 16,
        "first_name": "Ivy",
        "last_name": "Runolfsson",
        "phone_number": "+37(4)1811609581",
        "job_title": "Director of Research",
        "email": "14@example.com",
        "email_notifications": false,
        "profile_picture": "http://lerablog.org/wp-content/uploads/2014/05/Smiling-man-on-Shutterstock1.jpg",
        "created_at": "2016-03-01 01:39:25",
        "updated_at": "2016-03-09 07:48:29"
      },
      "team_id": 1,
      "status": "opportunity",
      "fixed_fields": [
        {
          "id": 10,
          "type": "text",
          "name": "salutation",
          "label": "Salutation",
          "value": "Mr.",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 11,
          "type": "text",
          "name": "first_name",
          "label": "First name",
          "value": "Thomas",
          "validation": null,
          "required": true,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 12,
          "type": "text",
          "name": "last_name",
          "label": "Last name",
          "value": "Willumsen",
          "validation": null,
          "required": true,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 13,
          "type": "text",
          "name": "email",
          "label": "Email",
          "value": "Skriver.Lilli@example.com",
          "validation": "email",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 14,
          "type": "text",
          "name": "phone_number",
          "label": "Phone number",
          "value": "+4571362699",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        },
        {
          "id": 16,
          "type": "text",
          "name": "title",
          "label": "Title",
          "value": "Sales supervisor",
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 0
        }
      ],
      "custom_fields": [
        {
          "id": 12,
          "type": "multiple_choice",
          "name": "multiple_choice",
          "label": "Custom Multiple Choice",
          "value": null,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 7,
          "options": [
            {
              "id": 1010,
              "value": "Option 1"
            },
            {
              "id": 1011,
              "value": "Option 2"
            },
            {
              "id": 1012,
              "value": "Option 3"
            },
            {
              "id": 1013,
              "value": "Option 4"
            },
            {
              "id": 1014,
              "value": "Option 5"
            }
          ]
        },
        {
          "id": 11,
          "type": "single_choice",
          "name": "single_choice",
          "label": "Custom Single Choice",
          "value": null,
          "validation": null,
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 8,
          "options": [
            {
              "id": 1007,
              "value": "Option 1"
            },
            {
              "id": 1008,
              "value": "Option 2"
            },
            {
              "id": 1009,
              "value": "Option 3"
            }
          ]
        },
        {
          "id": 10,
          "type": "date",
          "name": "date",
          "label": "Custom Date",
          "value": null,
          "validation": "date",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 9
        },
        {
          "id": 9,
          "type": "numeric",
          "name": "number",
          "label": "Custom Number",
          "value": null,
          "validation": "numeric",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 10
        },
        {
          "id": 8,
          "type": "text",
          "name": "email",
          "label": "Custom E-mail",
          "value": null,
          "validation": "email",
          "required": false,
          "hidden": false,
          "read_only": false,
          "sort_order": 11
        }
      ],
      "created_at": "2015-02-24 12:34:56",
      "updated_at": "2015-02-24 12:34:56",
      "latest_activity_at": null,
      "social_profile": null
    },
    "user": {
      "id": 22,
      "first_name": "Augustus",
      "last_name": "Rau",
      "phone_number": "(099)654-5421x16029",
      "job_title": "Data Analytics Consultant",
      "email": "20@example.com",
      "email_notifications": false,
      "profile_picture": "http://lerablog.org/wp-content/uploads/2014/05/Smiling-man-on-Shutterstock1.jpg",
      "created_at": "2016-07-11 01:29:40",
      "updated_at": "2016-08-03 03:29:04"
    },
    "relations_path": {
      "id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
      "name": "lacinia malesuada",
      "is_sales_type": true
    },
    "product_details": null,
    "tasks": null,
    "attachments": null,
    "lead": null,
    "chance_of_success": 76,
    "milestones": [
      {
        "id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
        "name": "Contract",
        "done": true
      },
      {
        "id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
        "name": "Milestone 2",
        "done": false
      }
    ],
    "latest_activity_at": "2016-08-08 11:19:55",
    "estimated_close_date": "2016-11-12",
    "created_at": "2015-02-24 12:34:56",
    "updated_at": "2015-02-24 12:34:56"
  },
  "activity_id": "3b646013-a0ab-49cd-8bf0-d1b4dd26c64e",
  "account": {
    "id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
    "name": "Some account"
  },
  "contact": {
    "id": "068c7b4e-0bf5-3b97-9978-2be606e83df2",
    "name": "Some contact"
  },
  "team": {
    "id": 1,
    "name": "Team 1",
    "address_1": "Savannah 123",
    "address_2": "Under the tree on the left",
    "zip_code": "4730",
    "city": "Umzimkulu",
    "state": "KwaZulu-Natal",
    "country": null,
    "phone_number": "031 308 7900",
    "website": "https://easir.com",
    "vat": "1234567890123456",
    "team_type": null,
    "group_id": 1,
    "use_social_lookup": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2014-01-02 00:11:22"
  },
  "user": {
    "id": 1,
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "+4588888888",
    "job_title": "Sales Executive",
    "email": "demo@easir.com",
    "email_notifications": false,
    "profile_picture": "https://randomuser.me/api/portraits/thumb/women/5.jpg",
    "system_user": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2017-08-01 13:36:26"
  },
  "next_activity": {
    "id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
    "name": "Contract"
  },
  "status": "pending",
  "start_at": "2015-03-26 12:00:00",
  "end_at": "2015-03-26 13:30:00",
  "completed_at": null,
  "created_at": "2015-03-26 12:23:45",
  "updated_at": "2015-03-26 12:23:45"
}

Update a task

PUT /tasks/:task_id

Parameters

  • start_date date - Only show tasks after this date
    • Y-m-d H:i:s format
  • end_date date - Only show tasks before this date
    • Y-m-d H:i:s format
    • Must be after start_date
  • type string
    • email, call, meeting or remind_me
    • Required
  • next_activity_id uuid
  • user_id integer - If the assigned user is not the logged in user.

Payload

{
  "start_at": "2015-12-12 00:00:00",
  "end_at": "2015-12-12 23:59:59",
  "type": "email"
}

Response
Status code 200

{
  "id": "5b0601ef-6005-414c-9132-0d735bc738b8",
  "type": "meeting",
  "case": {
    "id": "045c9c3b-8761-3523-8f33-6c6020768dc8",
    "case_number": 3
  },
  "activity_id": "3b646013-a0ab-49cd-8bf0-d1b4dd26c64e",
  "account": {
    "id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
    "name": "Some account"
  },
  "contact": {
    "id": "068c7b4e-0bf5-3b97-9978-2be606e83df2",
    "name": "Some contact"
  },
  "team": {
    "id": 1,
    "name": "Team 1",
    "address_1": "Savannah 123",
    "address_2": "Under the tree on the left",
    "zip_code": "4730",
    "city": "Umzimkulu",
    "state": "KwaZulu-Natal",
    "country": null,
    "phone_number": "031 308 7900",
    "website": "https://easir.com",
    "vat": "1234567890123456",
    "team_type": null,
    "group_id": 1,
    "use_social_lookup": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2014-01-02 00:11:22"
  },
  "user": {
    "id": 1,
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "+4588888888",
    "job_title": "Sales Executive",
    "email": "demo@easir.com",
    "email_notifications": false,
    "profile_picture": "https://randomuser.me/api/portraits/thumb/women/5.jpg",
    "system_user": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2017-08-01 13:36:26"
  },
  "next_activity": {
    "id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
    "name": "Contract"
  },
  "status": "pending",
  "start_at": "2022-04-24 12:34:56",
  "end_at": "2022-05-24 12:34:57",
  "completed_at": null,
  "created_at": "2015-03-26 12:23:45",
  "updated_at": "2015-03-26 12:23:45"
}

Delete a task

DELETE /tasks/:task_id

Response
Status code 204

Creating an external task

POST /tasks/external

Creates an external task which is read-only (cannot be completed).

Parameters

  • title string
    • Required
  • user_id integer
    • Required
  • source string
    • Required
  • start_at date
    • Required
    • Y-m-d H:i:s format
    • Must be before end_at
  • end_at date
    • Required
    • Y-m-d H:i:s format
    • Must be after start_at

Payload

{
  "user_id": 1,
  "title": "Shopping",
  "source": "my source",
  "start_at": "2018-07-04 12:05:00",
  "end_at": "2018-07-04 12:10:00"
}    

Response
Status code 201

{
  "id": "3cb87c2f-6005-414c-9132-f5a56f0615f6",
  "user": {
    "id": 1,
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "+4588888888",
    "job_title": "Sales Executive",
    "email": "demo@easir.com",
    "email_notifications": false,
    "profile_picture": "https:\/\/randomuser.me\/api\/portraits\/thumb\/women\/5.jpg",
    "system_user": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2017-08-01 13:36:26"
  },
  "title": "Shopping",
  "source": "my source",
  "start_at": "2018-07-04 12:05:00",
  "end_at": "2018-07-04 12:10:00",
  "created_at": "2018-02-19 16:27:26",
  "updated_at": "2018-02-19 16:27:26"
}    

### Update an external task

PUT /tasks/external/:task_id

Updates an external task.

Parameters

  • title string
    • Required
  • user_id integer
    • Required
  • source string
    • Required
  • start_at date
    • Required
    • Y-m-d H:i:s format
    • Must be before end_at
  • end_at date
    • Required
    • Y-m-d H:i:s format
    • Must be after start_at

Payload

{
  "user_id": 1,
  "title": "Car service",
  "source": "my source",
  "start_at": "2018-07-04 12:05:00",
  "end_at": "2018-07-04 12:10:00"
}    

Response
Status code 200

{
  "id": "3cb87c2f-6005-414c-9132-f5a56f0615f6",
  "user": {
    "id": 1,
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "+4588888888",
    "job_title": "Sales Executive",
    "email": "demo@easir.com",
    "email_notifications": false,
    "profile_picture": "https:\/\/randomuser.me\/api\/portraits\/thumb\/women\/5.jpg",
    "system_user": false,
    "created_at": "2014-01-01 12:45:56",
    "updated_at": "2017-08-01 13:36:26"
  },
  "title": "Car service",
  "source": "my source",
  "start_at": "2018-07-04 12:05:00",
  "end_at": "2018-07-04 12:10:00",
  "created_at": "2018-02-19 16:27:26",
  "updated_at": "2018-02-19 16:27:26"
}    

Delete an external task

DELETE /tasks/external/:task_id

Response
Status code 204

Create a task ical token

POST /tasks/ical-token

Tokens are unique for each user. If a token already exist for the user, it will be replaced with a new token.

Response
Status code 201

{
  "token": "6603419e-1ec0-416e-a18f-951121c6d6fe"
}

Get a task ical token

GET /tasks/ical-token

Response
Status code 200

{
  "token": "6603419e-1ec0-416e-a18f-951121c6d6fe"
}

Get tasks in ical format

GET /tasks/ical/:token

Response
Status code 200

This will download a calendar.ics-file with tasks belonging to the user owning the token.