Remove action

Allows users to remove message actions, by specifying the parent message, and the single timetoken of the action(s) they wish to delete. It is technically possible to delete more than one action if the same UUID/userId posted different actions on the same parent message at the same time. If all goes well, the action(s) are deleted from the database, and one or more Action remove event messages are published on the same channel as the parent message. By default, removing an action requires the delete permission on the channel. Without scope=self, uuid does not limit which actions are removed, so the request removes the action even if another user added it. To let a client remove only its own actions with the write permission, set scope=self. The server then removes only the actions that were added by the uuid in the request. The token must be an Access Manager token with an Authorized UUID that matches uuid. With scope=self, a request for an action added by another user fails with a 400 error. Requests signed with the secret key skip all Access Manager permission checks, so they need neither the delete permission nor a token. With scope=self, a signed request still removes only the actions that were added by uuid.

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

action_timetoken string — REQUIRED

The publish timetoken of the action.

Example: 15610547826970040

Query Parameters
auth string

String 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

scope string

Limits the removal to the actions added by the uuid in the request. The only accepted value is self (case-sensitive). Any other value fails with 400 (Invalid scope).

With scope=self, a client token that has the write permission, but not the delete permission, can remove its own actions. The token must be an Access Manager token with an Authorized UUID that matches uuid. Auth keys (legacy Access Manager) can't use scope=self without the delete permission.

Requests signed with the secret key skip the permission and Authorized UUID checks. With scope=self, they still remove only the actions added by uuid.

Without scope=self, the delete permission is required, uuid doesn't limit which actions are removed, and the request can remove the actions of other users.

Example: self

signature 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 for details on how to compute the signature.

timestamp 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.

Responses
200

The action was removed.

Schema — OPTIONAL
status integer — OPTIONAL
data object — OPTIONAL
207

The action was deleted but the action-deletion message was not published.

Schema — OPTIONAL
status integer — OPTIONAL
error object — OPTIONAL
message string — OPTIONAL
source string — OPTIONAL
400

The request is invalid or no action matches it. No action matches when the action doesn't exist, or when scope=self is set and the action wasn't added by the uuid. The response is the same in both cases, so it doesn't reveal that an action of another user exists. The request is invalid when the scope value isn't exactly self (Invalid scope; the value is case-sensitive), when the uuid is missing or too long, or when a timetoken isn't an integer.

Schema — OPTIONAL
status integer — OPTIONAL
error object — OPTIONAL
message string — OPTIONAL
source string — OPTIONAL
403

The client isn't authorized to perform this operation. The request fails with 403 in these cases:

  • Without scope=self, the token or auth key doesn't have the delete permission on the channel.
  • With scope=self, the token doesn't have the write permission on the channel, or it has no Authorized UUID. Legacy auth keys can't use scope=self without the delete permission.
  • The token's Authorized UUID doesn't match uuid. This applies with or without scope=self, even if the token has the delete permission.
  • No token is supplied.

Requests signed with the secret key aren't subject to these checks.

Schema — OPTIONAL
message string — OPTIONAL
payload object — OPTIONAL
channels string[] — OPTIONAL
error boolean — OPTIONAL
service string — OPTIONAL
status integer — OPTIONAL
* required
sub_key*
Type: string
Your app's subscribe key from Admin Portal.
channel*
Type: string
The channel ID to perform the operation on.
message_timetoken*
Type: string
The publish timetoken of a parent message.
action_timetoken*
Type: string
The publish timetoken of the action.
* required
auth
Type: string
String 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.
uuid*
Type: string
A UTF-8 encoded string of up to 92 characters used to identify the client.
scope
Type: string
Limits the removal to the actions added by the uuid in the request. The only accepted value is self (case-sensitive). Any other value fails with 400 (Invalid scope).


With scope=self, a client token that has the write permission, but not the delete permission, can remove its own actions. The token must be an Access Manager token with an Authorized UUID that matches uuid. Auth keys (legacy Access Manager) can't use scope=self without the delete permission.


Requests signed with the secret key skip the permission and Authorized UUID checks. With scope=self, they still remove only the actions added by uuid.


Without scope=self, the delete permission is required, uuid doesn't limit which actions are removed, and the request can remove the actions of other users.
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 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.
status
Type: integer
Example: 200
data
Type: object
Example: {}
status
Type: integer
error
Type: object
Example Response
{
  "status": 207,
  "error": {
    "source": "actions",
    "message": "Deleted but failed to publish removed events."
  }
}
status
Type: integer
error
Type: object
Example Response
{
  "status": 400,
  "error": {
    "source": "actions",
    "message": "No matching message actions to delete"
  }
}
The client isn't authorized to perform this operation. The request fails with 403 in these cases:

- Without scope=self, the token or auth key doesn't have the delete permission on the channel.
- With scope=self, the token doesn't have the write permission on the channel, or it has no Authorized UUID. Legacy auth keys can't use scope=self without the delete permission.
- The token's Authorized UUID doesn't match uuid. This applies with or without scope=self, even if the token has the delete permission.
- No token is supplied.

Requests signed with the secret key aren't subject to these checks.
message
Type: string
Example: "Forbidden"
payload
Type: object
error
Type: boolean
Example: true
service
Type: string
Example: "Access Manager"
status
Type: integer
Example: 403
Example Response
{
  "message": "Forbidden",
  "payload": {
    "channels": [
      "myChannel"
    ]
  },
  "error": true,
  "service": "Access Manager",
  "status": 403
}