Skip to content

Upsert a comment ​

POST/api/v2/workspaces/{slug}/projects/{project_id}/work-items/{work_item_id}/comments/upsert/

Comments are the discussion thread on a work item. Create a comment, or update the existing one that carries the same (external_source, external_id) pair.

  • Both external_source and external_id are required — without them there is nothing to match on and the request is a 400.
  • A created record answers 201 with X-Plane-Upsert: created; an updated one answers 200 with X-Plane-Upsert: updated. Branch on the header rather than guessing from the status.
  • Upsert is safe for sequential importers. Two simultaneous upserts of the same key can each miss and each create, so serialize your writes per key.

Path Parameters ​

slug:requiredstring

The workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.

project_id:requiredstring

The project the resource belongs to. Accepts the project UUID or its bare identifier, for example ENG.

work_item_id:requiredstring

The work item the resource hangs off. Accepts the work item UUID or its PROJ-123 identifier.

Body Parameters ​

comment_html:requiredstring

The comment html.

access:optionalstring
  • INTERNAL - INTERNAL
  • EXTERNAL - EXTERNAL

One of INTERNAL, EXTERNAL.

parent_id:optionalstring (uuid)

Make the comment a reply to this comment. The parent must be a top-level comment on the same work item, and a reply takes its parent's access. Send null for a top-level comment.

Nullable.

external_id:optionalstring

Your system's identifier for this record, for sync and import correlation.

Maximum 255 characters. Nullable.

external_source:optionalstring

The system external_id came from, for example github or jira.

Maximum 255 characters. Nullable.

Response shaping ​

fields:optionalstring

Comma-separated list of fields to return. Unrequested keys are omitted, not returned as null. id always comes back. Pass all for every requestable field. An unknown name is a 400. See Sparse fields.

Requestable here: access, actor_id, comment_html, comment_stripped, created_at, created_by_id, edited_at, external_id, external_source, hidden_at, hidden_by_id, hidden_reason, id, parent_id, updated_at, updated_by_id, work_item_id.

expand:optionalstring

Comma-separated relations to embed: actor.

Expansion is separate-key — ?expand=state keeps state_id and adds a state object next to it. ?fields= and ?expand= are independent: naming a relation in ?fields= is a 400, and expanded objects survive field filtering. See Expanding relations.

Scopes ​

projects.work_items.comments:write

Errors ​

StatusCodeCause
400invalid_requestThe request body or a query parameter failed validation.
401unauthorizedMissing or invalid credentials.
402payment_requiredThe feature this endpoint belongs to isn't enabled on your plan or is switched off.
403forbiddenYour role or token scope doesn't allow this.
404not_foundNo such resource, or it's outside your tenant.
406not_acceptableThe Accept header asks for a representation the API can't produce.
409conflictA business rule blocks the write — see the notes above.
413payload_too_largeThe request body is over the size limit.
415unsupported_media_typeThe Content-Type isn't one this endpoint accepts.
429rate_limitedThrottled. Honor the Retry-After header before retrying.
Upsert a comment
bash
curl -X POST \
  "https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-items/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88/comments/upsert/" \
  -H "X-Api-Key: $PLANE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "comment_html": "<p>Customer confirmed the fix on their account.</p>",
  "parent_id": "e5b2c8a1-7d34-4f9e-a0c6-2b8d1f5e3a97",
  "external_source": "zendesk",
  "external_id": "ZD-88431"
}'
Response200
json
{
  "id": "b7e42a19-3c5d-4f80-9a26-8d1c0f4e7b53",
  "work_item_id": "9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88",
  "parent_id": "e5b2c8a1-7d34-4f9e-a0c6-2b8d1f5e3a97",
  "comment_html": "<p>Customer confirmed the fix on their account.</p>",
  "comment_stripped": "Customer confirmed the fix on their account.",
  "access": "EXTERNAL",
  "actor_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
  "external_id": "ZD-88431",
  "external_source": "zendesk",
  "edited_at": "2026-01-16T09:41:27.553018Z",
  "hidden_at": null,
  "hidden_by_id": null,
  "hidden_reason": null,
  "created_at": "2026-01-15T17:20:03.118462Z",
  "updated_at": "2026-01-16T09:41:27.556204Z",
  "created_by_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
  "updated_by_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430"
}