# Get webhook events. Returns events for a specific webhook. Only events in the last 30 days will be included. This endpoint requires the `personio:webhooks:read` 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}/events": { "get": { "summary": "Get webhook events.", "description": "Returns events for a specific webhook. Only events in the last 30 days will be included. This endpoint requires the `personio:webhooks:read` scope.", "tags": [ "Webhooks" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The unique identifier of the webhook whose events are to be retrieved.", "schema": { "type": "string" }, "example": "533e7206-f4a3-11ed-9c8b-436fad0b82d1" }, { "name": "occurred_at.gte", "in": "query", "description": "The start date for filtering events by occurred date. Only events occurred on or after this date will be included.", "schema": { "type": "string", "format": "date-time" }, "example": "2023-01-01T12:00:00.000Z" }, { "name": "occurred_at.lte", "in": "query", "description": "The end date for filtering events by occurred date. Only events occurred on or before this date will be included.", "schema": { "type": "string", "format": "date-time" }, "example": "2023-01-01T13:00:00.000Z" }, { "name": "event_name", "in": "query", "description": "Enables filtering by event name. Refer to the [event catalog](https://developer.personio.de/v2.0/reference/webhooks#event-catalog) for a list of valid event names.", "schema": { "type": "string" }, "example": "person.updated" }, { "$ref": "#/paths/~1v2~1webhooks/get/parameters/2" }, { "$ref": "#/paths/~1v2~1webhooks/get/parameters/3" } ], "x-path-examples": { "List all events": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/events", "query": "limit=2" }, "Invalid event_name filter": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/events", "query": "event_name=invalid_value" }, "Filter events by date": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/events", "query": "occurred_at.gte=2023-01-01T00:00:00.000Z&occurred_at.lte=2023-01-01T23:59:59.999Z" }, "Resource Not Found": { "value": "/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/events" } }, "responses": { "200": { "$ref": "#/components/responses/WebhookEventsResponse" }, "401": { "$ref": "#/components/responses/WebhookInvalidAuthenticationErrorResponse" }, "403": { "$ref": "#/components/responses/WebhookAccessForbiddenErrorResponse" }, "404": { "$ref": "#/components/responses/WebhookNotFoundErrorResponse" }, "422": { "$ref": "#/components/responses/WebhookEventsBadFilterErrorResponse" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "WebhookEvent": { "description": "Webhook event schema. Refer to the [event payload structure](https://developer.personio.de/v2.0/reference/webhooks#event-payload-structure).", "properties": { "company_id": { "type": "string", "description": "The unique identifier for the company associated with the event." }, "occurred_at": { "type": "string", "format": "date-time", "description": "The timestamp of when the event occurred was completed in UTC." }, "payload": { "type": "object", "description": "The core data associated with the webhook event." }, "meta": { "type": "object", "description": "Metadata providing additional context about the webhook event." }, "event_name": { "type": "string", "description": "The name of the event, identifying its type (e.g., 'employee.created')." } }, "required": [ "company_id", "occurred_at", "payload", "event_name" ] } }, "responses": { "WebhooksResponse": { "description": "Successful list all webhooks response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "_data": { "type": "array", "items": { "$ref": "#/components/schemas/Webhook" } }, "_meta": { "description": "This object represents the metadata information for an object. It's a set of arbitrary key/value attributes such as `links`.", "type": "object", "readOnly": true, "properties": { "links": { "type": "object", "additionalProperties": { "description": "This objects represents a hyperlink.", "type": "object", "readOnly": true, "properties": { "href": { "type": "string", "format": "uri" } }, "additionalProperties": true }, "example": { "links": { "self": { "href": "https://api.personio.de/v2/person?cursor=" } } } } } } } }, "examples": { "List all webhooks": { "$ref": "#/components/examples/ListAllWebhooksResponse" }, "List all webhooks where enabled_events contains person.updated": { "$ref": "#/components/examples/ListAllWebhooksEnabledEventFilterResponse" }, "List all webhooks where status is enabled": { "$ref": "#/components/examples/ListAllWebhooksStatusFilterResponse" } } } } }, "WebhookEventsResponse": { "description": "Successful list of all webhooks events response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "_data": { "type": "array", "items": { "$ref": "#/components/schemas/WebhookEvent" } }, "_meta": { "$ref": "#/components/responses/WebhooksResponse/content/application~1json/schema/properties/_meta" } } }, "examples": { "List all events": { "$ref": "#/components/examples/ListAllEvents" }, "Filter events by date": { "$ref": "#/components/examples/ListAllEvents" } } } } }, "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" } } } } }, "WebhookEventsBadFilterErrorResponse": { "description": "The filters specified with the request are faulty.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/WebhookTestEventBadRequest/content/application~1problem%2Bjson/schema" }, "examples": { "Invalid event_name filter": { "$ref": "#/components/examples/InvalidEventNameFilterResponse" } } } } }, "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" } } } } }, "WebhookInvalidAuthenticationErrorResponse": { "description": "The webhook could not be created due to invalid authentication.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/WebhookTestEventBadRequest/content/application~1problem%2Bjson/schema" }, "examples": { "Invalid authentication type": { "$ref": "#/components/examples/InvalidAuthenticationPayloadResponse" } } } } }, "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": { "ListAllEvents": { "value": { "_data": [ { "company_id": "121315", "occurred_at": "2023-01-01T12:51:00.000Z", "payload": { "person": { "id": "343536" } }, "meta": {}, "event_name": "person.created" }, { "company_id": "121315", "occurred_at": "2023-01-01T12:03:00.000Z", "payload": { "person": { "id": "783123" } }, "meta": {}, "event_name": "person.created" } ], "_meta": { "links": { "next": { "href": "https://api.personio.de/v2/webhooks/533e7206-f4a3-11ed-9c8b-436fad0b82d1/events?cursor=cur_ZXZlbnRfaWQ9MDFKRFFBU0NBUjRDQkZTUUZEMEJUMlFQMVAmaWQ9MDE5MzZlYTktZjdjZC1jOTFjLTA1NDItODVjOGNhNTk1ZTVkJmxpbWl0PTEmb2NjdXJyZWRfYXQ9MjAyNC0xMS0yN1QxNzozMDozMS42MTFa" } } } } }, "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" } ] } }, "InvalidEventNameFilterResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30Z", "errors": [ { "title": "Payload contains invalid events", "detail": "Invalid events: [invalid_value]" } ] } }, "InvalidAuthenticationPayloadResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30Z", "errors": [ { "title": "Invalid authentication", "detail": "The authentication type is unsupported." } ] } } } } } ```