PUT
/
rest
/
actions
/
{id}
curl --request PUT \
  --url https://copilotz.com/rest/actions/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Your Action Name",
  "description": "Your Action Description",
  "specType": "openapi3-yaml",
  "moduleUrl": "https://example.com/modules/sendTemplate.js",
  "spec": "openapi: 3.0.0\ninfo:\n  title: Send Template API\npaths:\n  /sendTemplate:\n    post:\n      summary: Send a template message\n      ..."
}'
{
  "name": "Send Template Message",
  "description": "Send templated messages to WhatsApp users.",
  "specType": "openapi3-yaml",
  "moduleUrl": "https://example.com/modules/sendTemplate.js",
  "spec": "openapi: 3.0.0\ninfo:\n  title: Send Template API\npaths:\n  /sendTemplate:\n    post:\n      summary: Send a template message\n      ..."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
integer
required

Body

application/json

Request payload for creating or updating an action.

name
string
required

Name of the action.

Example:

"Your Action Name"

description
string
required

Detailed description of the action.

Example:

"Your Action Description"

specType
string
required

Specification type of the action.

Example:

"openapi3-yaml"

moduleUrl
string
required

URL of the module that will be used to execute this action.

Example:

"https://example.com/modules/sendTemplate.js"

spec
string
required

YAML file documentation on how to perform the action.

Example:

"openapi: 3.0.0\ninfo:\n title: Send Template API\npaths:\n /sendTemplate:\n post:\n summary: Send a template message\n ..."

Response

200 - application/json
Successful response

Response containing action details.

name
string
required

Name of the action.

Example:

"Send Template Message"

description
string
required

Detailed description of the action.

Example:

"Send templated messages to WhatsApp users."

specType
string
required

Specification type of the action.

Example:

"openapi3-yaml"

moduleUrl
string
required

URL of the module that will be used to execute this action.

Example:

"https://example.com/modules/sendTemplate.js"

spec
string
required

YAML file documentation on how to perform the action.

Example:

"openapi: 3.0.0\ninfo:\n title: Send Template API\npaths:\n /sendTemplate:\n post:\n summary: Send a template message\n ..."