Customer

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
PATCH
GET
POST
POST

List all customer tasks

Required API key scopes

customer_task:read

Query parameters

  • account_id
    string
  • archive_state
    string
    Default: active
    One of: "active""archived""all"
  • assigned_to
    string
  • due_after
    string
  • due_before
    string
  • has_due_at
    boolean
  • limit
    integer
    Default: 50
  • offset
    integer
    Default: 0
  • ordering
    string
    One of: "name""-name""status""-status""assigned_to""-assigned_to""due_at""-due_at""updated_at""-updated_at""account""-account""created_at""-created_at"
  • search
    string
  • statuses
    string

Response


Example request

GET /api/projects/:project_id/customer_tasks
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/

Example response

Status 200
RESPONSE
{
"count": 0,
"next": "http://example.com",
"previous": "http://example.com",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}
]
}

Create customer tasks

Required API key scopes

customer_task:write

Request parameters

  • account_id
    string | null
  • name
    string
  • description
    string | null
  • assigned_to_id
    integer | null
  • due_at
    string | null
  • status
    Default: open

Response


Example request

POST /api/projects/:project_id/customer_tasks
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}

Retrieve customer tasks

Required API key scopes

customer_task:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/customer_tasks/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}
Status 404 Task not found.

Update customer tasks

Required API key scopes

customer_task:write

Path parameters

  • id
    string

Request parameters

  • account_id
    string | null
  • name
    string
  • description
    string | null
  • assigned_to_id
    integer | null
  • due_at
    string | null
  • status

Response


Example request

PATCH /api/projects/:project_id/customer_tasks/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/:id/\
-d account_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}

Retrieve

Required API key scopes

customer_task:read

Path parameters

  • id
    string

Query parameters

  • limit
    integer
    Default: 50
  • offset
    integer
    Default: 0

Response


Example request

GET /api/projects/:project_id/customer_tasks/:id/activities
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/:id/activities/

Example response

Status 200
RESPONSE
{
"count": 0,
"next": "http://example.com",
"previous": "http://example.com",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"activity_type": "created",
"changes": [
{
"field": "string",
"before": "string",
"after": "string"
}
],
"actor": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Create customer tasks archive

Required API key scopes

customer_task:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/customer_tasks/:id/archive
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/:id/archive/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}

Create customer tasks restore

Required API key scopes

customer_task:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/customer_tasks/:id/restore
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/customer_tasks/:id/restore/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"name": "string",
"description": "string",
"status": "open",
"assigned_to": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"due_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"completed_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"created_by": {
"id": 0,
"email": "user@example.com",
"first_name": "string",
"last_name": "string"
},
"archived_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_restore": true
}