# registerWebhookSubscription

Source: /openapi/thomas-federated.openapi.json

## Operation

| Method | URL |
|---|---|
| POST | https://cxi-api-prod-weu-interim-eraffmdbdmdmbdfz.a01.azurefd.net/v1/webhook-subscriptions |

| Field | Value |
|---|---|
| operationId | registerWebhookSubscription |
| method | POST |
| server | https://cxi-api-prod-weu-interim-eraffmdbdmdmbdfz.a01.azurefd.net/v1 |
| path | /webhook-subscriptions |
| tags | `Partner Events & Webhooks` |
| summary | Register a webhook endpoint |
| badges | None |

## Request Parameters

| Name | In | Required | Schema | Description |
|---|---|---|---|---|
| Idempotency-Key | header | true | string | An opaque client-generated key, 1-255 visible ASCII characters excluding comma. Repeating a request with the same key and the same body returns the ORIGINAL response — including the secret it minted — instead of minting a second one. |

## Request Body

| Content type | Schema refs |
|---|---|
| application/json | #/components/schemas/WebhookSubscriptionCreateRequestDto |

## Responses

| Status | Description | Schema refs |
|---|---|---|
| 201 | The subscription was configured. `signingSecret` is shown here and nowhere else. | #/components/schemas/WebhookSubscriptionCreateResponseDto |
| 400 | The request could not be accepted as sent. | #/components/schemas/ApiErrorResponseDto |
| 401 | Invalid or missing authentication token (AUTH_TOKEN_INVALID) | #/components/schemas/ApiErrorResponseDto |
| 403 | Only a provisioned Partner-owned API client may call this operation | #/components/schemas/ApiErrorResponseDto |
| 409 | The request conflicts with the current state of this API client. | #/components/schemas/ApiErrorResponseDto |
| 422 | The webhook endpoint is not a safe public HTTPS destination. | #/components/schemas/ApiErrorResponseDto |
| 429 | Rate limit exceeded. | #/components/schemas/ApiErrorResponseDto |
| 503 | This deployment has no webhook signing key provisioned | #/components/schemas/ApiErrorResponseDto |

### Response 429 headers

| Name | Description | Schema |
|---|---|---|
| Retry-After | Seconds until the rate-limit block expires before retrying. | {"type":"integer","minimum":0} |
| RateLimit-Limit | Configured request limit for the active rate-limit window. | {"type":"integer"} |
| RateLimit-Remaining | Requests remaining in the active rate-limit window; zero when blocked. | {"type":"integer"} |
| RateLimit-Reset | Seconds until the rate-limit block expires. | {"type":"integer","minimum":0} |

## Artifact Examples

### Response 400 example — HTTP_BAD_REQUEST

```json
{
  "statusCode": 400,
  "message": "Validation failed",
  "error": "HTTP_BAD_REQUEST"
}
```

### Response 400 example — IDEMPOTENCY_KEY_INVALID

```json
{
  "statusCode": 400,
  "message": "Exactly one valid Idempotency-Key header is required",
  "error": "IDEMPOTENCY_KEY_INVALID"
}
```

### Response 401 example

```json
{
  "statusCode": 401,
  "message": "Invalid or missing authentication token",
  "error": "AUTH_TOKEN_INVALID"
}
```

### Response 403 example

```json
{
  "statusCode": 403,
  "message": "API client is not permitted to call this operation",
  "error": "PRINCIPAL_TYPE_NOT_ALLOWED"
}
```

### Response 409 example — WEBHOOK_SUBSCRIPTION_ALREADY_EXISTS

```json
{
  "statusCode": 409,
  "message": "This API client already has a webhook subscription",
  "error": "WEBHOOK_SUBSCRIPTION_ALREADY_EXISTS"
}
```

### Response 409 example — IDEMPOTENCY_KEY_REUSED

```json
{
  "statusCode": 409,
  "message": "This Idempotency-Key was already used for a different request",
  "error": "IDEMPOTENCY_KEY_REUSED"
}
```

### Response 409 example — IDEMPOTENCY_REQUEST_IN_PROGRESS

```json
{
  "statusCode": 409,
  "message": "An equivalent request is already in progress",
  "error": "IDEMPOTENCY_REQUEST_IN_PROGRESS"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_INVALID

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must be a valid URL",
  "error": "WEBHOOK_ENDPOINT_INVALID"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_HTTPS_REQUIRED

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must use HTTPS",
  "error": "WEBHOOK_ENDPOINT_HTTPS_REQUIRED"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_PORT_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must use the default HTTPS port",
  "error": "WEBHOOK_ENDPOINT_PORT_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_TOO_LONG

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must be at most 2048 characters",
  "error": "WEBHOOK_ENDPOINT_TOO_LONG"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_CREDENTIALS_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must not contain credentials",
  "error": "WEBHOOK_ENDPOINT_CREDENTIALS_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_FRAGMENT_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must not contain a fragment",
  "error": "WEBHOOK_ENDPOINT_FRAGMENT_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_DNS_EMPTY

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint hostname returned no addresses",
  "error": "WEBHOOK_ENDPOINT_DNS_EMPTY"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_PRIVATE_ADDRESS_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must not resolve to a private address",
  "error": "WEBHOOK_ENDPOINT_PRIVATE_ADDRESS_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_METADATA_ADDRESS_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must not resolve to a cloud metadata address",
  "error": "WEBHOOK_ENDPOINT_METADATA_ADDRESS_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_IPV4_EMBEDDED_IPV6_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint must not resolve to an IPv4-embedded IPv6 address",
  "error": "WEBHOOK_ENDPOINT_IPV4_EMBEDDED_IPV6_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_REDIRECT_FORBIDDEN

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint reachability redirects are not followed",
  "error": "WEBHOOK_ENDPOINT_REDIRECT_FORBIDDEN"
}
```

### Response 422 example — WEBHOOK_ENDPOINT_REACHABILITY_FAILED

```json
{
  "statusCode": 422,
  "message": "Webhook endpoint could not be reached over TLS",
  "error": "WEBHOOK_ENDPOINT_REACHABILITY_FAILED"
}
```

### Response 429 example

```json
{
  "statusCode": 429,
  "message": "ThrottlerException: Too Many Requests",
  "error": "HTTP_TOO_MANY_REQUESTS"
}
```

### Response 503 example

```json
{
  "statusCode": 503,
  "message": "Webhook signing is not configured on this deployment",
  "error": "WEBHOOK_SIGNING_NOT_CONFIGURED"
}
```
