{ "paths": { "/webhooks": { "get": { "tags": ["Webhooks"], "summary": "List task webhooks", "description": "Returns the authenticated user's task webhooks. Requires `tasks:read` scope.", "operationId": "listTaskWebhooks", "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } }, { "name": "cursor", "in": "query", "schema": { "type": "string" }, "description": "Pagination cursor" } ], "responses": { "200": { "description": "List of webhooks", "content": { "application/json": { "schema": { "type": "object", "required": ["items", "page"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/TaskWebhook" } }, "page": { "$ref": "#/components/schemas/PageInfo" } } } } } }, "401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Insufficient scope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": ["Webhooks"], "summary": "Create task webhook", "description": "Creates a webhook that receives task events (created, status_change, completion). Requires `tasks:write` scope.", "operationId": "createTaskWebhook", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["url", "events"], "properties": { "url": { "type": "string", "format": "uri", "description": "Webhook endpoint URL" }, "events": { "type": "array", "items": { "type": "string", "enum": ["created", "status_change", "completion"] }, "description": "Events to subscribe to" } } } } } }, "responses": { "200": { "description": "Webhook created", "content": { "application/json": { "schema": { "type": "object", "required": ["webhook"], "properties": { "webhook": { "$ref": "#/components/schemas/TaskWebhook" } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Insufficient scope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}": { "delete": { "tags": ["Webhooks"], "summary": "Delete task webhook", "description": "Deletes a task webhook. Requires `tasks:write` scope.", "operationId": "deleteTaskWebhook", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Webhook deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Insufficient scope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Webhook not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } } }