> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# Webhook

Supports:
* ✅ Model sync destination


## Connection

### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>auth_method</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Authentication method<br/><br/>Accepted values: `polytomic_secret` <a href="#auth-method-polytomic-secret">↓</a>, `basic` <a href="#auth-method-basic">↓</a>, `header` <a href="#auth-method-header">↓</a>, `query` <a href="#auth-method-query">↓</a>, `oauth_client_credentials` <a href="#auth-method-oauth-client-credentials">↓</a></td>
<td><code>required</code></td>
</tr>
<tr>
<td><code>headers</code></td>
<td><code>array</code></td>
<td style="vertical-align: top;">Additional headers</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>url</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Webhook URL</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

<a id="auth-method-polytomic-secret"></a>

#### `auth_method`

When `auth_method` is `polytomic_secret`:

<table>
<thead>
<tr>
<th>Read-only property</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>secret</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Secret</td>
</tr>
</tbody>
</table>

<a id="auth-method-basic"></a>

When `auth_method` is `basic`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>basic</code></td>
<td><code>object</code></td>
<td style="vertical-align: top;">Basic authentication</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Webhook connection",
  "type": "webhook",
  "configuration": {
    "auth_method": "basic",
    "basic": {
      "password": "secret",
      "username": "user@example.com"
    },
    "headers": [
      {
        "name": "foo",
        "value": "bar"
      }
    ],
    "url": "https://example.com/webhook"
  }
}
```

<a id="auth-method-header"></a>

When `auth_method` is `header`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>header</code></td>
<td><code>object</code></td>
<td style="vertical-align: top;">Header</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Webhook connection",
  "type": "webhook",
  "configuration": {
    "auth_method": "header",
    "header": {
      "name": "foo",
      "value": "bar"
    },
    "headers": [
      {
        "name": "foo",
        "value": "bar"
      }
    ],
    "url": "https://example.com/webhook"
  }
}
```

<a id="auth-method-query"></a>

When `auth_method` is `query`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>query</code></td>
<td><code>array</code></td>
<td style="vertical-align: top;">Query string authentication parameters</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Webhook connection",
  "type": "webhook",
  "configuration": {
    "auth_method": "query",
    "headers": [
      {
        "name": "foo",
        "value": "bar"
      }
    ],
    "query": [
      {
        "name": "foo",
        "value": "bar"
      }
    ],
    "url": "https://example.com/webhook"
  }
}
```

<a id="auth-method-oauth-client-credentials"></a>

When `auth_method` is `oauth_client_credentials`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>oauth</code></td>
<td><code>object</code></td>
<td style="vertical-align: top;">OAuth client credentials</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Webhook connection",
  "type": "webhook",
  "configuration": {
    "auth_method": "oauth_client_credentials",
    "headers": [
      {
        "name": "foo",
        "value": "bar"
      }
    ],
    "oauth": {
      "auth_style": 0,
      "client_id": "client_id",
      "client_secret": "client_secret",
      "extra_form_data": [
        {
          "name": "foo",
          "value": "bar"
        }
      ],
      "scopes": [],
      "token_endpoint": "https://example.com/oauth/token"
    },
    "url": "https://example.com/webhook"
  }
}
```


#### Example

```json
{
  "name": "Webhook connection",
  "type": "webhook",
  "configuration": {
    "auth_method": "polytomic_secret",
    "headers": [
        {
            "name": "foo",
            "value": "bar"
        }
    ],
    "url": "https://example.com/webhook"
  }
}
```


## Model Sync
### Target
Webhook connections may be used as the destination in a model sync.
#### All targets

##### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>batch_size</code></td>
<td><code>integer</code></td>
<td style="vertical-align: top;">Batch size per request</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>metadata</code></td>
<td><code>array</code></td>
<td style="vertical-align: top;">Metadata</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>record_requests</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Capture webhook requests and responses</td>
<td><code>optional</code></td>
</tr>
</tbody>
</table>


##### Example
```json
{
  ...
  "target": {
      "configuration": {
        "batch_size": 100,
        "metadata": [],
        "record_requests": true
    }
  }
}
```