Endpoints

Comments

GET/api/v1/{subject_type}/{subject_id}/comments

All comments on a subject (top-level and replies), oldest first. Includes tombstones — a soft-deleted comment still reserves its place for any reply that answers it (COLLAB §5.2).

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

subject_type*Subject Type

Value in

  • "issue"
  • "incident"
  • "alert"
subject_id*Subject Id
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/issue/497f6eca-6276-4993-bfeb-53cbbbba6f08/comments"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "subject_type": "string",    "subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",    "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",    "author_id": "78424c75-5c41-4b25-9735-3c9f7d05c59e",    "body": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "deleted_at": "2019-08-24T14:15:22Z",    "mentions": [      {        "mentioned_type": "string",        "mentioned_id": "04d23999-0279-48ed-bb12-c94c1f4ae48b"      }    ]  }]
POST/api/v1/{subject_type}/{subject_id}/comments

Posts a comment or a reply. See CommentService.create_comment for how a reply to a reply is reattached rather than rejected.

Mentions in body are parsed once here, at write time (COLLAB §6), and stored as CommentMention rows — never re-parsed on a later read. Fan-out notification (auto-subscribing the author, mentioned users, and mentioned teams' current members, then delivering through the existing FCM path to every non-muted subscriber) is best-effort: a delivery failure must never turn a successfully posted comment into an error response, matching assign_incident's use of notify_assignment in app/api/v1/incidents.py.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

subject_type*Subject Type

Value in

  • "issue"
  • "incident"
  • "alert"
subject_id*Subject Id
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for posting a comment. parent_id, if given, may name a top-level comment or a reply — replying to a reply reattaches to that reply's own parent (COLLAB §5.2), it is never rejected. See CommentService.create_comment.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/issue/497f6eca-6276-4993-bfeb-53cbbbba6f08/comments" \  -H "Content-Type: application/json" \  -d '{    "body": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "subject_type": "string",  "subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",  "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",  "author_id": "78424c75-5c41-4b25-9735-3c9f7d05c59e",  "body": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "deleted_at": "2019-08-24T14:15:22Z",  "mentions": [    {      "mentioned_type": "string",      "mentioned_id": "04d23999-0279-48ed-bb12-c94c1f4ae48b"    }  ]}
PATCH/api/v1/comments/{comment_id}

Edits a comment. Author-only — see CommentService.update_comment.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*Comment Id
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for editing a comment. Author-only (CommentService. update_comment).

Response Body

application/json

application/json

curl -X PATCH "https://example.com/api/v1/comments/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "body": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "subject_type": "string",  "subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",  "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",  "author_id": "78424c75-5c41-4b25-9735-3c9f7d05c59e",  "body": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "deleted_at": "2019-08-24T14:15:22Z",  "mentions": [    {      "mentioned_type": "string",      "mentioned_id": "04d23999-0279-48ed-bb12-c94c1f4ae48b"    }  ]}
DELETE/api/v1/comments/{comment_id}

Soft-deletes a comment: author or an org admin. See CommentService.delete_comment — the row and its parent_id survive as a tombstone.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

comment_id*Comment Id
Formatuuid

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/comments/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty