# Add a webhook **POST /webhooks** This endpoint add a new webhook. It returns the webhook object. ## Servers - Production server.: https://api.usecollect.com/v1 (Production server.) ## Authentication methods - Basic auth ## Parameters ### Body: application/json (object) - **targetUrl** (string) The URL of the webhook endpoint. - **types** (array[string]) The list of events to enable for this endpoint. - **campaignId** (string) We'll call this endpoint only for this campaignId. - **secretToken** (string) If you specify a secret token, it will be sent with the hook request in the HTTP header. ## Responses ### 200 Success #### Body: application/json (object) - **_id** (string) - **targetUrl** (string) - **status** (string) - **createdAt** (string(date-time)) - **types** (array[string]) - **campaignId** (string) We'll call this endpoint only for this campaignId. - **secretToken** (string) If you specify a secret token, it will be sent with the hook request in the HTTP header. ### 400 Bad Request -- Your request is invalid. ### 401 Unauthorized -- Your API key is wrong. ### 403 Forbidden -- The object requested is hidden for administrators only. ### 404 Not Found -- The specified object could not be found. ### 429 Too Many Requests -- You're requesting too many objects! Slow down! ### 500 Internal Server Error -- We had a problem with our server. Try again later. ### 503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later. [Powered by Bump.sh](https://bump.sh)