---
title: Create On-Call Page comment
description: Add a comment to the timeline of an On-Call Page.
breadcrumbs: Docs > API > Create On-Call Page comment
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Create On-Call Page comment

{% callout %}
This product or feature is not supported for the following sites: us2.ddog-gov.com
{% /callout %}

## v2 (latest)

| Datadog site      | API endpoint                                                               |
| ----------------- | -------------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/on-call/pages/{page_id}/comments     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/on-call/pages/{page_id}/comments |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/on-call/pages/{page_id}/comments |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/on-call/pages/{page_id}/comments      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/on-call/pages/{page_id}/comments |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/on-call/pages/{page_id}/comments |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/on-call/pages/{page_id}/comments |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/on-call/pages/{page_id}/comments      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/on-call/pages/{page_id}/comments  |

### Overview

Add a comment to the timeline of an On-Call Page.

This endpoint requires the `on_call_respond` permission.

### Arguments

#### Path Parameters

| Field                | Type   | Description                     |
| -------------------- | ------ | ------------------------------- |
| page_id [*required*] | string | The ID of the Page, or its key. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type     | Description                                                                                                                                                                              |
| ------------ | ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object   | Data for creating a comment on an On-Call Page.                                                                                                                                          |
| data         | attributes [*required*] | object   | Attributes for creating a comment on an On-Call Page.                                                                                                                                    |
| attributes   | body [*required*]       | string   | The content of the comment.                                                                                                                                                              |
| attributes   | mentioned_user_ids      | [string] | The IDs of the users mentioned in the comment.                                                                                                                                           |
| data         | id                      | uuid     | A client-generated UUID that makes the request idempotent. Retrying the request with the same ID does not create a duplicate comment. If you omit the ID, Datadog generates a random ID. |
| data         | type [*required*]       | enum     | Indicates that the resource is of type `comments`. Allowed enum values: `comments`. Default: `comments`.                                                                                 |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "body": "Comment from the API client integration tests."
    },
    "id": "3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b",
    "type": "comments"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="204" %}
No Content
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export page_id="15e74b8b-f865-48d0-bcc5-453323ed2c8f"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/on-call/pages/${page_id}/comments" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "body": "Comment from the API client integration tests."
    },
    "id": "3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b",
    "type": "comments"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
