> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infinipost.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Comment on Post

> Add a comment to one or more TikTok posts from one of your accounts

<Info>
  **TikTok only.** Commenting is currently supported on TikTok posts only.
</Info>

## Request Body

<ParamField body="accountId" type="string" required>
  The account ID to comment from.
</ParamField>

<ParamField body="postLinks" type="array" required>
  Array of TikTok post links to comment on (your own posts or other users').

  **How to get a post link:**

  1. Open TikTok and navigate to the post you want to comment on
  2. Tap the **Send to** arrow button in the bottom right corner of the post
  3. Tap **Copy link**

  The copied link will look like: `https://www.tiktok.com/@username/video/7123456789012345678`
</ParamField>

<ParamField body="scheduledTime" type="string">
  ISO 8601 timestamp for when to post the comment. If not provided, comments immediately.
</ParamField>

<ParamField body="text" type="string" required>
  The comment text.
</ParamField>

## Response

<ResponseField name="commentId" type="string">
  Unique identifier for the created comment task.
</ResponseField>

<ResponseField name="accountId" type="string">
  Account that created the comment.
</ResponseField>

<ResponseField name="username" type="string">
  TikTok username of the account that created the comment.
</ResponseField>

<ResponseField name="postLinks" type="array">
  The TikTok post links that were commented on.
</ResponseField>

<ResponseField name="text" type="string">
  Comment text.
</ResponseField>

<ResponseField name="scheduledTime" type="string">
  ISO 8601 timestamp of when the comment is scheduled to be posted.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the comment task was created.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.infinipost.co/v1/comments \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "accountId": "acc_123",
      "postLinks": ["https://www.tiktok.com/@username/video/7123456789012345678"],
      "text": "Amazing content! 🔥",
      "scheduledTime": "2024-04-22T12:00:00Z"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.infinipost.co/v1/comments', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      accountId: 'acc_123',
      postLinks: ['https://www.tiktok.com/@username/video/7123456789012345678'],
      text: 'Amazing content! 🔥',
      scheduledTime: '2024-04-22T12:00:00Z'
    })
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "commentId": "cmt_xyz789",
    "accountId": "acc_123",
    "username": "@youraccounthandle",
    "postLinks": ["https://www.tiktok.com/@username/video/7123456789012345678"],
    "text": "Amazing content! 🔥",
    "scheduledTime": "2024-04-22T12:00:00Z",
    "createdAt": "2024-04-21T20:25:00Z"
  }
  ```
</ResponseExample>

## Error Responses

```json Unauthorized theme={null}
{
  "error": {
    "code": "unauthenticated",
    "message": "Invalid or missing API key"
  }
}
```

```json Invalid Parameter theme={null}
{
  "error": {
    "code": "invalid_parameter",
    "message": "postLinks is required and must be a non-empty array"
  }
}
```

```json Account Not Found theme={null}
{
  "error": {
    "code": "not_found",
    "message": "Account acc_1a2b3c4d5e not found"
  }
}
```

```json Platform Not Supported theme={null}
{
  "error": {
    "code": "invalid_parameter",
    "message": "Commenting is only supported for TikTok accounts"
  }
}
```

```json Server Error theme={null}
{
  "error": {
    "code": "internal",
    "message": "An unexpected error occurred"
  }
}
```
