API Reference meta-tasks
Create a meta-task
POST/projects/{project_id}/task-types/
Create a reusable meta-task definition — the script or agent contract every run instantiates.
Parameters
| Body field | Required | Description |
|---|---|---|
| name | yes | Display name |
| identifier | no | Stable id for create_task and API calls (generated when omitted) |
| script | no | Workflow source — a workflow.py or workflow.ts body |
| execution_mode | no | script (default) or agent |
| script_language | no | python (default) or typescript |
| workspace_id / agent_id / docker_image_id | no | Bindings: where it runs, who runs it, on which image |
| auto_approve | no | Skip human approval gates (default false) |
| extract_memory | no | Distill memories from completed runs (default false) |
| allow_mcp | no | Let the task call project MCP servers (default false) |
| result_schema | no | JSON schema the run result should match |
Request
curl -X POST "$ALLYBUILD_API_URL/projects/$PROJECT_ID/task-types/" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
-d '{
"name": "Weekly report",
"identifier": "weekly-report",
"script_language": "python",
"script": "def run(params, reporter):\n reporter.set_phase(\"Fetching\")",
"extract_memory": true
}'Response
{
"id": "5f4e3d2c-...",
"name": "Weekly report",
"identifier": "weekly-report",
"execution_mode": "script",
"script_language": "python",
"extract_memory": true,
"version": 1
}