メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
actions
/
actions
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.CreateActionRequestContent{
        Name: "name",
        SupportedTriggers: []*management.ActionTrigger{
            &management.ActionTrigger{
                Id: "id",
            },
        },
    }
    client.Actions.Create(
        context.TODO(),
        request,
    )
}
{
  "all_changes_deployed": false,
  "built_at": "2021-01-01T00:00:00.000Z",
  "code": "module.exports = () => {}",
  "created_at": "2021-01-01T00:00:00.000Z",
  "dependencies": [
    {
      "name": "<string>",
      "registry_url": "<string>",
      "version": "<string>"
    }
  ],
  "deploy": false,
  "deployed_version": {
    "action": {
      "all_changes_deployed": false,
      "created_at": "2021-01-01T00:00:00.000Z",
      "id": "910b1053-577f-4d81-a8c8-020e7319a38a",
      "name": "my-action",
      "supported_triggers": [
        {
          "compatible_triggers": [
            {
              "version": "<string>"
            }
          ],
          "default_runtime": "<string>",
          "runtimes": [
            "<string>"
          ],
          "status": "<string>",
          "version": "<string>"
        }
      ],
      "updated_at": "2021-01-01T00:00:00.000Z"
    },
    "action_id": "910b1053-577f-4d81-a8c8-020e7319a38a",
    "built_at": "2021-01-01T00:00:00.000Z",
    "code": "module.exports = () => {}",
    "created_at": "2021-01-01T00:00:00.000Z",
    "dependencies": [
      {
        "name": "<string>",
        "registry_url": "<string>",
        "version": "<string>"
      }
    ],
    "deployed": true,
    "errors": [
      {
        "id": "<string>",
        "msg": "<string>",
        "url": "<string>"
      }
    ],
    "id": "12a3b9e6-06e6-4a29-96bf-90c82fe79a0d",
    "modules": [
      {
        "module_id": "<string>",
        "module_name": "<string>",
        "module_version_id": "<string>",
        "module_version_number": 123
      }
    ],
    "number": 1,
    "runtime": "node22",
    "secrets": [
      {
        "name": "mySecret",
        "updated_at": "2021-01-01T00:00:00.000Z"
      }
    ],
    "status": "built",
    "supported_triggers": [
      {
        "compatible_triggers": [
          {
            "version": "<string>"
          }
        ],
        "default_runtime": "<string>",
        "runtimes": [
          "<string>"
        ],
        "status": "<string>",
        "version": "<string>"
      }
    ],
    "updated_at": "2021-01-01T00:00:00.000Z"
  },
  "id": "910b1053-577f-4d81-a8c8-020e7319a38a",
  "installed_integration_id": "7d2bc0c9-c0c2-433a-9f4e-86ef80270aad",
  "integration": {
    "catalog_id": "awesome-auth0-integration",
    "created_at": "2021-06-21T15:47:29.072Z",
    "current_release": {
      "id": "<string>",
      "required_configuration": [
        {
          "default_value": "<string>",
          "description": "<string>",
          "label": "<string>",
          "name": "<string>",
          "optional": true,
          "options": [
            {
              "label": "<string>",
              "value": "<string>"
            }
          ],
          "placeholder": "<string>",
          "required": true
        }
      ],
      "required_secrets": [
        {
          "default_value": "<string>",
          "description": "<string>",
          "label": "<string>",
          "name": "<string>",
          "optional": true,
          "options": [
            {
              "label": "<string>",
              "value": "<string>"
            }
          ],
          "placeholder": "<string>",
          "required": true
        }
      ],
      "semver": {
        "major": 1,
        "minor": 1
      },
      "trigger": {
        "compatible_triggers": [
          {
            "version": "<string>"
          }
        ],
        "default_runtime": "<string>",
        "runtimes": [
          "<string>"
        ],
        "status": "<string>",
        "version": "<string>"
      }
    },
    "description": "An awesome Auth0 integration",
    "feature_type": "action",
    "id": "8e9fe2d0-a2fc-4c8c-9e35-dae5afadb70b",
    "logo": "<string>",
    "name": "Example Auth0 integration",
    "partner_id": "b8575c12-8d9d-4b5c-b28e-671fe9d39029",
    "privacy_policy_url": "<string>",
    "public_support_link": "<string>",
    "short_description": "Awesome Auth0 integration",
    "terms_of_use_url": "<string>",
    "updated_at": "2021-06-21T15:47:29.072Z",
    "url_slug": "awesome-auth0-integration-slug"
  },
  "modules": [
    {
      "module_id": "<string>",
      "module_name": "<string>",
      "module_version_id": "<string>",
      "module_version_number": 123
    }
  ],
  "name": "my-action",
  "runtime": "node22",
  "secrets": [
    {
      "name": "mySecret",
      "updated_at": "2021-01-01T00:00:00.000Z"
    }
  ],
  "status": "built",
  "supported_triggers": [
    {
      "compatible_triggers": [
        {
          "version": "<string>"
        }
      ],
      "default_runtime": "<string>",
      "runtimes": [
        "<string>"
      ],
      "status": "<string>",
      "version": "<string>"
    }
  ],
  "updated_at": "2021-01-01T00:00:00.000Z"
}

承認

Authorization
string
header
必須

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

ボディ

name
string
デフォルト:my-action
必須

Action の名前。

supported_triggers
object[]
必須

この Action がサポートするトリガーの一覧。現時点では、Action は一度に 1 つのトリガーのみを対象にできます。

Minimum array length: 1
code
string
デフォルト:module.exports = () => {}

Action のソースコード。

dependencies
object[]

この Action が依存するサードパーティの npm モジュールとそのバージョンの一覧。

deploy
boolean
デフォルト:false

作成後に Action をデプロイする場合は true。

modules
object[]

この Action で使用される Action Module とそのバージョンの一覧。

runtime
string
デフォルト:node22

Node ランタイム。例: node22。デフォルトは node22

secrets
object[]

Action またはそのバージョンに含まれるシークレットの一覧。

レスポンス

Action が正常に作成されました。

all_changes_deployed
boolean
デフォルト:false

Action の内容がすべてデプロイされている場合は true。

built_at
string<date-time>
デフォルト:2021-01-01T00:00:00.000Z

この Action のビルドが正常に完了した日時。

code
string
デフォルト:module.exports = () => {}

Action のソースコード。

created_at
string<date-time>
デフォルト:2021-01-01T00:00:00.000Z

この Action が作成された日時。

dependencies
object[]

この Action が依存するサードパーティの npm モジュールとそのバージョンの一覧。

deploy
boolean
デフォルト:false

作成後に Action をデプロイする場合は true。

deployed_version
object

現在デプロイされているActionのバージョン。

id
string
デフォルト:910b1053-577f-4d81-a8c8-020e7319a38a

Action の一意の ID。

installed_integration_id
string
デフォルト:7d2bc0c9-c0c2-433a-9f4e-86ef80270aad

installed_integration_id は InstalledIntegration エンティティへの外部キー参照です。

integration
object

統合は、パートナーが公開する自己完結型の機能単位を定義します。 パートナーは、このような統合を1つまたは複数作成できます。

modules
object[]

この Action で使用される Action Module とそのバージョンの一覧。

name
string
デフォルト:my-action

Action の名前。

runtime
string
デフォルト:node22

Node ランタイム。例: node22。デフォルトは node22

secrets
object[]

Action またはそのバージョンに含まれるシークレットの一覧。

status
enum<string>
デフォルト:built

このActionのビルドステータス。

利用可能なオプション:
pending,
building,
packaged,
built,
retrying,
failed
supported_triggers
object[]

この Action がサポートするトリガーの一覧。現時点では、Action は一度に 1 つのトリガーのみを対象にできます。

Minimum array length: 1
updated_at
string<date-time>
デフォルト:2021-01-01T00:00:00.000Z

この Action が更新された日時。