Llm

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

Endpoints

POST
GET
PATCH
DELETE
POST
GET
POST
GET
PATCH
POST
POST
GET
GET
POST
GET
PATCH

Create llm analytics trace reviews

Required API key scopes

llm_analytics:write

Path parameters

  • project_id
    string

Request parameters

  • trace_id
    string
  • comment
    string
  • scores
    Click to open
    array
  • queue_id
    string

Response


Example request

POST /api/environments/:project_id/llm_analytics/trace_reviews
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/environments/:project_id/llm_analytics/trace_reviews/\
-d trace_id="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"trace_id": "string",
"comment": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"reviewed_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
},
"role_at_organization": "engineering"
},
"scores": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"definition_name": "string",
"definition_kind": "string",
"definition_archived": true,
"definition_version_id": "3b4c7def-d68b-4f5f-846c-43f0f8a328ab",
"definition_version": 0,
"definition_config": {
"options": [
{
"key": "string",
"label": "string"
}
],
"selection_mode": "single",
"min_selections": 1,
"max_selections": 1
},
"categorical_values": [
"string"
],
"numeric_value": "string",
"boolean_value": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"team": 0
}

Retrieve llm analytics trace reviews

Required API key scopes

llm_analytics:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"trace_id": "string",
"comment": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"reviewed_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
},
"role_at_organization": "engineering"
},
"scores": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"definition_name": "string",
"definition_kind": "string",
"definition_archived": true,
"definition_version_id": "3b4c7def-d68b-4f5f-846c-43f0f8a328ab",
"definition_version": 0,
"definition_config": {
"options": [
{
"key": "string",
"label": "string"
}
],
"selection_mode": "single",
"min_selections": 1,
"max_selections": 1
},
"categorical_values": [
"string"
],
"numeric_value": "string",
"boolean_value": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"team": 0
}

Retrieve llm analytics trace reviews

Required API key scopes

llm_analytics:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"trace_id": "string",
"comment": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"reviewed_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
},
"role_at_organization": "engineering"
},
"scores": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"definition_name": "string",
"definition_kind": "string",
"definition_archived": true,
"definition_version_id": "3b4c7def-d68b-4f5f-846c-43f0f8a328ab",
"definition_version": 0,
"definition_config": {
"options": [
{
"key": "string",
"label": "string"
}
],
"selection_mode": "single",
"min_selections": 1,
"max_selections": 1
},
"categorical_values": [
"string"
],
"numeric_value": "string",
"boolean_value": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"team": 0
}

Update llm analytics trace reviews

Required API key scopes

llm_analytics:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • trace_id
    string
  • comment
    string
  • scores
    Click to open
    array
  • queue_id
    string

Response


Example request

PATCH /api/environments/:project_id/llm_analytics/trace_reviews/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_analytics/trace_reviews/:id/\
-d trace_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"trace_id": "string",
"comment": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"reviewed_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
},
"role_at_organization": "engineering"
},
"scores": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"definition_name": "string",
"definition_kind": "string",
"definition_archived": true,
"definition_version_id": "3b4c7def-d68b-4f5f-846c-43f0f8a328ab",
"definition_version": 0,
"definition_config": {
"options": [
{
"key": "string",
"label": "string"
}
],
"selection_mode": "single",
"min_selections": 1,
"max_selections": 1
},
"categorical_values": [
"string"
],
"numeric_value": "string",
"boolean_value": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"team": 0
}

Update llm analytics trace reviews

Required API key scopes

llm_analytics:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • trace_id
    string
  • comment
    string
  • scores
    Click to open
    array
  • queue_id
    string

Response


Example request

PATCH /api/environments/:project_id/llm_analytics/trace_reviews/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_analytics/trace_reviews/:id/\
-d trace_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"trace_id": "string",
"comment": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"reviewed_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
},
"role_at_organization": "engineering"
},
"scores": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"definition_name": "string",
"definition_kind": "string",
"definition_archived": true,
"definition_version_id": "3b4c7def-d68b-4f5f-846c-43f0f8a328ab",
"definition_version": 0,
"definition_config": {
"options": [
{
"key": "string",
"label": "string"
}
],
"selection_mode": "single",
"min_selections": 1,
"max_selections": 1
},
"categorical_values": [
"string"
],
"numeric_value": "string",
"boolean_value": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"team": 0
}

Delete llm analytics trace reviews

Required API key scopes

llm_analytics:write

Path parameters

  • id
    string
  • project_id
    string

Example request

DELETE /api/environments/:project_id/llm_analytics/trace_reviews/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_analytics/trace_reviews/:id/

Example response

Status 204 No response body

Delete llm analytics trace reviews

Required API key scopes

llm_analytics:write

Path parameters

  • id
    string
  • project_id
    string

Example request

DELETE /api/environments/:project_id/llm_analytics/trace_reviews/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_analytics/trace_reviews/:id/

Example response

Status 204 No response body

Create llm analytics translate

Translate text to target language.

Required API key scopes

llm_analytics:write

Path parameters

  • project_id
    string

Example request

POST /api/environments/:project_id/llm_analytics/translate
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/environments/:project_id/llm_analytics/translate/

Example response

Status 201 No response body

List all llm prompts

Required API key scopes

llm_prompt:read

Path parameters

  • project_id
    string

Query parameters

  • content
    string
    Default: full
    One of: "full""preview""none"
  • created_by_id
    integer
  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

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

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",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
],
"prompt_preview": "string",
"prompt_size_bytes": 0
}
]
}

Create llm prompts

Required API key scopes

llm_prompt:write

Path parameters

  • project_id
    string

Request parameters

  • name
    string
  • prompt

Response


Example request

POST /api/environments/:project_id/llm_prompts
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/environments/:project_id/llm_prompts/\
-d name="string",\
-d prompt=undefined

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
]
}

Retrieve llm prompts name

Required API key scopes

llm_prompt:read

Path parameters

  • project_id
    string
  • prompt_name
    string

Query parameters

  • content
    string
    Default: full
    One of: "full""preview""none"
  • version
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"prompt_preview": "string",
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "2019-08-24T14:15:22Z"
}

Update llm prompts name

Required API key scopes

llm_prompt:write

Path parameters

  • project_id
    string
  • prompt_name
    string

Request parameters

  • prompt
  • edits
    Click to open
    array
  • base_version
    integer

Response


Example request

PATCH /api/environments/:project_id/llm_prompts/name/:prompt_name
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_prompts/name/:prompt_name/\
-d prompt=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
]
}

Create llm prompts name archive

Required API key scopes

llm_prompt:write

Path parameters

  • project_id
    string
  • prompt_name
    string

Request parameters

  • name
    string
  • prompt

Response


Example request

POST /api/environments/:project_id/llm_prompts/name/:prompt_name/archive
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/environments/:project_id/llm_prompts/name/:prompt_name/archive/\
-d name="string",\
-d prompt=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
]
}

Create llm prompts name duplicate

Required API key scopes

llm_prompt:write

Path parameters

  • project_id
    string
  • prompt_name
    string

Request parameters

  • new_name
    string

Response


Example request

POST /api/environments/:project_id/llm_prompts/name/:prompt_name/duplicate
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/environments/:project_id/llm_prompts/name/:prompt_name/duplicate/\
-d new_name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
]
}

Retrieve llm prompts resolve name

Required API key scopes

llm_prompt:read

Path parameters

  • project_id
    string
  • prompt_name
    string

Query parameters

  • before_version
    integer
  • limit
    integer
    Default: 50
  • offset
    integer
  • version
    integer
  • version_id
    string

Response


Example request

GET /api/environments/:project_id/llm_prompts/resolve/name/:prompt_name
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_prompts/resolve/name/:prompt_name/

Example response

Status 200
RESPONSE
{
"prompt": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"prompt": null,
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string",
"outline": [
{
"level": 1,
"text": "string"
}
]
},
"versions": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version": 0,
"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
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"is_latest": true
}
],
"has_more": true
}

List all dataset items

Required API key scopes

dataset:read

Path parameters

  • project_id
    string

Query parameters

  • dataset
    string
  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"team": 0
}
]
}

Create dataset items

Required API key scopes

dataset:write

Path parameters

  • project_id
    string

Request parameters

  • dataset
    string
  • input
  • output
  • metadata
  • ref_trace_id
    string
  • ref_timestamp
    string
  • ref_source_id
    string
  • deleted
    boolean

Response


Example request

POST /api/projects/:project_id/dataset_items
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/dataset_items/\
-d dataset="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"team": 0
}

Retrieve dataset items

Required API key scopes

dataset:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"team": 0
}

Update dataset items

Required API key scopes

dataset:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • dataset
    string
  • input
  • output
  • metadata
  • ref_trace_id
    string
  • ref_timestamp
    string
  • ref_source_id
    string
  • deleted
    boolean

Response


Example request

PATCH /api/projects/:project_id/dataset_items/: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/dataset_items/:id/\
-d dataset="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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
},
"role_at_organization": "engineering"
},
"team": 0
}
Next page →

Community questions

Questions about this page? or post a community question.