# Create webhook

Tool: `veryfront__create_webhook`

Create a webhook when an external service must start an agent, task or workflow run, or when its deliveries must only be stored as webhook events; returns the webhook and its secret, which is shown only once. Requires project.agents.write.

## Arguments

| Name                | Type                                     | Required | Description                                                                                       |
| ------------------- | ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| `project_reference` | string                                   |          | Project ID or slug.                                                                               |
| `name`              | string · min length 1 · max length 120   | Yes      | Webhook name, 1-120 characters.                                                                   |
| `target`            | object                                   | Yes      | Target invoked by a webhook definition.                                                           |
| `prompt_template`   | string · min length 1 · max length 20000 |          | Prompt template for run targets: required unless target.kind is event, where it is not supported. |
| `event_filter`      | object \| null                           |          | Optional incoming event filter. Missing, null, or empty conditions accept every event.            |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__create_webhook",
    "arguments": {
      "name": "string",
      "target": {
        "kind": "agent",
        "id": "string"
      }
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"webhook\":{\"id\":\"00000000-0000-0000-0000-000000000000\",\"project_id\":\"00000000-0000-0000-0000-000000000000\",\"name\":\"string\",\"source\":\"webhook\",\"target\":{\"kind\":\"agent\",\"id\":\"string\",\"conversation_mode\":\"create_new\",\"conversation_id\":\"00000000-0000-0000-0000-000000000000\"},\"prompt_template\":\"string\",\"event_filter\":{\"mode\":\"all\",\"conditions\":[{\"path\":\"string\",\"operator\":\"equals\",\"value\":null}]},\"status\":\"draft\",\"runtime_target_kind\":\"main_branch\",\"runtime_target_environment_id\":\"00000000-0000-0000-0000-000000000000\",\"runtime_target_branch_id\":\"00000000-0000-0000-0000-000000000000\",\"definition_source\":\"manual\",\"source_trigger_id\":\"string\",\"source_path\":\"string\",\"source_hash\":\"string\",\"ingress_id\":\"string\",\"webhook_url\":\"string\",\"created_by_user_id\":\"00000000-0000-0000-0000-000000000000\",\"enabled_at\":\"string\",\"disabled_at\":\"string\",\"disabled_reason\":\"string\",\"created_at\":\"string\",\"updated_at\":\"string\"},\"webhook_secret\":\"string\"}"
      }
    ],
    "structuredContent": {
      "webhook": {
        "id": "00000000-0000-0000-0000-000000000000",
        "project_id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "source": "webhook",
        "target": {
          "kind": "agent",
          "id": "string",
          "conversation_mode": "create_new",
          "conversation_id": "00000000-0000-0000-0000-000000000000"
        },
        "prompt_template": "string",
        "event_filter": {
          "mode": "all",
          "conditions": [
            {
              "path": "string",
              "operator": "equals",
              "value": null
            }
          ]
        },
        "status": "draft",
        "runtime_target_kind": "main_branch",
        "runtime_target_environment_id": "00000000-0000-0000-0000-000000000000",
        "runtime_target_branch_id": "00000000-0000-0000-0000-000000000000",
        "definition_source": "manual",
        "source_trigger_id": "string",
        "source_path": "string",
        "source_hash": "string",
        "ingress_id": "string",
        "webhook_url": "string",
        "created_by_user_id": "00000000-0000-0000-0000-000000000000",
        "enabled_at": "string",
        "disabled_at": "string",
        "disabled_reason": "string",
        "created_at": "string",
        "updated_at": "string"
      },
      "webhook_secret": "string"
    }
  }
}
```
