Actions

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

List all actions

Path Parameters

  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"
  • limit
    integer
  • offset
    integer

Response


Request

GET /api/projects/:project_id/actions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/

Response

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": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}
]
}

Create actions

Path Parameters

  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Request Parameters

  • name
    string
  • description
    string
  • tags
    array
  • post_to_slack
    boolean
  • slack_message_format
    string
  • steps
    Click to open
    array
  • deleted
    boolean
  • last_calculated_at
    string

Response


Request

POST /api/projects/:project_id/actions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/\
-d name="string"

Response

RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}

Retrieve actions

Path Parameters

  • id
    integer
  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Response


Request

GET /api/projects/:project_id/actions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/:id/

Response

RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}

Update actions

Path Parameters

  • id
    integer
  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Request Parameters

  • name
    string
  • description
    string
  • tags
    array
  • post_to_slack
    boolean
  • slack_message_format
    string
  • steps
    Click to open
    array
  • deleted
    boolean
  • last_calculated_at
    string

Response


Request

PATCH /api/projects/:project_id/actions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/:id/\
-d name="string"

Response

RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}

Delete actions

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

Path Parameters

  • id
    integer
  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Request

DELETE /api/projects/:project_id/actions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/:id/

Response

No response

Retrieve actions count

Path Parameters

  • id
    integer
  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Response


Request

GET /api/projects/:project_id/actions/:id/count
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/:id/count/

Response

RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}

Retrieve actions people

Path Parameters

  • project_id
    string

Query Parameters

  • format
    string
    One of: "csv""json"

Response


Request

GET /api/projects/:project_id/actions/people
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://app.posthog.com/api/projects/:project_id/actions/people/

Response

RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"tags": [
null
],
"post_to_slack": true,
"slack_message_format": "string",
"steps": [
{
"id": "string",
"event": "string",
"tag_name": "string",
"text": "string",
"text_matching": "contains",
"href": "string",
"href_matching": "contains",
"selector": "string",
"url": "string",
"name": "string",
"url_matching": "contains",
"properties": {
"property1": null,
"property2": null
}
}
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"email": "user@example.com",
"is_email_verified": true
},
"deleted": true,
"is_calculating": true,
"last_calculated_at": "2019-08-24T14:15:22Z",
"team_id": 0,
"is_action": true,
"bytecode_error": "string"
}

Questions?

Was this page useful?