# Webhooks and events (Native /v1)

> Tickwire API reference, generated from the OpenAPI document the services export. Base URL: https://api.tickwire.io. Replace YOUR_API_KEY and YOUR_ACCOUNT_ID with your own values; use a sandbox key (twsk_…) to experiment.

Source: https://tickwire.io/docs/reference/webhooks/

### POST /v1/events/{event_id}/resend

**Resend Event** · takes `Idempotency-Key`

Auth: `X-API-Key`

Queue an event again to every endpoint that received it (or `webhookId`).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `event_id` | path | `string` | yes |  |
| `webhookId` | query | `string \| null` | no |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `202` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/events/EVENT_ID/resend' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/events/EVENT_ID/resend",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/events/EVENT_ID/resend", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### GET /v1/webhook-event-types

**Event Types**

Auth: `X-API-Key`

Every webhook event type, with a description, its source and an example envelope.

Responses:

- `200` Successful Response

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhook-event-types' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhook-event-types",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhook-event-types");
console.log(result);
tw.close();
```

### POST /v1/webhook-events/trigger

**Trigger** · takes `Idempotency-Key`

Auth: `X-API-Key`

Publish one test event of a catalog type (any type in the sandbox; live: `webhook.test`).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Request body: `TriggerBody` (required)

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `string` | yes |  |
| `accountId` | `string \| null` | no |  |

Responses:

- `202` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhook-events/trigger' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this' \
  -H 'Content-Type: application/json' \
  -d '{"type":"string"}'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhook-events/trigger",
        json={"type": "string"},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhook-events/trigger", {
  body: {"type":"string"},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### POST /v1/webhook-listeners

**Create Listener**

Auth: `X-API-Key`

Start a local-forwarding listener: its signing secret and the current cursor.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `201` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhook-listeners' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhook-listeners",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhook-listeners", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### GET /v1/webhook-listeners/{listener_id}/events

**Listener Events**

Auth: `X-API-Key`

The tenant's events after the `after` cursor, each signed with the listener secret.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `listener_id` | path | `string` | yes |  |
| `after` | query | `string` | no |  |
| `types` | query | `string[] \| null` | no |  |
| `limit` | query | `integer` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhook-listeners/LISTENER_ID/events' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhook-listeners/LISTENER_ID/events",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhook-listeners/LISTENER_ID/events");
console.log(result);
tw.close();
```

### GET /v1/webhooks

**List Webhooks**

Auth: `X-API-Key`

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhooks' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhooks",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhooks");
console.log(result);
tw.close();
```

### POST /v1/webhooks

**Create Webhook**

Auth: `X-API-Key`

Request body: `CreateWebhook` (required)

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | yes |  |
| `secret` | `string \| null` | no |  |

Responses:

- `201` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/hook"}'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks",
        json={"url": "https://example.com/hook"},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks", {
  body: {"url":"https://example.com/hook"},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### GET /v1/webhooks/{webhook_id}

**Get Webhook**

Auth: `X-API-Key`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhooks/WEBHOOK_ID",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhooks/WEBHOOK_ID");
console.log(result);
tw.close();
```

### PATCH /v1/webhooks/{webhook_id}

**Patch Endpoint** · takes `Idempotency-Key`

Auth: `X-API-Key`

Change the event filter (`enabledEvents`), URL or description.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Request body: `PatchEndpoint` (required)

| Field | Type | Required | Description |
|---|---|---|---|
| `enabledEvents` | `string[] \| null` | no |  |
| `url` | `string \| null` | no |  |
| `description` | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X PATCH 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "PATCH",
        "/v1/webhooks/WEBHOOK_ID",
        json={},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("PATCH", "/v1/webhooks/WEBHOOK_ID", {
  body: {},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### DELETE /v1/webhooks/{webhook_id}

**Delete Webhook**

Auth: `X-API-Key`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |

Responses:

- `204` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X DELETE 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "DELETE",
        "/v1/webhooks/WEBHOOK_ID",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("DELETE", "/v1/webhooks/WEBHOOK_ID", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### GET /v1/webhooks/{webhook_id}/deliveries

**List Deliveries**

Auth: `X-API-Key`

The endpoint's deliveries, newest first (`{data, hasMore, nextCursor}`).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `status` | query | `string \| null` | no |  |
| `eventType` | query | `string \| null` | no |  |
| `eventId` | query | `string \| null` | no |  |
| `since` | query | `string \| null` | no |  |
| `until` | query | `string \| null` | no |  |
| `cursor` | query | `string \| null` | no |  |
| `limit` | query | `integer` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/deliveries' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhooks/WEBHOOK_ID/deliveries",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhooks/WEBHOOK_ID/deliveries");
console.log(result);
tw.close();
```

### GET /v1/webhooks/{webhook_id}/deliveries/{delivery_id}

**Get Delivery**

Auth: `X-API-Key`

One delivery with every attempt, the signed payload and the last response body.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `delivery_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID");
console.log(result);
tw.close();
```

### POST /v1/webhooks/{webhook_id}/deliveries/{delivery_id}/resend

**Resend Delivery** · takes `Idempotency-Key`

Auth: `X-API-Key`

Queue this delivery's event again to the endpoint. Returns the new delivery (202).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `delivery_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `202` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/resend' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/resend",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/resend", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### POST /v1/webhooks/{webhook_id}/disable

**Disable Endpoint** · takes `Idempotency-Key`

Auth: `X-API-Key`

Stop deliveries to an endpoint; unfinished deliveries are closed as failed.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/disable' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks/WEBHOOK_ID/disable",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks/WEBHOOK_ID/disable", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### POST /v1/webhooks/{webhook_id}/enable

**Enable Endpoint** · takes `Idempotency-Key`

Auth: `X-API-Key`

Re-enable an endpoint (after an automatic disable, or your own).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/enable' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks/WEBHOOK_ID/enable",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks/WEBHOOK_ID/enable", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### POST /v1/webhooks/{webhook_id}/reveal-secret

**Reveal Secret**

Auth: `X-API-Key`

The current signing secret (and the previous one during a rotation overlap).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/reveal-secret' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'X-Reason: why you are doing this'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks/WEBHOOK_ID/reveal-secret",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks/WEBHOOK_ID/reveal-secret", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### POST /v1/webhooks/{webhook_id}/rotate-secret

**Rotate Secret** · takes `Idempotency-Key`

Auth: `X-API-Key`

New signing secret; the old one stays valid for `overlapHours` (default 24).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string \| null` | no |  |
| `X-Actor` | header | `string \| null` | no |  |
| `X-Reason` | header | `string \| null` | no |  |

Request body: `RotateSecret | null`

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `409` [`idempotency_conflict`](https://tickwire.io/docs/errors/idempotency_conflict/)

curl:

```bash
curl -sS -X POST 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/rotate-secret' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'X-Reason: why you are doing this' \
  -H 'Content-Type: application/json' \
  -d '{"overlapHours":24}'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/webhooks/WEBHOOK_ID/rotate-secret",
        json={"overlapHours": 24},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/webhooks/WEBHOOK_ID/rotate-secret", {
  body: {"overlapHours":24},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```

### GET /v1/webhooks/{webhook_id}/settings

**Endpoint Settings**

Auth: `X-API-Key`

Endpoint status, failure streak, event filter and secret-rotation state.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `webhook_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/v1/webhooks/WEBHOOK_ID/settings' \
  -H 'X-API-Key: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/webhooks/WEBHOOK_ID/settings",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/webhooks/WEBHOOK_ID/settings");
console.log(result);
tw.close();
```
