---
title: "Create a new job"
method: POST
path: "/v1/jobs"
tags: ["Create Jobs"]
---

# Create a new job

`POST /v1/jobs`

Creates a new job for content evaluation. Can be configured to wait for completion or return immediately with a job ID.

## Request body

- V1CreateJobRequest
  - `contentData` V1ContentData[], required — The content data to be evaluated. Only one content type should be set per entry.
    - `contentHash` string — The hashing algorithm used will appear at the front of the hash value in this field (i.e., 'md5::hash')
    - `text` string — A text string to process.
    - `image` string, base64 — A binary image file to process.
    - `imageUrl` string — A publicly-accessible URL that points to an image.
    - `metadata` object
  - `policyId` string, required
  - `threshold` number, double — The threshold to use for truthyness. If not set a default value will be used.
  - `expedited` boolean — If set, the job will be evaluated in expedited mode, prioritizing speed over cost.
  - `webhook` CreateJobRequestWebhook — A POST request to make when the job is complete.
    - `url` string, required — The URL to call when the job is complete. Must be HTTPS.
    - `extraHeaders` object — Any additional headers to send with the webhook request. Optional. If included, all headers will be prepended with X-Webhook- to avoid collisions.
  - `options` V1CreateJobRequestOptions — Options for evaluation behavior.
    - `options` object — Map of option keys to values.

## Response `200`

A successful response.

- V1CreateJobResponse
  - `job` V1Job — A unique evaluation job that has compared a policy to one or more pieces of content
    - `jobUuid` string, uuidv4
    - `customerId` string, uuidv4
    - `status` 'JOB_STATUS_UNSPECIFIED' | 'JOB_STATUS_PENDING' | 'JOB_STATUS_RUNNING' | 'JOB_STATUS_COMPLETED' | 'JOB_STATUS_FAILED' | 'JOB_STATUS_CANCELED'
    - `contentData` V1ContentData[] — Content associated with this job. In responses, includes the content hash and any metadata provided with the original request.
      - `contentHash` string — The hashing algorithm used will appear at the front of the hash value in this field (i.e., 'md5::hash')
      - `text` string — A text string to process.
      - `image` string, base64 — A binary image file to process.
      - `imageUrl` string — A publicly-accessible URL that points to an image.
      - `metadata` object
    - `results` V1JobResult[]
      - `jobUuid` string, uuidv4
      - `report` V1PolicyEvaluationReport — A report on the result of evaluating a policy against a piece of content/input.
        - `policyId` string, uuidv4
        - `policyKey` string — This is the title of the policy as it appears in the policy editor. Do not use this to identify a policy. Use the policy_id instead.
        - `policyVersionId` string, uuidv4
        - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
        - `sectionEvaluationReports` PolicyEvaluationReportSectionEvaluationReport[] — Reports on the evaluation of each SECTION or LABEL block in the policy.
          - `name` string
          - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
          - `message` string
          - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[] — Each assertion in each section is evaluated
            - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
            - `message` string — The text of the assertion.
            - `score` number, double
          - `exceptionEvaluationReport` PolicyEvaluationReportExceptionEvaluationReport — Outcome of an EXCEPT WHEN or UNLESS block, if present.
            - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
            - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[] — Each assertion in the exception is evaluated
              - …
            - `reviewResult` PolicyEvaluationReportReviewResult — Report on the result of a single assertion in a policy.
              - …
          - `reviewResult` PolicyEvaluationReportReviewResult — Report on the result of a single assertion in a policy.
            - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
            - `score` number, double
        - `exceptionEvaluationReport` PolicyEvaluationReportExceptionEvaluationReport — Outcome of an EXCEPT WHEN or UNLESS block, if present.
          - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
          - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[] — Each assertion in the exception is evaluated
            - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
            - `message` string — The text of the assertion.
            - `score` number, double
          - `reviewResult` PolicyEvaluationReportReviewResult — Report on the result of a single assertion in a policy.
            - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
            - `score` number, double
        - `contentHash` string — The hashing algorithm used will appear at the front of the hash value in this field (i.e., 'fnv1a128::hash-value')
        - `contentMetadata` object — If metadata was attached to the content when the job was created, it will be attached to the evaluation report here.
        - `reviewResult` PolicyEvaluationReportReviewResult — Report on the result of a single assertion in a policy.
          - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED' — Evaluation outcome. TRUE, FALSE or FAILED.
          - `score` number, double
        - `threshold` number, double
        - `labelMatches` object — Labels that matched the content. The keys of the map are the label names, and the values are the scores for each label. This field provides a simple way to identify which labels matched the content without the need to dig into each section report.
        - `tokenUsage` PolicyEvaluationReportTokenUsage — Usage related to this policy evaluation.
          - `inputTokens` integer — The number of tokens that were sent to the service in the form of content.
          - `billedTokens` integer — The number of tokens that Clavata billed for this evaluation.
          - `multiplier` number, float — The policy complexity multiplier that was used to calculate the final billed tokens.
        - `labelId` string, uuidv4 — The ID of the published label evaluated for label-based evaluation flows.
        - `labelVersionId` string, uuidv4 — The ID of the published label version evaluated for label-based evaluation flows.
      - `created` string, date-time
    - `created` string, date-time
    - `updated` string, date-time
    - `completed` string, date-time
    - `policyId` string, uuidv4
    - `policyVersionId` string, uuidv4
    - `threshold` number, double
    - `labelId` string, uuidv4 — Label ID to evaluate this job for published-label evaluation flows.
    - `labelVersionId` string, uuidv4 — Label Version ID to evaluate this job for published-label evaluation flows.
    - `jobType` 'JOB_TYPE_UNSPECIFIED' | 'JOB_TYPE_STANDARD' | 'JOB_TYPE_BATCH' | 'JOB_TYPE_FREE' | 'JOB_TYPE_TEST' — JobType classifies how a job was created for billing and analytics purposes.

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests
- `499` — Precheck Failures (Canceled)
- `default` — An unexpected error response.

---

[API](https://skmtc.net/clavata/apis/clavata-public-api-v1.md) · [All operations](https://skmtc.net/clavata/apis/clavata-public-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clavata/clavata-public-api-v1/revisions/7d66607e1ab6/schema)
