Passer au contenu principal
POST
/
actions
/
modules
Create a new Actions Module
curl --request POST \
  --url https://{tenantDomain}/api/v2/actions/modules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "code": "<string>",
  "secrets": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "dependencies": [
    {
      "name": "<string>",
      "version": "<string>"
    }
  ],
  "api_version": "<string>",
  "publish": true
}
'
{
  "id": "<string>",
  "name": "<string>",
  "code": "<string>",
  "dependencies": [
    {
      "name": "<string>",
      "version": "<string>"
    }
  ],
  "secrets": [
    {
      "name": "<string>",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "actions_using_module_total": 123,
  "all_changes_published": true,
  "latest_version_number": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "latest_version": {
    "id": "<string>",
    "version_number": 123,
    "code": "<string>",
    "dependencies": [
      {
        "name": "<string>",
        "version": "<string>"
      }
    ],
    "secrets": [
      {
        "name": "<string>",
        "updated_at": "2023-11-07T05:31:56Z"
      }
    ],
    "created_at": "2023-11-07T05:31:56Z"
  }
}

Autorisations

Authorization
string
header
requis

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

Corps

name
string
requis

The name of the action module.

Maximum string length: 255
Pattern: ^[^]*$
code
string
requis

The source code of the action module.

Maximum string length: 65536
Pattern: ^[^]*$
secrets
object[]

The secrets to associate with the action module.

dependencies
object[]

The npm dependencies of the action module.

api_version
string

The API version of the module.

Maximum string length: 20
Pattern: ^[^]*$
publish
boolean

Whether to publish the module immediately after creation.

Réponse

The action module was created.

id
string

The unique ID of the module.

name
string

The name of the module.

code
string

The source code from the module's draft version.

dependencies
object[]

The npm dependencies from the module's draft version.

secrets
object[]

The secrets from the module's draft version (names and timestamps only, values never returned).

actions_using_module_total
integer

The number of deployed actions using this module.

all_changes_published
boolean

Whether all draft changes have been published as a version.

latest_version_number
integer

The version number of the latest published version. Omitted if no versions have been published.

created_at
string<date-time>

Timestamp when the module was created.

updated_at
string<date-time>

Timestamp when the module was last updated.

latest_version
object

The latest published version as a reference object. Omitted if no versions have been published.