HTTP API

Comment

POST/api/v1/comments
POST
/api/v1/comments

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/comments" \  -H "Content-Type: application/json" \  -d '{    "body": {      "text": "string"    },    "target": {      "id": "string",      "type": "string"    }  }'
{  "comment_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "mentions": [    "string"  ],  "moderation_state": "pending",  "thread_id": "string"}
POST/api/v1/comments/agent-audit
POST
/api/v1/comments/agent-audit

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/comments/agent-audit" \  -H "Content-Type: application/json" \  -d '{    "body": {      "text": "string"    },    "target": {      "id": "string",      "type": "string"    }  }'
{  "comment_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "mentions": [    "string"  ],  "moderation_state": "pending",  "thread_id": "string"}
GET/api/v1/comments/moderation/flagged
GET
/api/v1/comments/moderation/flagged

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
min_toxicity?number

Minimum toxicity score filter

Formatdouble

Response Body

application/json

curl -X GET "https://example.com/api/v1/comments/moderation/flagged"
{  "comments": [    {      "anonymous": true,      "author": null,      "body": {        "format": "markdown",        "spoiler": true,        "text": "string"      },      "comment_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "deleted_at": "2019-08-24T14:15:22Z",      "depth": 0,      "mentions": [        "string"      ],      "moderation": null,      "moderation_state": "pending",      "parent_comment_id": "string",      "path": [        "string"      ],      "pinned": true,      "reaction_counts": {        "property1": 0,        "property2": 0      },      "target_id": "string",      "target_type": "string",      "thread_id": "string",      "updated_at": "2019-08-24T14:15:22Z",      "viewer_reactions": [        "string"      ],      "visibility": "public"    }  ],  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  }}
GET/api/v1/comments/threads/{target_type}/{target_id}
GET
/api/v1/comments/threads/{target_type}/{target_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

target_type*string
target_id*string

Query Parameters

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
max_depth?integer

Maximum reply depth to return

Formatint32
Range0 <= value
sort_order?string

Sort order (asc or desc) by creation time

Value in

  • "asc"
  • "desc"
pinned_first?boolean

Whether to surface pinned comments first

Response Body

application/json

curl -X GET "https://example.com/api/v1/comments/threads/string/string"
{  "comments": [    {      "anonymous": true,      "author": null,      "body": {        "format": "markdown",        "spoiler": true,        "text": "string"      },      "comment_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "deleted_at": "2019-08-24T14:15:22Z",      "depth": 0,      "mentions": [        "string"      ],      "moderation": null,      "moderation_state": "pending",      "parent_comment_id": "string",      "path": [        "string"      ],      "pinned": true,      "reaction_counts": {        "property1": 0,        "property2": 0      },      "target_id": "string",      "target_type": "string",      "thread_id": "string",      "updated_at": "2019-08-24T14:15:22Z",      "viewer_reactions": [        "string"      ],      "visibility": "public"    }  ],  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "thread_id": "string"}
GET/api/v1/comments/{comment_id}
GET
/api/v1/comments/{comment_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/comments/string"
{  "anonymous": true,  "author": null,  "body": {    "format": "markdown",    "spoiler": true,    "text": "string"  },  "comment_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "deleted_at": "2019-08-24T14:15:22Z",  "depth": 0,  "mentions": [    "string"  ],  "moderation": null,  "moderation_state": "pending",  "parent_comment_id": "string",  "path": [    "string"  ],  "pinned": true,  "reaction_counts": {    "property1": 0,    "property2": 0  },  "target_id": "string",  "target_type": "string",  "thread_id": "string",  "updated_at": "2019-08-24T14:15:22Z",  "viewer_reactions": [    "string"  ],  "visibility": "public"}
PATCH/api/v1/comments/{comment_id}
PATCH
/api/v1/comments/{comment_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://example.com/api/v1/comments/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "anonymous": true,  "author": null,  "body": {    "format": "markdown",    "spoiler": true,    "text": "string"  },  "comment_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "deleted_at": "2019-08-24T14:15:22Z",  "depth": 0,  "mentions": [    "string"  ],  "moderation": null,  "moderation_state": "pending",  "parent_comment_id": "string",  "path": [    "string"  ],  "pinned": true,  "reaction_counts": {    "property1": 0,    "property2": 0  },  "target_id": "string",  "target_type": "string",  "thread_id": "string",  "updated_at": "2019-08-24T14:15:22Z",  "viewer_reactions": [    "string"  ],  "visibility": "public"}
DELETE/api/v1/comments/{comment_id}
DELETE
/api/v1/comments/{comment_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/comments/string"
{  "comment_id": "string",  "message": "string"}
POST/api/v1/comments/{comment_id}/moderation
POST
/api/v1/comments/{comment_id}/moderation

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/comments/string/moderation" \  -H "Content-Type: application/json" \  -d '{    "state": "pending"  }'
{  "action_id": "string",  "comment_id": "string",  "from_state": "pending",  "to_state": "pending"}
POST/api/v1/comments/{comment_id}/pin
POST
/api/v1/comments/{comment_id}/pin

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/comments/string/pin" \  -H "Content-Type: application/json" \  -d '{}'
{  "comment_id": "string",  "pinned": true}
POST/api/v1/comments/{comment_id}/reactions
POST
/api/v1/comments/{comment_id}/reactions

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/comments/string/reactions" \  -H "Content-Type: application/json" \  -d '{    "reaction": "string"  }'
{  "comment_id": "string",  "reaction": "string",  "reaction_counts": {    "property1": 0,    "property2": 0  }}
DELETE/api/v1/comments/{comment_id}/reactions/{reaction}
DELETE
/api/v1/comments/{comment_id}/reactions/{reaction}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string
reaction*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/comments/string/reactions/string"
{  "comment_id": "string",  "reaction": "string",  "reaction_counts": {    "property1": 0,    "property2": 0  }}
PUT/api/v1/comments/{comment_id}/reactions/{reaction}
PUT
/api/v1/comments/{comment_id}/reactions/{reaction}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*string
reaction*string

Response Body

application/json

curl -X PUT "https://example.com/api/v1/comments/string/reactions/string"
{  "comment_id": "string",  "reacted": true,  "reaction": "string",  "reaction_counts": {    "property1": 0,    "property2": 0  }}

On this page