# Send a test event with custom payload. Triggers a test event with a specific event type and custom payload data for a webhook. The event must be enabled for the webhook. Requires the `personio:webhooks:write` scope. # OpenAPI definition ```json { "openapi": "3.0.3", "info": { "title": "Webhooks Management API", "version": "2.0.0", "description": "Endpoints to manage webhooks." }, "servers": [ { "url": "https://api.personio.de" } ], "security": [ { "BearerAuth": [] } ], "paths": { "/v2/webhooks/{id}/test-event": { "post": { "summary": "Send a test event with custom payload.", "description": "Triggers a test event with a specific event type and custom payload data for a webhook.\nThe event must be enabled for the webhook.\nRequires the `personio:webhooks:write` scope.\n", "tags": [ "Webhooks" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The unique identifier of the webhook to send the test event to.", "schema": { "type": "string" } } ], "requestBody": { "$ref": "#/components/requestBodies/SendTestEventRequest" }, "x-path-examples": { "200 send a test event": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/test-event" }, "400 missing required payload data": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/test-event" } }, "responses": { "200": { "$ref": "#/components/responses/WebhookTestEventResponse" }, "400": { "$ref": "#/components/responses/WebhookTestEventBadRequest" }, "403": { "$ref": "#/components/responses/WebhookAccessForbiddenErrorResponse" }, "404": { "$ref": "#/components/responses/WebhookNotFoundErrorResponse" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "SendTestEventRequest": { "description": "Send test event request schema", "type": "object", "required": [ "event_name" ], "properties": { "event_name": { "type": "string", "description": "The name of the event to send (e.g., \"person.created\", \"person.updated\"). Must be one of the events enabled for this webhook.", "example": "person.updated" }, "payload_data": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Key-value pairs using dot notation for nested fields (e.g., \"person.id\" becomes {\"person\": {\"id\": \"value\"}}).\nRequired fields vary by event type (e.g., person events need \"person.id\", document events need \"document.id\" and \"document.owner.id\").\nRefer to the [event catalog](https://developer.personio.de/v2.0/reference/webhooks#event-catalog) for all available events.\n", "example": { "person.id": "123" } } } } }, "requestBodies": { "SendTestEventRequest": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendTestEventRequest" }, "examples": { "200 send a test event": { "$ref": "#/components/examples/SendTestEventPersonRequestPayload" }, "400 missing required payload data": { "$ref": "#/components/examples/SendTestEventMissingPayloadRequestPayload" } } } } } }, "responses": { "WebhookNotFoundErrorResponse": { "description": "The webhook could not be found.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/WebhookTestEventBadRequest/content/application~1problem%2Bjson/schema" }, "examples": { "Resource Not Found": { "$ref": "#/components/examples/WebhookNotFoundErrorResponse" } } } } }, "WebhookAccessForbiddenErrorResponse": { "description": "Access to the webhook is forbidden.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/WebhookTestEventBadRequest/content/application~1problem%2Bjson/schema" }, "examples": { "Access Forbidden": { "$ref": "#/components/examples/WebhookAccessForbiddenErrorResponse" } } } } }, "WebhookTestEventResponse": { "description": "Test event with custom payload triggered successfully.", "content": { "application/json": { "schema": { "type": "object", "properties": { "completed_at": { "type": "string", "format": "date-time", "description": "The timestamp of when the delivery attempt was completed in UTC." }, "event_name": { "type": "string", "description": "The name of the event that was sent." }, "is_delivered": { "type": "boolean", "description": "Indicates whether the delivery was successful." }, "attempts": { "type": "integer", "description": "The number of attempts made to deliver the webhook." }, "status_code": { "type": "integer", "nullable": true, "description": "The status code of the last delivery attempt, if available." } } }, "examples": { "200 send a test event": { "$ref": "#/components/examples/SuccessfulTestEventResponse" } } } } }, "WebhookTestEventBadRequest": { "description": "Bad request - invalid event name, event not enabled, or missing required payload data.", "content": { "application/problem+json": { "schema": { "type": "object", "description": "This object represents an error response.", "properties": { "personio_trace_id": { "type": "string", "example": "aswo3f-a202lfso-312123sld-1230ddd", "description": "A unique ID that was created for this error." }, "timestamp": { "type": "string", "format": "date-time", "example": "2021-05-28T11:17:30.000Z", "description": "The timestamp of when the error occurred." }, "errors": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "example": "Not found", "description": "The title of the error." }, "detail": { "type": "string", "example": "The requested resource was not found.", "description": "A short description about the error." }, "type": { "type": "string", "format": "uri", "example": "https://developer.personio.de/reference/errors#common.requested_resource_not_found", "description": "A link to the developer hub where more information can be found for the encountered error." }, "_meta": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "examples": { "400 missing required payload data": { "$ref": "#/components/examples/TestEventMissingPayloadDataResponse" } } } } } }, "examples": { "WebhookAccessForbiddenErrorResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30Z", "errors": [ { "title": "Access denied", "detail": "Access denied to perform webhook operations" } ] } }, "WebhookNotFoundErrorResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30Z", "errors": [ { "title": "Webhook not found", "detail": "No webhook found matching the given id" } ] } }, "SuccessfulTestEventResponse": { "value": { "completed_at": "2023-01-01T12:51:00.000Z", "event_name": "person.updated", "is_delivered": true, "attempts": 1, "status_code": 200 } }, "SendTestEventPersonRequestPayload": { "value": { "event_name": "person.updated", "payload_data": { "person.id": "456" } } }, "SendTestEventMissingPayloadRequestPayload": { "value": { "event_name": "person.updated", "payload_data": {} } }, "TestEventMissingPayloadDataResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30Z", "errors": [ { "title": "Missing required payload data", "detail": "The test event payload requires field 'person.id' in the 'payload_data' object" } ] } } } } } ```