http
POST /projects/{project_reference}/tasksCreate a task source file in the project source or a preview branch when a new unit of work must be runnable or schedulable; returns the task source document. Requires project.runs.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 | Project slug, UUID, or domain that identifies the project. |
| source_target_kind | query | No | Source to write: project or preview_branch. Defaults to project. |
| target_branch_id | query | No | Preview branch to write when source_target_kind is preview_branch. |
Parameter contracts
JSON
1[2 {3 "schema": {4 "$ref": "#/components/schemas/ProjectReference"5 },6 "required": true,7 "description": "Project slug, UUID, or domain that identifies the project.",8 "name": "project_reference",9 "in": "path"10 },11 {12 "schema": {13 "type": "string",14 "description": "Source to write: project or preview_branch. Defaults to project."15 },16 "required": false,17 "description": "Source to write: project or preview_branch. Defaults to project.",18 "name": "source_target_kind",19 "in": "query"20 },21 {22 "schema": {23 "type": [24 "string",25 "null"26 ],27 "format": "uuid",28 "description": "Preview branch to write when source_target_kind is preview_branch."29 },30 "required": false,31 "description": "Preview branch to write when source_target_kind is preview_branch.",32 "name": "target_branch_id",33 "in": "query"34 }35]Request body
JSON
1{2 "required": true,3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "id": {9 "type": "string",10 "minLength": 1,11 "maxLength": 128,12 "pattern": "^[a-z0-9][a-z0-9-]*$",13 "description": "Stable task identifier used in MCP and project source."14 },15 "name": {16 "type": "string",17 "minLength": 1,18 "description": "Human-readable task name."19 },20 "description": {21 "type": [22 "string",23 "null"24 ],25 "description": "Optional short description of what the task does."26 },27 "schedulable": {28 "type": "boolean",29 "description": "Whether the task can be used from schedulers and cron definitions. Defaults to true."30 }31 },32 "required": [33 "id",34 "name"35 ]36 }37 }38 }39}Responses
201
Created task document
JSON
1{2 "description": "Created task document",3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "id": {9 "type": "string",10 "description": "Task identifier."11 },12 "name": {13 "type": "string",14 "description": "Human-readable task name."15 },16 "description": {17 "type": [18 "string",19 "null"20 ],21 "description": "Short description of what the task does."22 },23 "target": {24 "type": "string",25 "description": "Execution target that implements the task."26 },27 "source_path": {28 "type": "string",29 "description": "Source file path where the task definition lives."30 },31 "source": {32 "type": "string",33 "description": "Task source code or structured document content."34 },35 "schedulable": {36 "type": "boolean",37 "description": "Whether the task can be used from schedulers."38 },39 "edit_mode": {40 "type": "string",41 "enum": [42 "structured",43 "source_only"44 ],45 "description": "Editing mode supported for the task definition."46 },47 "source_only_reasons": {48 "type": "array",49 "items": {50 "type": "string"51 },52 "description": "Reasons why the task can only be edited as raw source, when applicable."53 }54 },55 "required": [56 "id",57 "name",58 "description",59 "target",60 "source_path",61 "source",62 "schedulable",63 "edit_mode",64 "source_only_reasons"65 ],66 "description": "Task definition including editable source content."67 }68 }69 }70}400
Bad request
JSON
1{2 "description": "Bad request",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/TaskProblem"7 }8 }9 }10}401
Unauthorized
JSON
1{2 "description": "Unauthorized",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/TaskProblem"7 }8 }9 }10}403
Forbidden
JSON
1{2 "description": "Forbidden",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/TaskProblem"7 }8 }9 }10}409
Conflict
JSON
1{2 "description": "Conflict",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/TaskProblem"7 }8 }9 }10}Referenced contracts
components/parameters/ProjectReference
JSON
1{2 "schema": {3 "$ref": "#/components/schemas/ProjectReference"4 },5 "required": true,6 "description": "Project slug, UUID, or domain that identifies the project.",7 "name": "project_reference",8 "in": "path"9}components/schemas/ProjectReference
JSON
1{2 "type": "string"3}components/schemas/TaskProblem
JSON
1{2 "allOf": [3 {4 "$ref": "#/components/schemas/Problem"5 },6 {7 "type": "object",8 "properties": {9 "edit_mode": {10 "type": "string",11 "enum": [12 "structured",13 "source_only"14 ],15 "description": "Edit mode of the task definition, on a source_only_conflict."16 },17 "source_only_reasons": {18 "type": "array",19 "items": {20 "type": "string"21 },22 "description": "Why the task can only be edited as raw source, on a source_only_conflict."23 },24 "source_path": {25 "type": "string",26 "description": "Source file of the task definition, on a source_only_conflict."27 }28 }29 }30 ]31}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": "createTask",3 "tags": [4 "agents/Tasks/Tasks"5 ],6 "summary": "Create task",7 "description": "Create a task source file in the project source or a preview branch when a new unit of work must be runnable or schedulable; returns the task source document. Requires project.runs.write.",8 "parameters": [9 {10 "$ref": "#/components/parameters/ProjectReference"11 },12 {13 "schema": {14 "type": "string",15 "description": "Source to write: project or preview_branch. Defaults to project."16 },17 "required": false,18 "description": "Source to write: project or preview_branch. Defaults to project.",19 "name": "source_target_kind",20 "in": "query"21 },22 {23 "schema": {24 "type": [25 "string",26 "null"27 ],28 "format": "uuid",29 "description": "Preview branch to write when source_target_kind is preview_branch."30 },31 "required": false,32 "description": "Preview branch to write when source_target_kind is preview_branch.",33 "name": "target_branch_id",34 "in": "query"35 }36 ],37 "requestBody": {38 "required": true,39 "content": {40 "application/json": {41 "schema": {42 "type": "object",43 "properties": {44 "id": {45 "type": "string",46 "minLength": 1,47 "maxLength": 128,48 "pattern": "^[a-z0-9][a-z0-9-]*$",49 "description": "Stable task identifier used in MCP and project source."50 },51 "name": {52 "type": "string",53 "minLength": 1,54 "description": "Human-readable task name."55 },56 "description": {57 "type": [58 "string",59 "null"60 ],61 "description": "Optional short description of what the task does."62 },63 "schedulable": {64 "type": "boolean",65 "description": "Whether the task can be used from schedulers and cron definitions. Defaults to true."66 }67 },68 "required": [69 "id",70 "name"71 ]72 }73 }74 }75 },76 "responses": {77 "201": {78 "description": "Created task document",79 "content": {80 "application/json": {81 "schema": {82 "type": "object",83 "properties": {84 "id": {85 "type": "string",86 "description": "Task identifier."87 },88 "name": {89 "type": "string",90 "description": "Human-readable task name."91 },92 "description": {93 "type": [94 "string",95 "null"96 ],97 "description": "Short description of what the task does."98 },99 "target": {100 "type": "string",101 "description": "Execution target that implements the task."102 },103 "source_path": {104 "type": "string",105 "description": "Source file path where the task definition lives."106 },107 "source": {108 "type": "string",109 "description": "Task source code or structured document content."110 },111 "schedulable": {112 "type": "boolean",113 "description": "Whether the task can be used from schedulers."114 },115 "edit_mode": {116 "type": "string",117 "enum": [118 "structured",119 "source_only"120 ],121 "description": "Editing mode supported for the task definition."122 },123 "source_only_reasons": {124 "type": "array",125 "items": {126 "type": "string"127 },128 "description": "Reasons why the task can only be edited as raw source, when applicable."129 }130 },131 "required": [132 "id",133 "name",134 "description",135 "target",136 "source_path",137 "source",138 "schedulable",139 "edit_mode",140 "source_only_reasons"141 ],142 "description": "Task definition including editable source content."143 }144 }145 }146 },147 "400": {148 "description": "Bad request",149 "content": {150 "application/problem+json": {151 "schema": {152 "$ref": "#/components/schemas/TaskProblem"153 }154 }155 }156 },157 "401": {158 "description": "Unauthorized",159 "content": {160 "application/problem+json": {161 "schema": {162 "$ref": "#/components/schemas/TaskProblem"163 }164 }165 }166 },167 "403": {168 "description": "Forbidden",169 "content": {170 "application/problem+json": {171 "schema": {172 "$ref": "#/components/schemas/TaskProblem"173 }174 }175 }176 },177 "409": {178 "description": "Conflict",179 "content": {180 "application/problem+json": {181 "schema": {182 "$ref": "#/components/schemas/TaskProblem"183 }184 }185 }186 }187 },188 "x-documentation-source-tag": "Project tasks",189 "x-canonical-documentation": {190 "domain": "agents",191 "resource": "Tasks",192 "subgroup": "Tasks",193 "name": "Create task",194 "description": "Create a task source file in the project source or a preview branch when a new unit of work must be runnable or schedulable; returns the task source document. Requires project.runs.write.",195 "operationId": "createTask"196 },197 "x-mint": {198 "href": "/cloud/rest/api-reference/agents-tasks-tasks/create-task"199 }200}