Announcements

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

Endpoints

GET
POST
GET
GET

List all announcements

Required API key scopes

customer_analytics:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"message": "string",
"status": "pending",
"send_as": "bot",
"sender_display_name": "string",
"total_channels": 0,
"sent_count": 0,
"failed_count": 0,
"sent_at": "2019-08-24T14:15:22Z",
"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"
},
"deliveries": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"slack_channel_id": "string",
"slack_channel_name": "string",
"status": "pending",
"error": "string",
"slack_message_ts": "string",
"sent_at": "2019-08-24T14:15:22Z"
}
],
"channels": [
"string"
]
}
]
}

Create announcements

Required API key scopes

customer_analytics:write

Request parameters

  • message
    string
  • send_as
    Default: bot
  • channels
    array

Response


Example request

POST /api/projects/:project_id/announcements
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/announcements/\
-d message="string",\
-d channels="array"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"message": "string",
"status": "pending",
"send_as": "bot",
"sender_display_name": "string",
"total_channels": 0,
"sent_count": 0,
"failed_count": 0,
"sent_at": "2019-08-24T14:15:22Z",
"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"
},
"deliveries": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"slack_channel_id": "string",
"slack_channel_name": "string",
"status": "pending",
"error": "string",
"slack_message_ts": "string",
"sent_at": "2019-08-24T14:15:22Z"
}
],
"channels": [
"string"
]
}

Retrieve announcements

Required API key scopes

customer_analytics:read

Path parameters

  • short_id
    string

Response


Example request

GET /api/projects/:project_id/announcements/: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/announcements/:short_id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"message": "string",
"status": "pending",
"send_as": "bot",
"sender_display_name": "string",
"total_channels": 0,
"sent_count": 0,
"failed_count": 0,
"sent_at": "2019-08-24T14:15:22Z",
"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"
},
"deliveries": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"slack_channel_id": "string",
"slack_channel_name": "string",
"status": "pending",
"error": "string",
"slack_message_ts": "string",
"sent_at": "2019-08-24T14:15:22Z"
}
],
"channels": [
"string"
]
}

List all announcements channels

Slack channels the SupportHog bot can post to, labeled by customer account name.

Example request

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

Example response

Status 200
RESPONSE
{
"id": "string",
"name": "string",
"is_member": true,
"customer_name": "string"
}