Skip to main content
POST
/
management
/
v1
/
projects
/
{projectId}
/
webhooks
Create Webhook
curl --request POST \
  --url https://{cluster}.voucherify.io/management/v1/projects/{projectId}/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-Management-Id: <api-key>' \
  --header 'X-Management-Token: <api-key>' \
  --data '{
  "target_url": "<string>",
  "events": [
    "business_validation_rule.assignment.created"
  ],
  "active": true
}'
{
  "object": "webhook",
  "created_at": "2024-04-30T08:13:55.789Z",
  "id": "wh_ekFHVL6lqC4lDuIFxpETSGa3",
  "events": [
    "redemption.succeeded"
  ],
  "target_url": "your_url",
  "active": true
}

Authorizations

X-Management-Id
string
header
required
X-Management-Token
string
header
required

Path Parameters

projectId
string
required

Provide the unique identifier of the project.

Example:

"proj_TrlkLiH4"

Body

application/json

Defines a webhook configuration.

Request body schema for POST /management/v1/projects/{projectId}/webhooks/{webhookId}.

target_url
string
required

URL address that receives webhooks.

events
enum<string>[]
required

Lists the events that trigger webhook sendout.

active
boolean
default:true

Determines if the webhook configuration is active.

Response

Returns the details about the webhook configuration.

Response body schema for POST /management/v1/projects/{projectId}/webhooks. Response body schema for webhook endpoints.

id
string
required

Unique identifier of the webhook.

Example:

"wh_i45Uez36Uz8XNW6PXC0eyGmb"

object
enum<string>
default:webhook
required

The type of the object represented by JSON.

Available options:
webhook
created_at
string<date-time>
required

Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format.

Example:

"2024-01-02T08:31:46.562Z"

target_url
string
required

URL address that receives webhooks.

events
enum<string>[]
required

Lists the events that trigger webhook sendout.

active
boolean
default:true
required

Determines if the webhook configuration is active.

I