http
POST /projects/{project_reference}/webhooksCreate 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.
Servers
JSON
1[2 {3 "url": "https://api.veryfront.com"4 }5]Authentication
JSON
1[2 {3 "bearerAuth": []4 },5 {6 "apiKeyAuth": []7 }8]JSON
1{2 "bearerAuth": {3 "type": "http",4 "scheme": "bearer",5 "bearerFormat": "JWT or API Key",6 "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."7 },8 "apiKeyAuth": {9 "type": "apiKey",10 "in": "header",11 "name": "X-API-Key",12 "description": "Alternative API key header for `vf_<prefix>_<secret>` tokens."13 }14}Parameters
| Name | Location | Required | Description |
|---|---|---|---|
| project_reference | path | Yes |
Parameter contracts
JSON
1[2 {3 "schema": {4 "type": "string",5 "minLength": 16 },7 "required": true,8 "name": "project_reference",9 "in": "path"10 }11]Request body
JSON
1{2 "content": {3 "application/json": {4 "schema": {5 "type": "object",6 "properties": {7 "name": {8 "type": "string",9 "minLength": 1,10 "maxLength": 120,11 "description": "Webhook name, 1-120 characters."12 },13 "target": {14 "type": "object",15 "properties": {16 "kind": {17 "type": "string",18 "enum": [19 "agent",20 "task",21 "workflow",22 "event"23 ],24 "description": "Target kind invoked or stored by the webhook."25 },26 "id": {27 "type": "string",28 "minLength": 1,29 "maxLength": 128,30 "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."31 },32 "conversation_mode": {33 "type": "string",34 "enum": [35 "create_new",36 "existing",37 "none"38 ],39 "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."40 },41 "conversation_id": {42 "type": [43 "string",44 "null"45 ],46 "format": "uuid",47 "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."48 }49 },50 "required": [51 "kind",52 "id"53 ],54 "additionalProperties": false,55 "description": "Target invoked by a webhook definition."56 },57 "prompt_template": {58 "type": "string",59 "minLength": 1,60 "maxLength": 20000,61 "description": "Prompt template for run targets: required unless target.kind is event, where it is not supported."62 },63 "event_filter": {64 "type": [65 "object",66 "null"67 ],68 "properties": {69 "mode": {70 "type": "string",71 "enum": [72 "all",73 "any"74 ],75 "description": "Whether all or any filter conditions must match."76 },77 "conditions": {78 "type": "array",79 "items": {80 "type": "object",81 "properties": {82 "path": {83 "type": "string",84 "minLength": 1,85 "maxLength": 255,86 "description": "Dot path in the incoming payload, for example action or pull_request.state."87 },88 "operator": {89 "type": "string",90 "enum": [91 "equals",92 "not_equals",93 "in",94 "exists",95 "contains"96 ],97 "description": "Comparison operator."98 },99 "value": {100 "description": "Comparison value for operators that require one."101 }102 },103 "required": [104 "path",105 "operator"106 ],107 "additionalProperties": false108 },109 "maxItems": 50,110 "description": "Filter conditions applied before webhook work is created."111 }112 },113 "required": [114 "mode",115 "conditions"116 ],117 "additionalProperties": false,118 "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."119 }120 },121 "required": [122 "name",123 "target"124 ],125 "additionalProperties": false126 }127 }128 }129}Responses
201
Created webhook
JSON
1{2 "description": "Created webhook",3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "webhook": {9 "type": "object",10 "properties": {11 "id": {12 "type": "string",13 "format": "uuid",14 "description": "The webhook id. Pass it as webhook_id to the other webhook operations."15 },16 "project_id": {17 "type": "string",18 "format": "uuid"19 },20 "name": {21 "type": "string"22 },23 "source": {24 "type": "string",25 "enum": [26 "webhook"27 ]28 },29 "target": {30 "type": "object",31 "properties": {32 "kind": {33 "type": "string",34 "enum": [35 "agent",36 "task",37 "workflow",38 "event"39 ],40 "description": "Target kind invoked or stored by the webhook."41 },42 "id": {43 "type": "string",44 "minLength": 1,45 "maxLength": 128,46 "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."47 },48 "conversation_mode": {49 "type": "string",50 "enum": [51 "create_new",52 "existing",53 "none"54 ],55 "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."56 },57 "conversation_id": {58 "type": [59 "string",60 "null"61 ],62 "format": "uuid",63 "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."64 }65 },66 "required": [67 "kind",68 "id"69 ],70 "additionalProperties": false71 },72 "prompt_template": {73 "type": [74 "string",75 "null"76 ]77 },78 "event_filter": {79 "type": [80 "object",81 "null"82 ],83 "properties": {84 "mode": {85 "type": "string",86 "enum": [87 "all",88 "any"89 ],90 "description": "Whether all or any filter conditions must match."91 },92 "conditions": {93 "type": "array",94 "items": {95 "type": "object",96 "properties": {97 "path": {98 "type": "string",99 "minLength": 1,100 "maxLength": 255,101 "description": "Dot path in the incoming payload, for example action or pull_request.state."102 },103 "operator": {104 "type": "string",105 "enum": [106 "equals",107 "not_equals",108 "in",109 "exists",110 "contains"111 ],112 "description": "Comparison operator."113 },114 "value": {115 "description": "Comparison value for operators that require one."116 }117 },118 "required": [119 "path",120 "operator"121 ],122 "additionalProperties": false123 },124 "maxItems": 50,125 "description": "Filter conditions applied before webhook work is created."126 }127 },128 "required": [129 "mode",130 "conditions"131 ],132 "additionalProperties": false,133 "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."134 },135 "status": {136 "type": "string",137 "enum": [138 "draft",139 "enabled",140 "disabled"141 ]142 },143 "runtime_target_kind": {144 "type": "string",145 "enum": [146 "main_branch",147 "environment",148 "preview_branch"149 ]150 },151 "runtime_target_environment_id": {152 "type": [153 "string",154 "null"155 ],156 "format": "uuid"157 },158 "runtime_target_branch_id": {159 "type": [160 "string",161 "null"162 ],163 "format": "uuid"164 },165 "definition_source": {166 "type": "string",167 "enum": [168 "manual",169 "source"170 ]171 },172 "source_trigger_id": {173 "type": [174 "string",175 "null"176 ]177 },178 "source_path": {179 "type": [180 "string",181 "null"182 ]183 },184 "source_hash": {185 "type": [186 "string",187 "null"188 ]189 },190 "ingress_id": {191 "type": "string",192 "description": "The public id in webhook_url that external senders post to."193 },194 "webhook_url": {195 "type": "string"196 },197 "created_by_user_id": {198 "type": "string",199 "format": "uuid"200 },201 "enabled_at": {202 "type": [203 "string",204 "null"205 ]206 },207 "disabled_at": {208 "type": [209 "string",210 "null"211 ]212 },213 "disabled_reason": {214 "type": [215 "string",216 "null"217 ]218 },219 "created_at": {220 "type": "string"221 },222 "updated_at": {223 "type": "string"224 }225 },226 "required": [227 "id",228 "project_id",229 "name",230 "source",231 "target",232 "prompt_template",233 "event_filter",234 "status",235 "runtime_target_kind",236 "runtime_target_environment_id",237 "runtime_target_branch_id",238 "definition_source",239 "source_trigger_id",240 "source_path",241 "source_hash",242 "ingress_id",243 "webhook_url",244 "created_by_user_id",245 "enabled_at",246 "disabled_at",247 "disabled_reason",248 "created_at",249 "updated_at"250 ]251 },252 "webhook_secret": {253 "type": "string",254 "description": "Secret for the X-Veryfront-Webhook-Secret header. Returned only once, on create; store it now."255 }256 },257 "required": [258 "webhook",259 "webhook_secret"260 ]261 }262 }263 }264}400
invalid_input: invalid body or parameters
JSON
1{2 "description": "invalid_input: invalid body or parameters",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}401
unauthenticated
JSON
1{2 "description": "unauthenticated",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}403
forbidden: a project member without the required capability
JSON
1{2 "description": "forbidden: a project member without the required capability",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}404
not_found: project or webhook not found or not visible
JSON
1{2 "description": "not_found: project or webhook not found or not visible",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}500
internal
JSON
1{2 "description": "internal",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}503
internal: authentication state is temporarily unavailable and the request was not processed; retry shortly
JSON
1{2 "description": "internal: authentication state is temporarily unavailable and the request was not processed; retry shortly",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}Referenced contracts
components/schemas/Problem
JSON
1{2 "type": "object",3 "properties": {4 "cause": {5 "type": "string",6 "enum": [7 "schedule_concurrency_forbidden",8 "schedule_fire_in_progress",9 "schedule_run_limit_reached"10 ],11 "description": "Schedule admission refusal."12 },13 "idempotency": {14 "type": "object",15 "properties": {16 "state": {17 "type": "string",18 "enum": [19 "in_progress",20 "payload_mismatch",21 "outcome_unknown"22 ]23 },24 "operation": {25 "type": "string",26 "minLength": 127 },28 "retryable": {29 "type": "boolean"30 },31 "retry_after_seconds": {32 "type": [33 "integer",34 "null"35 ],36 "minimum": 037 },38 "expires_at": {39 "type": [40 "string",41 "null"42 ]43 },44 "recovery": {45 "type": "object",46 "properties": {47 "available": {48 "type": "boolean"49 },50 "description": {51 "type": "string"52 },53 "resource_url": {54 "type": "string"55 }56 },57 "required": [58 "available",59 "description"60 ]61 }62 },63 "required": [64 "state",65 "operation",66 "retryable",67 "retry_after_seconds",68 "expires_at"69 ],70 "description": "Replay status, retry timing, and recovery lookup."71 },72 "type": {73 "type": "string",74 "description": "URI reference identifying the problem type",75 "example": "https://api.veryfront.com/errors/validation-failed"76 },77 "title": {78 "type": "string",79 "description": "Short human-readable summary of the problem",80 "example": "Validation Failed"81 },82 "status": {83 "type": "integer",84 "minimum": 100,85 "maximum": 599,86 "description": "HTTP status code",87 "example": 40088 },89 "code": {90 "type": "string",91 "description": "Stable machine-readable error code",92 "example": "RUN_INVALID_INPUT"93 },94 "detail": {95 "type": "string",96 "description": "Human-readable explanation specific to this occurrence",97 "example": "The 'email' field must be a valid email address"98 },99 "instance": {100 "type": "string",101 "description": "URI reference identifying the specific occurrence",102 "example": "/projects/my-project/members"103 },104 "slug": {105 "type": "string",106 "description": "Stable identifier for the problem type",107 "example": "validation-failed"108 },109 "category": {110 "type": "string",111 "enum": [112 "AUTH",113 "RESOURCE",114 "VALIDATION",115 "DATABASE",116 "SUBSCRIPTION",117 "INTEGRATION",118 "INTERNAL"119 ],120 "description": "API error category",121 "example": "VALIDATION"122 },123 "suggestion": {124 "type": "string",125 "description": "Suggested action to resolve the problem",126 "example": "Check the request body and query parameters against the API documentation."127 },128 "errors": {129 "type": "array",130 "items": {131 "type": "object",132 "properties": {133 "field": {134 "type": "string",135 "description": "Field path that caused the error",136 "example": "email"137 },138 "message": {139 "type": "string",140 "description": "Error message for this field",141 "example": "Invalid email format"142 },143 "code": {144 "type": "string",145 "description": "Error code for this field",146 "example": "INVALID_FORMAT"147 }148 },149 "required": [150 "field",151 "message"152 ]153 },154 "description": "Detailed field-level errors for validation failures"155 }156 },157 "required": [158 "type",159 "title",160 "status"161 ]162}Operation contract
JSON
1{2 "operationId": "createWebhook",3 "tags": [4 "execution/Triggers/Webhooks"5 ],6 "summary": "Create webhook",7 "description": "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.",8 "parameters": [9 {10 "schema": {11 "type": "string",12 "minLength": 113 },14 "required": true,15 "name": "project_reference",16 "in": "path"17 }18 ],19 "requestBody": {20 "content": {21 "application/json": {22 "schema": {23 "type": "object",24 "properties": {25 "name": {26 "type": "string",27 "minLength": 1,28 "maxLength": 120,29 "description": "Webhook name, 1-120 characters."30 },31 "target": {32 "type": "object",33 "properties": {34 "kind": {35 "type": "string",36 "enum": [37 "agent",38 "task",39 "workflow",40 "event"41 ],42 "description": "Target kind invoked or stored by the webhook."43 },44 "id": {45 "type": "string",46 "minLength": 1,47 "maxLength": 128,48 "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."49 },50 "conversation_mode": {51 "type": "string",52 "enum": [53 "create_new",54 "existing",55 "none"56 ],57 "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."58 },59 "conversation_id": {60 "type": [61 "string",62 "null"63 ],64 "format": "uuid",65 "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."66 }67 },68 "required": [69 "kind",70 "id"71 ],72 "additionalProperties": false,73 "description": "Target invoked by a webhook definition."74 },75 "prompt_template": {76 "type": "string",77 "minLength": 1,78 "maxLength": 20000,79 "description": "Prompt template for run targets: required unless target.kind is event, where it is not supported."80 },81 "event_filter": {82 "type": [83 "object",84 "null"85 ],86 "properties": {87 "mode": {88 "type": "string",89 "enum": [90 "all",91 "any"92 ],93 "description": "Whether all or any filter conditions must match."94 },95 "conditions": {96 "type": "array",97 "items": {98 "type": "object",99 "properties": {100 "path": {101 "type": "string",102 "minLength": 1,103 "maxLength": 255,104 "description": "Dot path in the incoming payload, for example action or pull_request.state."105 },106 "operator": {107 "type": "string",108 "enum": [109 "equals",110 "not_equals",111 "in",112 "exists",113 "contains"114 ],115 "description": "Comparison operator."116 },117 "value": {118 "description": "Comparison value for operators that require one."119 }120 },121 "required": [122 "path",123 "operator"124 ],125 "additionalProperties": false126 },127 "maxItems": 50,128 "description": "Filter conditions applied before webhook work is created."129 }130 },131 "required": [132 "mode",133 "conditions"134 ],135 "additionalProperties": false,136 "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."137 }138 },139 "required": [140 "name",141 "target"142 ],143 "additionalProperties": false144 }145 }146 }147 },148 "responses": {149 "201": {150 "description": "Created webhook",151 "content": {152 "application/json": {153 "schema": {154 "type": "object",155 "properties": {156 "webhook": {157 "type": "object",158 "properties": {159 "id": {160 "type": "string",161 "format": "uuid",162 "description": "The webhook id. Pass it as webhook_id to the other webhook operations."163 },164 "project_id": {165 "type": "string",166 "format": "uuid"167 },168 "name": {169 "type": "string"170 },171 "source": {172 "type": "string",173 "enum": [174 "webhook"175 ]176 },177 "target": {178 "type": "object",179 "properties": {180 "kind": {181 "type": "string",182 "enum": [183 "agent",184 "task",185 "workflow",186 "event"187 ],188 "description": "Target kind invoked or stored by the webhook."189 },190 "id": {191 "type": "string",192 "minLength": 1,193 "maxLength": 128,194 "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."195 },196 "conversation_mode": {197 "type": "string",198 "enum": [199 "create_new",200 "existing",201 "none"202 ],203 "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."204 },205 "conversation_id": {206 "type": [207 "string",208 "null"209 ],210 "format": "uuid",211 "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."212 }213 },214 "required": [215 "kind",216 "id"217 ],218 "additionalProperties": false219 },220 "prompt_template": {221 "type": [222 "string",223 "null"224 ]225 },226 "event_filter": {227 "type": [228 "object",229 "null"230 ],231 "properties": {232 "mode": {233 "type": "string",234 "enum": [235 "all",236 "any"237 ],238 "description": "Whether all or any filter conditions must match."239 },240 "conditions": {241 "type": "array",242 "items": {243 "type": "object",244 "properties": {245 "path": {246 "type": "string",247 "minLength": 1,248 "maxLength": 255,249 "description": "Dot path in the incoming payload, for example action or pull_request.state."250 },251 "operator": {252 "type": "string",253 "enum": [254 "equals",255 "not_equals",256 "in",257 "exists",258 "contains"259 ],260 "description": "Comparison operator."261 },262 "value": {263 "description": "Comparison value for operators that require one."264 }265 },266 "required": [267 "path",268 "operator"269 ],270 "additionalProperties": false271 },272 "maxItems": 50,273 "description": "Filter conditions applied before webhook work is created."274 }275 },276 "required": [277 "mode",278 "conditions"279 ],280 "additionalProperties": false,281 "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."282 },283 "status": {284 "type": "string",285 "enum": [286 "draft",287 "enabled",288 "disabled"289 ]290 },291 "runtime_target_kind": {292 "type": "string",293 "enum": [294 "main_branch",295 "environment",296 "preview_branch"297 ]298 },299 "runtime_target_environment_id": {300 "type": [301 "string",302 "null"303 ],304 "format": "uuid"305 },306 "runtime_target_branch_id": {307 "type": [308 "string",309 "null"310 ],311 "format": "uuid"312 },313 "definition_source": {314 "type": "string",315 "enum": [316 "manual",317 "source"318 ]319 },320 "source_trigger_id": {321 "type": [322 "string",323 "null"324 ]325 },326 "source_path": {327 "type": [328 "string",329 "null"330 ]331 },332 "source_hash": {333 "type": [334 "string",335 "null"336 ]337 },338 "ingress_id": {339 "type": "string",340 "description": "The public id in webhook_url that external senders post to."341 },342 "webhook_url": {343 "type": "string"344 },345 "created_by_user_id": {346 "type": "string",347 "format": "uuid"348 },349 "enabled_at": {350 "type": [351 "string",352 "null"353 ]354 },355 "disabled_at": {356 "type": [357 "string",358 "null"359 ]360 },361 "disabled_reason": {362 "type": [363 "string",364 "null"365 ]366 },367 "created_at": {368 "type": "string"369 },370 "updated_at": {371 "type": "string"372 }373 },374 "required": [375 "id",376 "project_id",377 "name",378 "source",379 "target",380 "prompt_template",381 "event_filter",382 "status",383 "runtime_target_kind",384 "runtime_target_environment_id",385 "runtime_target_branch_id",386 "definition_source",387 "source_trigger_id",388 "source_path",389 "source_hash",390 "ingress_id",391 "webhook_url",392 "created_by_user_id",393 "enabled_at",394 "disabled_at",395 "disabled_reason",396 "created_at",397 "updated_at"398 ]399 },400 "webhook_secret": {401 "type": "string",402 "description": "Secret for the X-Veryfront-Webhook-Secret header. Returned only once, on create; store it now."403 }404 },405 "required": [406 "webhook",407 "webhook_secret"408 ]409 }410 }411 }412 },413 "400": {414 "description": "invalid_input: invalid body or parameters",415 "content": {416 "application/problem+json": {417 "schema": {418 "$ref": "#/components/schemas/Problem"419 }420 }421 }422 },423 "401": {424 "description": "unauthenticated",425 "content": {426 "application/problem+json": {427 "schema": {428 "$ref": "#/components/schemas/Problem"429 }430 }431 }432 },433 "403": {434 "description": "forbidden: a project member without the required capability",435 "content": {436 "application/problem+json": {437 "schema": {438 "$ref": "#/components/schemas/Problem"439 }440 }441 }442 },443 "404": {444 "description": "not_found: project or webhook not found or not visible",445 "content": {446 "application/problem+json": {447 "schema": {448 "$ref": "#/components/schemas/Problem"449 }450 }451 }452 },453 "500": {454 "description": "internal",455 "content": {456 "application/problem+json": {457 "schema": {458 "$ref": "#/components/schemas/Problem"459 }460 }461 }462 },463 "503": {464 "description": "internal: authentication state is temporarily unavailable and the request was not processed; retry shortly",465 "content": {466 "application/problem+json": {467 "schema": {468 "$ref": "#/components/schemas/Problem"469 }470 }471 }472 }473 },474 "x-documentation-source-tag": "Webhooks",475 "x-canonical-documentation": {476 "domain": "execution",477 "resource": "Triggers",478 "subgroup": "Webhooks",479 "name": "Create webhook",480 "description": "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.",481 "operationId": "createWebhook"482 },483 "x-mint": {484 "href": "/cloud/rest/api-reference/execution-triggers-webhooks/create-webhook"485 }486}