Comments

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

Endpoints

GET
POST
GET
PATCH
DELETE
GET
GET

List all comments

Required API key scopes

comment:read

Query parameters

  • cursor
    string
  • item_id
    string
  • scope
    string
  • search
    string
  • source_comment
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"next": "http://api.example.org/accounts/?cursor=cD00ODY%3D\"",
"previous": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"deleted": true,
"mentions": [
0
],
"slug": "string",
"content": "string",
"rich_content": null,
"version": 0,
"created_at": "2019-08-24T14:15:22Z",
"item_id": "string",
"item_context": null,
"scope": "string",
"source_comment": "aecfc6dd-f4f2-4252-b81d-e21a9112c0dc"
}
]
}

Create comments

Required API key scopes

comment:write

Request parameters

  • deleted
    boolean
  • mentions
    array
  • slug
    string
  • content
    string
  • rich_content
  • item_id
    string
  • item_context
  • scope
    string
  • source_comment
    string

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"deleted": true,
"mentions": [
0
],
"slug": "string",
"content": "string",
"rich_content": null,
"version": 0,
"created_at": "2019-08-24T14:15:22Z",
"item_id": "string",
"item_context": null,
"scope": "string",
"source_comment": "aecfc6dd-f4f2-4252-b81d-e21a9112c0dc"
}

Retrieve comments

Required API key scopes

comment:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"deleted": true,
"mentions": [
0
],
"slug": "string",
"content": "string",
"rich_content": null,
"version": 0,
"created_at": "2019-08-24T14:15:22Z",
"item_id": "string",
"item_context": null,
"scope": "string",
"source_comment": "aecfc6dd-f4f2-4252-b81d-e21a9112c0dc"
}

Update comments

Required API key scopes

comment:write

Path parameters

  • id
    string

Request parameters

  • deleted
    boolean
  • mentions
    array
  • slug
    string
  • content
    string
  • rich_content
  • item_id
    string
  • item_context
  • scope
    string
  • source_comment
    string

Response


Example request

PATCH /api/projects/:project_id/comments/: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/comments/:id/\
-d created_by=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"deleted": true,
"mentions": [
0
],
"slug": "string",
"content": "string",
"rich_content": null,
"version": 0,
"created_at": "2019-08-24T14:15:22Z",
"item_id": "string",
"item_context": null,
"scope": "string",
"source_comment": "aecfc6dd-f4f2-4252-b81d-e21a9112c0dc"
}

Delete comments

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

Required API key scopes

comment:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/comments/: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/comments/:id/

Example response

Status 405 No response body

Retrieve comments thread

Required API key scopes

comment:read

Path parameters

  • id
    string

Example request

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

Example response

Status 200 No response body

Retrieve comments count

Required API key scopes

comment:read

Example request

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

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.