---
title: "Test hook"
method: POST
path: "/api/hooks/{id}/test"
tags: ["Hooks"]
---

# Test hook

`POST /api/hooks/{id}/test`

Test the specified hook with the given events and config.

## Path parameters

- `id` string, required

## Request body

- object
  - `events` string[], required — An array of hook events for testing.
  - `config` object, required — The hook configuration for testing.
    - `url` string, required
    - `headers` object
    - `retries` number — Now the retry times is fixed to 3. Keep for backward compatibility.
  - `event` unknown

## Response `204`

The hook test was successful.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Content

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
