---
source_url: https://www.pubnub.com/docs/sdks/rest-api/add-action
title: Add action
---

# Add action

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Allows users to post action on a *parent message*. The server does not validate that the parent message exists at the time the action is posted. The server does, however, check that you have not already added this particular action to this message. In other words, for a given parent message (identified by `sub_key`, `channel`, `timetoken`), there is at most one unique (`type`, `value`) pair per UUID/userId. There is a limit to the total number of actions which can be posted on a given message (default `25000`). If all goes well, the message action is stored in the database, and a specially structured `Action add event` message is published in on the same channel as the parent message.

| Path Parameters |
| --- |
| `sub_key`string—**REQUIRED**Your app's subscribe key from Admin Portal.Example: sub-c-50264475-1902-558x-d213-7p19052012n2 |
| `channel`string—**REQUIRED**The channel ID to perform the operation on.Example: myChannel |
| `message_timetoken`string—**REQUIRED**The publish timetoken of a parent message.Example: 15610547826970040 |

| Query Parameters |
| --- |
| `auth`stringString which is either the auth key (Access Manager legacy) or a valid token (Access Manager) used to authorize the operation if access control is enabled.Example: myAuth / p0thisAkFl043rhDdHRsCkNyZXisRGNoYW6hanNlY3JldAFDZ3Jwsample3KgQ3NwY6BDcGF0pERjaGFuoENnctokenVzcqBDc3BjoERtZXRhoENzaWdYIGOAeTyWGJI |
| `uuid`string—**REQUIRED**A UTF-8 encoded string of up to 92 characters used to identify the client.Example: myUniqueUserId |
| `signature`stringSignature used to verify that the request was signed with the secret key associated with the subscribe key.If Access Manager is enabled, either a valid authorization token or a signature are required.Check Access Manager documentation for details on how to compute the signature. |
| `timestamp`integerUnix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 seconds offset from NTP.Required if the signature parameter is supplied. |

| Request Body—**REQUIRED**JSON object with user properties. |
| --- |
| `type`string |
| `value`string |

| Responses |
| --- |
| `200`The message action was successfully added.Schema — OPTIONALstatus integer — OPTIONALdata object — OPTIONALtype string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONAL | Schema—**OPTIONAL** | `status`integer—**OPTIONAL** | `data`object—**OPTIONAL**type string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONAL | `type`string—**OPTIONAL** | `value`string—**OPTIONAL** | `actionTimetoken`string—**OPTIONAL** | `messageTimetoken`string—**OPTIONAL** | `uuid`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `data`object—**OPTIONAL**type string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONAL | `type`string—**OPTIONAL** | `value`string—**OPTIONAL** | `actionTimetoken`string—**OPTIONAL** | `messageTimetoken`string—**OPTIONAL** | `uuid`string—**OPTIONAL** |
| `type`string—**OPTIONAL** |
| `value`string—**OPTIONAL** |
| `actionTimetoken`string—**OPTIONAL** |
| `messageTimetoken`string—**OPTIONAL** |
| `uuid`string—**OPTIONAL** |
| `207`The message action was stored but failed to publish.Schema — OPTIONALstatus integer — OPTIONALdata object — OPTIONALtype string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONALerror object — OPTIONALstatus integer — OPTIONALerror object — OPTIONALmessage string — OPTIONALsource string — OPTIONAL | Schema—**OPTIONAL** | `status`integer—**OPTIONAL** | `data`object—**OPTIONAL**type string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONAL | `type`string—**OPTIONAL** | `value`string—**OPTIONAL** | `actionTimetoken`string—**OPTIONAL** | `messageTimetoken`string—**OPTIONAL** | `uuid`string—**OPTIONAL** | `error`object—**OPTIONAL**status integer — OPTIONALerror object — OPTIONALmessage string — OPTIONALsource string — OPTIONAL | `status`integer—**OPTIONAL** | `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `data`object—**OPTIONAL**type string — OPTIONALvalue string — OPTIONALactionTimetoken string — OPTIONALmessageTimetoken string — OPTIONALuuid string — OPTIONAL | `type`string—**OPTIONAL** | `value`string—**OPTIONAL** | `actionTimetoken`string—**OPTIONAL** | `messageTimetoken`string—**OPTIONAL** | `uuid`string—**OPTIONAL** |
| `type`string—**OPTIONAL** |
| `value`string—**OPTIONAL** |
| `actionTimetoken`string—**OPTIONAL** |
| `messageTimetoken`string—**OPTIONAL** |
| `uuid`string—**OPTIONAL** |
| `error`object—**OPTIONAL**status integer — OPTIONALerror object — OPTIONALmessage string — OPTIONALsource string — OPTIONAL | `status`integer—**OPTIONAL** | `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `source`string—**OPTIONAL** |
| `400`The post request contained invalid parameters.Schema — OPTIONALstatus integer — OPTIONALerror object — OPTIONALmessage string — OPTIONALsource string — OPTIONALdetails object[] — OPTIONALmessage string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | Schema—**OPTIONAL** | `status`integer—**OPTIONAL** | `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONALdetails object[] — OPTIONALmessage string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** | `details`object[]—**OPTIONAL**message string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | `message`string—**OPTIONAL** | `location`string—**OPTIONAL** | `locationType`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONALdetails object[] — OPTIONALmessage string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** | `details`object[]—**OPTIONAL**message string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | `message`string—**OPTIONAL** | `location`string—**OPTIONAL** | `locationType`string—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `source`string—**OPTIONAL** |
| `details`object[]—**OPTIONAL**message string — OPTIONALlocation string — OPTIONALlocationType string — OPTIONAL | `message`string—**OPTIONAL** | `location`string—**OPTIONAL** | `locationType`string—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `location`string—**OPTIONAL** |
| `locationType`string—**OPTIONAL** |
| `403`The client isn't authorized to perform this operation. The authorization key you provided doesn't have the required permissions for this operation.Schema — OPTIONALstatus integer — OPTIONALerror object — OPTIONALsource string — OPTIONALmessage string — OPTIONAL | Schema—**OPTIONAL** | `status`integer—**OPTIONAL** | `error`object—**OPTIONAL**source string — OPTIONALmessage string — OPTIONAL | `source`string—**OPTIONAL** | `message`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `error`object—**OPTIONAL**source string — OPTIONALmessage string — OPTIONAL | `source`string—**OPTIONAL** | `message`string—**OPTIONAL** |
| `source`string—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `409`The action was already addedSchema — OPTIONALstatus integer — OPTIONALerror object — OPTIONALmessage string — OPTIONALsource string — OPTIONAL | Schema—**OPTIONAL** | `status`integer—**OPTIONAL** | `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`integer—**OPTIONAL** |
| `error`object—**OPTIONAL**message string — OPTIONALsource string — OPTIONAL | `message`string—**OPTIONAL** | `source`string—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `source`string—**OPTIONAL** |

`sub_key`*

Type: string

Your app's subscribe key from [Admin Portal](https://admin.pubnub.com).

`channel`*

Type: string

The channel ID to perform the operation on.

`message_timetoken`*

Type: string

The publish timetoken of a parent message.

`auth`

Type: string

String which is either the auth key (Access Manager legacy) or a valid token ([Access Manager](https://www.pubnub.com/docs/security/access-control/overview.md)) used to authorize the operation if access control is enabled.

`uuid`*

Type: string

A UTF-8 encoded string of up to 92 characters used to [identify the client](https://www.pubnub.com/docs/architecture/core-concepts.md).

`signature`

Type: string

Signature used to verify that the request was signed with the secret key associated with the subscribe key. If Access Manager is enabled, either a valid authorization token or a signature are required. Check [Access Manager documentation](https://www.pubnub.com/docs/sdks/rest-api/access-manager-introduction.md) for details on how to compute the signature.

`timestamp`

Type: integer

Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 seconds offset from NTP. Required if the `signature` parameter is supplied.

JSON object with user properties.

`type`

Type: string

Example: `"reaction"`

`value`

Type: string

Example: `"smiley_face"`

`status`

Type: integer

Example: `200`

`data`

Type: object

`status`

Type: integer

Example: `207`

`data`

Type: object

`error`

Type: object

`status`

Type: integer

Example: `400`

`error`

Type: object

`status`

Type: integer

Example: `403`

`error`

Type: object

`status`

Type: integer

`error`

Type: object

Example Response

```
{
  "status": 409,
  "error": {
    "source": "actions",
    "message": "Action Already Added"
  }
}
```
