> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-api/rest-api-v2/experiments-and-jobs/post-v2-evals-experiments-experiment_id-jobs.md).

# POST /v2/evals/experiments/{experiment\_id}/jobs

## Create Eval Experiment Job

> Start a job on the experiment. With \`mode\` \`generate\` the job produces outputs for the experiment's rows and scores them in the same job when evaluator IDs are passed; with \`mode\` \`score\` it scores the existing outputs with the selected evaluators, at least one, and regenerates nothing. The job is queued: the response is 202 with the job URL in \`Location\` and \`status\_url\`. Poll that URL until the job's \`status\` is \`completed\`, \`completed\_with\_failures\`, \`failed\` or \`cancelled\`. One job runs per experiment at a time; starting another while one is active returns 409. When the active job is known, \`Location\` and \`meta.status\_url\` point to it, with its IDs in \`meta.job\_id\` and \`meta.experiment\_id\`.\
> \
> \*\*How to use\*\*\
> \
> Use generate for new outputs (and optional evaluation), score for existing outputs with at least one evaluator. Persist the returned job ID/status\_url. Only one active job is allowed; follow the existing job on 409 instead of starting duplicates.\
> \
> \*\*Authentication and permissions\*\*\
> \
> Required permissions: \`evals.run\`. Resource and owner access checks also apply.\
> \
> \*\*Prepare request.json\*\*\
> \
> Save the example body below as \`request.json\` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\
> \
> \`\`\`json\
> {\
> &#x20; "mode": "generate",\
> &#x20; "evaluator\_ids": \[\
> &#x20;   "00000000-0000-4000-8000-000000000001"\
> &#x20; ]\
> }\
> \`\`\`

````json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"tags":[{"name":"endpoint-createEvalExperimentJobV2"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations."}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer","description":"Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header."}},"schemas":{"EvalExperimentJobCreateRequestV2":{"properties":{"mode":{"$ref":"#/components/schemas/EvalExperimentJobMode"},"evaluator_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Evaluator Ids"}},"additionalProperties":false,"type":"object","required":["mode"],"title":"EvalExperimentJobCreateRequest"},"EvalExperimentJobMode":{"type":"string","enum":["generate","score"],"title":"EvalExperimentJobMode","description":"What a job does.\n\ngenerate: produce outputs for the experiment's rows, and score them when evaluators were\nselected. score: score existing outputs only; nothing is regenerated."},"StackAIAPIDataResponse_EvalExperimentJobAcceptedResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"data":{"$ref":"#/components/schemas/EvalExperimentJobAcceptedResponseV2","description":"Data returned by the API service"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentJobAcceptedResponseV2]"},"EvalExperimentJobAcceptedResponseV2":{"properties":{"status":{"type":"string","const":"accepted","title":"Status","description":"The request was accepted. Poll the job for its current state.","default":"accepted"},"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"ID of the job that was created. Poll the job route with it."},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id","description":"The experiment the job works on."},"status_url":{"type":"string","title":"Status Url","description":"Relative URL of the job, the same value as the Location header. Poll it until the job reaches a final status."}},"type":"object","required":["job_id","experiment_id","status_url"],"title":"EvalExperimentJobAccepted"},"StackAIAPIErrorResponse":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"errors":{"items":{"$ref":"#/components/schemas/StackAIAPIError"},"type":"array","title":"Errors","description":"List of errors"},"detail":{"items":{"type":"string"},"type":"array","title":"Detail","description":"Human-readable error messages. Use the HTTP status and error metadata to decide how to handle the failure.","readOnly":true}},"type":"object","required":["detail"],"title":"StackAIAPIErrorResponse","description":"Error response model with status code and error list."},"StackAIAPIError":{"properties":{"message":{"type":"string","title":"Message","description":"Message describing the error"}},"type":"object","required":["message"],"title":"StackAIAPIError","description":"Error detail model."}}},"paths":{"/v2/evals/experiments/{experiment_id}/jobs":{"post":{"tags":["endpoint-createEvalExperimentJobV2"],"summary":"Create Eval Experiment Job","description":"Start a job on the experiment. With `mode` `generate` the job produces outputs for the experiment's rows and scores them in the same job when evaluator IDs are passed; with `mode` `score` it scores the existing outputs with the selected evaluators, at least one, and regenerates nothing. The job is queued: the response is 202 with the job URL in `Location` and `status_url`. Poll that URL until the job's `status` is `completed`, `completed_with_failures`, `failed` or `cancelled`. One job runs per experiment at a time; starting another while one is active returns 409. When the active job is known, `Location` and `meta.status_url` point to it, with its IDs in `meta.job_id` and `meta.experiment_id`.\n\n**How to use**\n\nUse generate for new outputs (and optional evaluation), score for existing outputs with at least one evaluator. Persist the returned job ID/status_url. Only one active job is allowed; follow the existing job on 409 instead of starting duplicates.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"mode\": \"generate\",\n  \"evaluator_ids\": [\n    \"00000000-0000-4000-8000-000000000001\"\n  ]\n}\n```","operationId":"createEvalExperimentJobV2","parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalExperimentJobCreateRequestV2"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentJobAcceptedResponseV2_"}}},"headers":{"Location":{"description":"Accepted job URL","schema":{"type":"string"}}}},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"409":{"headers":{"Location":{"description":"URL of the active job, when known","schema":{"type":"string"}}},"description":"The experiment already has an active job. When its identity is known, the error envelope includes meta.job_id, meta.experiment_id, meta.status_url and a matching Location header. Poll that job until it reaches a final status, then retry. Other conflicts omit this metadata and Location.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-api/rest-api-v2/experiments-and-jobs/post-v2-evals-experiments-experiment_id-jobs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
