# Create Job

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create Job"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v2/workspaces/{workspace_id}/jobs"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Creates a job.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"workspace_id","required":true,"schema":{"format":"uuid","title":"Workspace ID","type":"string"}},{"description":"Validates the job without actually storing it.","in":"query","name":"dry_run","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"Validates the job without actually storing it.","title":"Dry Run"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"concurrency":{"anyOf":[{"maximum":20,"minimum":1,"type":"integer"},{"type":"null"}],"default":3,"description":"The number of queries that can be executed concurrently. If not specified, the default value 3 is used.","title":"Concurrency"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Description of the job.","title":"Description"},"execution_mode":{"description":"The execution mode of the job. If `per_file`, the requests will be executed for each file. If `across_files`, the requests will be executed once for all files.","title":"Execution mode","enum":["PER_FILE","ACROSS_FILES"],"type":"string"},"name":{"description":"Name of the job.","title":"Name","type":"string"},"pipeline_id":{"description":"The ID of the pipeline you want to use for this job.","format":"uuid","title":"Pipeline ID","type":"string"},"queries":{"anyOf":[{"items":{"properties":{"absolute_query_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Absolute Query Index"},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"},"query":{"title":"Query","type":"string"},"query_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Query Index"},"query_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Label"}},"required":["query"],"title":"Query","type":"object"},"type":"array"},{"type":"null"}],"description":"List of queries to execute. If provided, a new query set will be created.","title":"Queries"},"query_set_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The ID of the query set you want to use for this job.","title":"Query set ID"}},"required":["name","pipeline_id","execution_mode"],"title":"CreateJob","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"properties":{"concurrency":{"anyOf":[{"maximum":20,"minimum":1,"type":"integer"},{"type":"null"}],"default":3,"description":"The number of queries that can be executed concurrently. If not specified, the default value 3 is used.","title":"Concurrency"},"created_at":{"description":"Timestamp of when the job was created.","format":"date-time","title":"Created at","type":"string"},"created_by":{"description":"The user who created the job.","title":"Created by","properties":{"family_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Family name of a user.","title":"Family name"},"given_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Given name of a user.","title":"Given name"},"user_id":{"format":"uuid","title":"User Id","type":"string"}},"required":["user_id"],"type":"object"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Description of the job.","title":"Description"},"duration":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The time it took to execute the job in seconds.","title":"Duration"},"executed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Timestamp of when the job was executed.","title":"Executed at"},"executed_requests":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of requests executed in the job.","title":"Executed requests"},"execution_mode":{"description":"The execution mode of the job. If `per_file`, the requests will be executed for each file. If `across_files`, the requests will be executed once for all files.","title":"Execution mode","enum":["PER_FILE","ACROSS_FILES"],"type":"string"},"job_id":{"description":"Job ID.","format":"uuid","title":"Job ID","type":"string"},"last_edited_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Timestamp of when the job was last edited.","title":"Last edited at"},"last_edited_by":{"anyOf":[{"properties":{"family_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Family name of a user.","title":"Family name"},"given_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Given name of a user.","title":"Given name"},"user_id":{"format":"uuid","title":"User Id","type":"string"}},"required":["user_id"],"title":"Oauth User","type":"object"},{"type":"null"}],"description":"The user ID who last edited the job.","title":"Last edited by"},"name":{"description":"Name of the job.","title":"Name","type":"string"},"pipeline_id":{"description":"The ID of the pipeline you want to use for this job.","format":"uuid","title":"Pipeline ID","type":"string"},"pipeline_name":{"description":"The name of the pipeline you want to use for this job.","title":"Pipeline name","type":"string"},"queries":{"anyOf":[{"items":{"properties":{"absolute_query_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Absolute Query Index"},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"},"query":{"title":"Query","type":"string"},"query_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Query Index"},"query_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Label"}},"required":["query"],"title":"Query","type":"object"},"type":"array"},{"type":"null"}],"description":"List of queries to execute. If provided, a new query set will be created.","title":"Queries"},"query_set_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The ID of the query set you want to use for this job.","title":"Query set ID"},"status":{"description":"The status of the job.","title":"Job status","enum":["CREATED","STARTED","FAILED","ENDED"],"type":"string"},"total_requests":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Total number of requests in the job.","title":"Total number of requests"}},"required":["name","pipeline_id","execution_mode","job_id","created_by","created_at","status","pipeline_name"],"title":"Job","type":"object"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
