> This page is optimized for agents. Use the linked Markdown pages and llms.txt indexes for related API content.

# Create a webhook. The response holds the signing secret once.

- Product: Reachiz API
- Section: Webhooks
- Snapshot: v1
- Method: `POST`
- Path: `/v1/webhooks`

## Request body

Required: yes  
Content types: `application/json`  

### `name`

Type: `string`  
Required: yes  

### `url`

Type: `string`  
Format: `uri`  
Required: yes  

### `event`

Type: `string`  
Required: yes  
Allowed values: `invite_sent`, `invite_accepted`, `message_sent`, `message_reply`, `inmail_sent`, `inmail_reply`, `follow_sent`, `post_liked`, `profile_viewed`, `campaign_completed`, `lead_tag_updated`, `lead_finished_without_reply`, `every_reply`, `lead_auto_tagged_positive`, `lead_auto_tagged_negative`, `lead_auto_tagged_generic`  

### `campaignIds`

Type: `number[]`  
Required: no  

Only events of these campaigns. Empty means all.

#### number

Type: `number`  

### `active`

Type: `boolean`  
Required: no  
Default: `true`  

## Execute with curl

```bash
curl -X POST "https://prestigious-goldfish-661.convex.site/v1/webhooks" \
    -H "Authorization: Bearer $REACHIZ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name":"<name>","url":"<url>","event":"invite_sent"}'
```

## Execute with TypeScript

```ts
const response = await fetch("https://prestigious-goldfish-661.convex.site/v1/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.REACHIZ_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name":"<name>","url":"<url>","event":"invite_sent"}),
});

const data = await response.json();
```

## Responses

### Response `201`

Category: success  

Success

#### `application/json`

##### Generated example

```json
{
  "id": 0,
  "name": "name",
  "url": "url",
  "event": "invite_sent",
  "campaignIds": [
    0
  ],
  "active": true,
  "createdAt": "createdAt",
  "secret": "secret"
}
```

##### Schema

###### object

Type: `object`  

###### `id`

Type: `number`  
Required: yes  

###### `name`

Type: `string`  
Required: yes  

###### `url`

Type: `string`  
Required: yes  

###### `event`

Type: `string`  
Required: yes  
Allowed values: `invite_sent`, `invite_accepted`, `message_sent`, `message_reply`, `inmail_sent`, `inmail_reply`, `follow_sent`, `post_liked`, `profile_viewed`, `campaign_completed`, `lead_tag_updated`, `lead_finished_without_reply`, `every_reply`, `lead_auto_tagged_positive`, `lead_auto_tagged_negative`, `lead_auto_tagged_generic`  

###### `campaignIds`

Type: `number[]`  
Required: yes  

###### number

Type: `number`  

###### `active`

Type: `boolean`  
Required: yes  

###### `createdAt`

Type: `string`  
Format: `date-time`  
Required: yes  

###### `secret`

Type: `string`  
Required: yes  

Signing secret. The API shows it once.

### Response `400`

Category: client-error  

The request is not valid. error.fields lists each problem.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

### Response `401`

Category: client-error  

The API key is missing or not valid.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

### Response `403`

Category: client-error  

The key lacks the scope this route needs.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

### Response `409`

Category: client-error  

The Idempotency-Key belongs to a different request, or the state does not allow this action.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

### Response `429`

Category: client-error  

Too many requests.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

### Response `503`

Category: server-error  

The service is busy. Retry with backoff.

#### `application/json`

##### Generated example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "message",
    "requestId": "requestId",
    "recovery": "recovery",
    "fields": [
      {
        "path": "path",
        "message": "message"
      }
    ]
  }
}
```

##### Schema

###### Error

Type: `Error`  

###### `error`

Type: `object`  
Required: yes  

###### `code`

Type: `string`  
Required: yes  
Allowed values: `invalid_request`, `not_supported`, `unauthorized`, `subscription_required`, `forbidden`, `plan_limit_exceeded`, `workspace_suspended`, `not_found`, `conflict`, `conversation_changed`, `rate_limited`, `internal`, `unavailable`  

###### `message`

Type: `string`  
Required: yes  

###### `requestId`

Type: `string`  
Required: yes  

###### `recovery`

Type: `string`  
Required: no  

What to do next.

###### `fields`

Type: `object[]`  
Required: no  

###### object

Type: `object`  

###### `path`

Type: `string`  
Required: yes  

###### `message`

Type: `string`  
Required: yes  

## Related representations

- [Human documentation](/reachiz/sections/webhooks/operations/post-v1-webhooks/)
- [curl Markdown](/reachiz/sections/webhooks/operations/post-v1-webhooks.md?lang=curl)
- [TypeScript Markdown](/reachiz/sections/webhooks/operations/post-v1-webhooks.md?lang=typescript)
- [site llms.txt](/llms.txt)
- [product llms.txt](/reachiz/llms.txt)
- [snapshot llms.txt](/reachiz/llms.txt)
