---
title: "Generate hook payload"
method: POST
path: "/api/v1/hooks/{hookID}/generate_payload"
tags: ["Hook"]
---

# Generate hook payload

`POST /api/v1/hooks/{hookID}/generate_payload`

Users can use this endpoint to test the hook on a payload of specific events and actions.

The token used for calling the endpoint is returned as `rossum_authorization_token` regardless of the `token_owner` of the hook.
Values in `secrets` are redacted for security reasons. The payload for email events from this endpoint may differ from the original hook payload in the file ids, height, width, and format of email addresses in headers.

## Path parameters

- `hookID` integer, required

## Request body

- object
  - `action` string, required — Hook's [action](/guides/extensions#webhook-extension).
  - `event` string, required — Hook's [event](/guides/extensions#webhook-extension).
  - `annotation` string, uri — URL of related Annotation object. Required for annotation_status and annotation_content events.
  - `previous_status` string — A previous status of the document. See [Annotation Lifecycle](/guides/annotation-lifecycle) for a list of supported values. Required for annotation_status and annotation_content events.
  - `status` string — Status of the document. See [Annotation Lifecycle](/guides/annotation-lifecycle) for a list of supported values. Required for annotation_status and annotation_content events.
  - `email` string, uri — URL of the arriving email. Required for email event.
  - `upload` string, uri — URL of an upload instance. Required for upload event.

## Response `200`

OK

- object — Hook payload for specific event and action.
  - `request_id` string — Request ID.
  - `timestamp` string, date-time — Timestamp.
  - `base_url` string, uri — Base URL.
  - `rossum_authorization_token` string — Authorization token.
  - `hook` string, uri — Hook URL.
  - `settings` object — Hook settings.
  - `secrets` object — Hook secrets (values redacted).
  - `action` string — Action.
  - `event` string — Event.

## Other responses

- `400` — Invalid input data.
- `401` — The username/password is invalid or token is invalid (e.g. expired).
- `403` — Insufficient permission, missing authentication, invalid CSRF token and similar issue.
- `404` — The specified resource was not found.
- `409` — Conflict
- `413` — Payload too large (especially for files uploaded).
- `429` — Request rate is too high, wait before sending more requests. See [Rate Limiting](/guides/overview#rate-limiting) for more details.
- `500` — Server failure while processing the request.
- `502` — Invalid response from the upstream server.
- `503` — We're temporarily offline for maintenance. Please try again later.
- `504` — Upstream server could not complete the request in time.

---

[API](https://skmtc.dev/rossum/apis/rossum-api.md) · [All operations](https://skmtc.dev/rossum/apis/rossum-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rossum/rossum-api/revisions/f1b5a910991d/schema)
