Skip to main content

Build a task from an API request

Status: Ready

Article ID: 104

Truth label: Current

Audience: Integrator and operator

Reader outcome: Create a task and verify that important fields survived validation.

Related articles: 032, 035, 103

Target week: 42

Last verified: 2026-09-13

Technical reviewer: Codex API source audit

Editorial reviewer: Codex editorial audit

Resolve the contract​

Use the current task request schema. Supply a registered project, concrete description, engine or capability requirement, permission, priority, optional worker pin, verification command, session, dependencies, and checkpoint policy only when the route supports them.

Use the preview and the request id​

POST /tasks/preview resolves and validates the request against the current defaults without enqueueing anything, and shows each value with its origin. Send a request id with the creation and reuse it on retry: Central returns the existing task for the same id and body, and a different body under the same id returns a conflict. There is no turn limit field; an older max_iterations value is accepted and ignored.

Validate before sending​

Check identifiers, enum values, paths, dependency cycles, permission ceilings, and command shape. Use <FLEET_TOKEN> in examples and load the real bearer from the approved secret source.

Read the created record​

After creation, fetch the task and compare project, description, route fields, permission, verification command, session, dependencies, and status with the request. Record the returned task ID for later evidence.

Test failure safely​

In a synthetic project, send one invalid enum or missing project reference and confirm validation rejects it without creating a queued task. Do not use a live production checkout for contract testing.

Current limits​

Request acceptance does not prove an eligible healthy worker exists or that the task is safe. Path registration, engine login, repository trust, and checkout collision controls require separate checks.

Next lesson​

Continue with Build a pipeline from an API request.

Derivative map​

  • Weekly package: WEEK-42
  • Long video: VIDEO-W42-LONG
  • Shorts: SHORT-W42-PROBLEM, SHORT-W42-MECHANISM, SHORT-W42-WARNING
  • Email: EMAIL-W42
  • LinkedIn: LI-W42-A, LI-W42-B
  • X: X-W42-A, X-W42-B
  • Visual: VISUAL-W42

Review record​

  • Current schema, authentication token, and important task fields included.
  • Created record is read back and compared.
  • Negative contract test uses a synthetic project.
  • Routing, trust, and checkout limits remain explicit.

Review completed: 2026-08-27

Re-audited against the running product: 2026-09-13