/v2/agents/sessionsCreate a Harness Runtime session
Creates a Harness Runtime session from a JSON configuration reference or an environment spec supplied as YAML. For JSON, provide name and config_id; for YAML, send the environment spec with a supported YAML Content-Type. Sandbox boot continues asynchronously after the session row is allocated.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
For JSON, send a strict CreateSession request with name and config_id; the body is limited to 16 KiB and does not accept inline secrets. The live API also accepts raw environment specs with supported YAML content types, limited to 1 MiB.
A 400 is returned for an invalid manifest or config, incompatible credentials, or an invalid query parameter; 401 indicates invalid authentication credentials; 402 indicates that the team is blocked by the prepayment gate; 403 indicates that Secrets Manager denied access to a pinned credential; 404 indicates that a resource was not found; 409 indicates that the team reached its active-session quota or a live session already uses the name; 413 indicates that the request body exceeds its size limit; 415 indicates an unsupported Content-Type; 429 indicates that the API rate limit was exceeded; 500 indicates a server error; 501 indicates that the requested capability is unavailable; and 503 indicates that Secrets Manager is unavailable. For JSON requests, name must be 1–64 characters and must not be UUID-shaped, and config_id must be a UUID; the JSON body limit is 16 KiB, while YAML bodies are limited to 1 MiB. The resume_on_topoff query parameter must be exactly true, false, 1, or 0; when both the query parameter and body field are present, the query parameter takes precedence.