Messaging Provider

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

Endpoints

GET
POST
GET
GET

List all messaging provider imports

Background imports from other messaging tools, such as Customer.io and Resend suppressions and unsubscribes.

A run executes outside the request, so a long provider list does not time out. Poll a run to show its progress.

Required API key scopes

hog_flow:read

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "customerio",
"status": "queued",
"steps": [
{
"key": "string",
"label": "string",
"status": "pending",
"processed": 0,
"imported": 0,
"warnings": [
"string"
],
"last_error": "string",
"counts": [
{
"key": "string",
"label": "string",
"value": 0
}
],
"items": [
{
"label": "string",
"status": "created",
"url": "string",
"notes": [
"string"
]
}
],
"warnings_omitted": 0,
"items_omitted": 0
}
],
"created_at": "2019-08-24T14:15:22Z",
"started_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z"
}

Create messaging provider imports

Background imports from other messaging tools, such as Customer.io and Resend suppressions and unsubscribes.

A run executes outside the request, so a long provider list does not time out. Poll a run to show its progress.

Required API key scopes

hog_flow:write

Request parameters

  • provider
  • steps
    array
  • api_key
    string

Response


Example request

POST /api/projects/:project_id/messaging_provider_imports
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/messaging_provider_imports/\
-d provider=undefined,\
-d steps="array"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "customerio",
"status": "queued",
"steps": [
{
"key": "string",
"label": "string",
"status": "pending",
"processed": 0,
"imported": 0,
"warnings": [
"string"
],
"last_error": "string",
"counts": [
{
"key": "string",
"label": "string",
"value": 0
}
],
"items": [
{
"label": "string",
"status": "created",
"url": "string",
"notes": [
"string"
]
}
],
"warnings_omitted": 0,
"items_omitted": 0
}
],
"created_at": "2019-08-24T14:15:22Z",
"started_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z"
}
Status 400 The provider or a step is unknown, or the API key is missing or rejected.
Status 409 An import from this provider is running, or a different key is stored.
Status 503 The provider did not respond while checking the API key.

Retrieve messaging provider imports

Background imports from other messaging tools, such as Customer.io and Resend suppressions and unsubscribes.

A run executes outside the request, so a long provider list does not time out. Poll a run to show its progress.

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/messaging_provider_imports/: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/messaging_provider_imports/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "customerio",
"status": "queued",
"steps": [
{
"key": "string",
"label": "string",
"status": "pending",
"processed": 0,
"imported": 0,
"warnings": [
"string"
],
"last_error": "string",
"counts": [
{
"key": "string",
"label": "string",
"value": 0
}
],
"items": [
{
"label": "string",
"status": "created",
"url": "string",
"notes": [
"string"
]
}
],
"warnings_omitted": 0,
"items_omitted": 0
}
],
"created_at": "2019-08-24T14:15:22Z",
"started_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z"
}

List all messaging provider imports providers

Background imports from other messaging tools, such as Customer.io and Resend suppressions and unsubscribes.

A run executes outside the request, so a long provider list does not time out. Poll a run to show its progress.

Required API key scopes

hog_flow:read

Example request

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

Example response

Status 200
RESPONSE
{
"key": "customerio",
"label": "string",
"steps": [
{
"key": "string",
"label": "string",
"description": "string"
}
],
"retains_credentials": true,
"api_key_label": "string",
"api_key_help": "string",
"api_key_url": "http://example.com",
"not_imported": "string",
"next_steps": [
"string"
]
}