Test hook

POST /api/hooks/{id}/test

Test the specified hook with the given events and config.

Path parameters

  • id string Required

    The unique identifier of the hook.

application/json

Body Required

  • events array[string] Required

    An array of hook events for testing.

    Values are PostRegister, PostSignIn, PostResetPassword, User.Created, User.Deleted, User.Data.Updated, User.SuspensionStatus.Updated, Role.Created, Role.Deleted, Role.Data.Updated, Role.Scopes.Updated, Scope.Created, Scope.Deleted, Scope.Data.Updated, Organization.Created, Organization.Deleted, Organization.Data.Updated, Organization.Membership.Updated, OrganizationRole.Created, OrganizationRole.Deleted, OrganizationRole.Data.Updated, OrganizationRole.Scopes.Updated, OrganizationScope.Created, OrganizationScope.Deleted, or OrganizationScope.Data.Updated.

  • config object Required

    The hook configuration for testing.

    Additional properties are allowed.

    Hide config attributes Show config attributes object
    • url string Required
    • headers object
      Hide headers attribute Show headers attribute object
      • * string Additional properties
    • retries number Deprecated

      Now the retry times is fixed to 3. Keep for backward compatibility.

  • event Deprecated

    Use events instead.

Responses

POST /api/hooks/{id}/test
curl \
 -X POST https://[tenant_id].logto.app/api/hooks/{id}/test \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"events":["PostRegister"],"config":{"url":"string","headers":{"additionalProperty1":"string","additionalProperty2":"string"},"retries":42.0}}'
Request examples
{
  "events": [
    "PostRegister"
  ],
  "config": {
    "url": "string",
    "headers": {
      "additionalProperty1": "string",
      "additionalProperty2": "string"
    },
    "retries": 42.0
  }
}