Create a hook

POST /api/hooks

Create a new hook with the given data.

application/json

Body Required

  • name string

    The name of the hook.

    Minimum length is 1, maximum length is 256.

  • event string | null Deprecated

    Use events instead.

    Values are PostRegister, PostSignIn, or PostResetPassword.

  • events array[string]

    An array of hook events.

    Values are PostRegister, PostSignIn, or PostResetPassword.

  • config object Required
    Hide config attributes Show config attributes
  • enabled boolean

Responses

  • 201

    The hook was created successfully.

  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

POST /api/hooks
curl \
 -X POST https://[tenant_id].logto.app/api/hooks \
 -H "Content-Type: application/json" \
 -d '{"name":"string","event":"PostRegister","events":["PostRegister"],"config":{"url":"string","headers":{},"retries":42.0},"enabled":true,"createdAt":42.0}'
Request example
{
  "name": "string",
  "event": "PostRegister",
  "events": [
    "PostRegister"
  ],
  "config": {
    "url": "string",
    "headers": {},
    "retries": 42.0
  },
  "enabled": true,
  "createdAt": 42.0
}