Actions
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
List all actions
Required API key scopes
action:read
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv"
"json"
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
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" \<ph_app_host>/api/projects/:project_id/actions/
Response
Status 200
{"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": [{"event": "string","properties": [{"property1": null,"property2": null}],"selector": "string","tag_name": "string","text": "string","text_matching": "contains","href": "string","href_matching": "contains","url": "string","url_matching": "contains"}],"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": {"property1": null,"property2": null}},"deleted": true,"is_calculating": true,"last_calculated_at": "2019-08-24T14:15:22Z","team_id": 0,"is_action": true,"bytecode_error": "string","pinned_at": "2019-08-24T14:15:22Z"}]}
Create actions
Required API key scopes
action:write
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv"
"json"
Request parameters
- namestring
- descriptionstring
- tagsarray
- post_to_slackboolean
- slack_message_formatstring
- stepsarray
- deletedboolean
- last_calculated_atstring
- pinned_atstring
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" \<ph_app_host>/api/projects/:project_id/actions/\-d name="string"
Response
Status 201
{"id": 0,"name": "string","description": "string","tags": [null],"post_to_slack": true,"slack_message_format": "string","steps": [{"event": "string","properties": [{"property1": null,"property2": null}],"selector": "string","tag_name": "string","text": "string","text_matching": "contains","href": "string","href_matching": "contains","url": "string","url_matching": "contains"}],"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": {"property1": null,"property2": null}},"deleted": true,"is_calculating": true,"last_calculated_at": "2019-08-24T14:15:22Z","team_id": 0,"is_action": true,"bytecode_error": "string","pinned_at": "2019-08-24T14:15:22Z"}
Retrieve actions
Required API key scopes
action:read
Path parameters
- idinteger
A unique integer value identifying this action.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne 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" \<ph_app_host>/api/projects/:project_id/actions/:id/
Response
Status 200
{"id": 0,"name": "string","description": "string","tags": [null],"post_to_slack": true,"slack_message_format": "string","steps": [{"event": "string","properties": [{"property1": null,"property2": null}],"selector": "string","tag_name": "string","text": "string","text_matching": "contains","href": "string","href_matching": "contains","url": "string","url_matching": "contains"}],"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": {"property1": null,"property2": null}},"deleted": true,"is_calculating": true,"last_calculated_at": "2019-08-24T14:15:22Z","team_id": 0,"is_action": true,"bytecode_error": "string","pinned_at": "2019-08-24T14:15:22Z"}
Update actions
Required API key scopes
action:write
Path parameters
- idinteger
A unique integer value identifying this action.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv"
"json"
Request parameters
- namestring
- descriptionstring
- tagsarray
- post_to_slackboolean
- slack_message_formatstring
- stepsarray
- deletedboolean
- last_calculated_atstring
- pinned_atstring
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" \<ph_app_host>/api/projects/:project_id/actions/:id/\-d name="string"
Response
Status 200
{"id": 0,"name": "string","description": "string","tags": [null],"post_to_slack": true,"slack_message_format": "string","steps": [{"event": "string","properties": [{"property1": null,"property2": null}],"selector": "string","tag_name": "string","text": "string","text_matching": "contains","href": "string","href_matching": "contains","url": "string","url_matching": "contains"}],"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": {"property1": null,"property2": null}},"deleted": true,"is_calculating": true,"last_calculated_at": "2019-08-24T14:15:22Z","team_id": 0,"is_action": true,"bytecode_error": "string","pinned_at": "2019-08-24T14:15:22Z"}
Delete actions
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
action:write
Path parameters
- idinteger
A unique integer value identifying this action.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne 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" \<ph_app_host>/api/projects/:project_id/actions/:id/