Conversations

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

Endpoints

GET
GET
POST
GET
DELETE

Retrieve conversations tickets unread count

Get total unread ticket count for the team.

Returns the sum of unread_team_count for all non-resolved tickets. Cached in Redis for 30 seconds, invalidated on changes.

Required API key scopes

ticket:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"ticket_number": 0,
"channel_source": "widget",
"channel_detail": "slack_channel_message",
"distinct_id": "string",
"status": "new",
"priority": "low",
"assignee": {
"id": "string",
"type": "string",
"user": {
"property1": "string",
"property2": "string"
},
"role": {
"property1": "string",
"property2": "string"
}
},
"anonymous_traits": null,
"identity_verified": true,
"ai_resolved": true,
"escalation_reason": "string",
"ai_triage": null,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"message_count": 0,
"last_message_at": "2019-08-24T14:15:22Z",
"last_message_text": "string",
"unread_team_count": 0,
"unread_customer_count": 0,
"session_id": "string",
"session_context": null,
"sla_due_at": "2019-08-24T14:15:22Z",
"snoozed_until": "2019-08-24T14:15:22Z",
"slack_channel_id": "string",
"slack_thread_ts": "string",
"slack_team_id": "string",
"email_subject": "string",
"email_from": "user@example.com",
"email_to": "string",
"cc_participants": null,
"github_repo": "string",
"github_issue_number": 0,
"zendesk_ticket_id": 0,
"organization_id": "string",
"person": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"distinct_ids": [
"string"
],
"properties": {},
"created_at": "2019-08-24T14:15:22Z",
"is_identified": true
},
"tags": [
null
]
}

List all conversations views

Required API key scopes

conversation:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"filters": {},
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
}
}
]
}

Create conversations views

Required API key scopes

conversation:write

Request parameters

  • name
    string
  • filters
    object

Response


Example request

POST /api/projects/:project_id/conversations/views
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/conversations/views/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"filters": {},
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
}
}

Retrieve conversations views

Required API key scopes

conversation:read

Path parameters

  • short_id
    string

Response


Example request

GET /api/projects/:project_id/conversations/views/:short_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/conversations/views/:short_id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"filters": {},
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
}
}

Delete conversations views

Required API key scopes

conversation:write

Path parameters

  • short_id
    string

Example request

DELETE /api/projects/:project_id/conversations/views/:short_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/conversations/views/:short_id/

Example response

Status 204 No response body

Community questions

Questions about this page? or post a community question.