Skip to content

Create Comment Tier 4

POST/api/files/:id/commentsCopied!

Creates a comment or a reply to an existing comment.

Example

ts
const comment = await client.comments.create("FX1234567890ABCD", {
  content: "Looks great, approved.",
  anchor: 12000,
  duration: 3000,
  parent: { id: "0efee6f8-5829-41c9-bb4d-90dd7e72cc58" },
});
bash
youvico comment create \
  --file FX1234567890ABCD \
  --content "Looks great, approved." \
  --anchor 12000 \
  --duration 3000 \
  --parent 0efee6f8-5829-41c9-bb4d-90dd7e72cc58
bash
curl -X POST 'https://api.youvico.com/api/files/FX1234567890ABCD/comments' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "Looks great, approved.", "anchor": 12000, "duration": 3000, "parent": { "id": "0efee6f8-5829-41c9-bb4d-90dd7e72cc58" } }'
json
{
  "data": {
    "id": "2fb4e60b-0d9a-46f3-a4dc-cb9fe8ad9be6"
  }
}

Request

Path

idstringrequired
File ID

Body

contentstringrequired

1–1000 characters

Comment text
anchornumber
Video timestamp in milliseconds, or page number starting from 1 for documents
durationnumber
Duration in the same unit as anchor
parentobject?
Parent comment object
parent.idstring
Parent comment ID

Example: 0efee6f8-5829-41c9-bb4d-90dd7e72cc58

parentIdstringdeprecated
Parent comment ID

WARNING

Replies to replies are not allowed. parent.id must point to a top-level comment.

Response

Returns 201 Created.

dataobject
Created comment
data.idstring
ID of the created comment

Example: 2fb4e60b-0d9a-46f3-a4dc-cb9fe8ad9be6