# Create a Webhook Create a new webhook by registering a callback URL and specifying which events to listen for. You can create a new webhook using POST method and adding all necessary parameters to request body. Include one of the following content types in your request header: Content-Type: application/x-www-form-urlencoded or application/json Endpoint: POST /webhooks Version: 2.0.0 Security: oauth2, apiKey ## Request fields (application/json): - `workspace_id` (integer, required) ID of the workspace (Team.id from owner_user_rel table) Example: 1 - `url` (string, required) The callback URL where webhook events will be sent Example: "https://example.com/webhook/endpoint" - `events` (array, required) Array of event types to subscribe to Enum: "tracker.started", "tracker.stopped" ## Response 200 fields (application/json): - `success` (boolean) Example: true - `data` (object) - `data.id` (string, required) Encoded ID of the webhook Example: "abc123def456" - `data.url` (string, required) The callback URL where webhook events will be sent Example: "https://example.com/webhook/endpoint" - `data.events` (array, required) Array of event types that this webhook is subscribed to Enum: "tracker.started", "tracker.stopped" - `data.token` (string, required) Secret token for verifying webhook authenticity Example: "whsec_1234567890abcdef" ## Response 400 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 401 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 422 fields (application/json): - `success` (boolean, required) - `message` (string, required) Example: "Validation failed" - `errors` (object, required) Object containing validation error messages for each field Example: {"email":["The email field is required.","The email must be a valid email address."],"firstname":["The firstname field is required."],"role":["The selected role is invalid."]} - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 500 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string)