> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archetypeai.app/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Validate Prospective Inputs

> Validate the inputs for a prospective job without creating a job

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.5](/release-notes/1.1.x#v1-1-5) or later of the Archetype platform.
</Callout>

## Overview

Validates a prospective job's file inputs against the pipeline's input-port validations, without
creating a job. Used by the Developer Console to give immediate per-file feedback at
job-creation time.

<Note>
  The validation performed by this endpoint is intended primarily to provide basic guardrails
  against starting a job with invalid inputs.

  It is not guaranteed to catch more than basic
  errors in the format of the input files, and may in fact do no validation at all,
  especially for files uploaded before platform version 1.1.5.
</Note>

This endpoint always returns HTTP status `200` once the pipeline and ports are valid; each input
item is reported `valid: true`/`false` (with a message). Only file items on ports that declare a
validation are actually resolved/checked.

<Note>
  Checkpoints are not validated by this endpoint. They are accepted for request parameter
  compatibility with **Create Job**. They are simply reported to be valid, as are files on
  non-validated ports.
</Note>

## Request

This endpoint accepts the same [request
parameters](/api-reference/batch/jobs/create-job#request) as the [Create
Job](/api-reference/batch/jobs/create-job) endpoint. This is intentional; you can set up the
parameters for **Create Job**, then call this endpoint first with the same parameters. If the
validation succeeds, you can then immediately call **Create Job** with the same parameter block.

## Response

<ResponseField name="inputs" type="object" required>
  The per-item validation outcome, keyed by port exactly like the request `inputs`. Each value
  is an array of result items echoing the item's identity plus whether it is valid and, if not,
  why. Items on ports without a validation — and all checkpoint items — are always `valid:
      true`.

  For a file item:

  * `kind` (string, required) — always `file`
  * `file_id` (string, required)
  * `valid` (boolean, required)
  * `error` (string | `null`)

  For a checkpoint item:

  * `kind` (string, required) — always `checkpoint`
  * `checkpoint_id` (string, required)
  * `valid` (boolean, required)
  * `error` (string | `null`)
</ResponseField>

## Validations

The validations performed depend on the job type and input formats. For example, a machine state
classification job may ensure that an input CSV file actually has columns matching the names
given in the job configuration, and an activity detection job may ensure that a JSON input file
contains JSON objects with the fields expected by the job.

<Note>
  The exact set of validations run by this endpoint may change over time.
</Note>

## Examples

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -X POST https://api.u1.archetypeai.app/v0.5/batch/jobs/inputs/validation \
    -H "Authorization: Bearer $ATAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "workflow_key": "my-workflow-key",
      "inputs": {
        "worker.data": [
          {"kind": "file", "file_id": "fil_2abc3def4ghi5jkl6mno7pqr"},
          {"kind": "file", "file_id": "fil_3xyz4abc5def6ghi7jkl8mno"}
        ]
      },
      "parameters": {
        "worker": {
          "parallelism": 1,
          "config": {
            "reader_config": {
              "data_columns": ["c1", "c2"]
            }
          }
        }
      }
    }'
  ```

  ```python Python theme={"system"}
  import os
  import requests

  api_key = os.environ.get("ATAI_API_KEY")

  response = requests.post(
      "https://api.u1.archetypeai.app/v0.5/batch/jobs/inputs/validation",
      headers={
          "Authorization": f"Bearer {api_key}",
          "Content-Type": "application/json",
      },
      json={
          "workflow_key": "my-workflow",
          "inputs": {
              "worker.data": [
                  {"kind": "file", "file_id": "fil_2abc3def4ghi5jkl6mno7pqr"},
                  {"kind": "file", "file_id": "fil_3xyz4abc5def6ghi7jkl8mno"},
              ],
          },
          "parameters": {
              "worker": {
                  "parallelism": 1,
                  "config": {
                      "reader_config": {
                          "data_columns": ["c1", "c2"],
                      },
                  },
              }
          },
      },
  )

  report = response.json()
  for port, items in report["inputs"].items():
      for item in items:
          print(f"{port} {item['file_id']}: valid={item['valid']} {item.get('error') or ''}")
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch('https://api.u1.archetypeai.app/v0.5/batch/jobs/inputs/validation', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      workflow_key: 'my-workflow',
      inputs: {
        'worker.data': [
          { kind: 'file', file_id: 'fil_2abc3def4ghi5jkl6mno7pqr' },
          { kind: 'file', file_id: 'fil_3xyz4abc5def6ghi7jkl8mno' }
        ]
      },
      parameters: {
        worker: {
          parallelism: 1,
          config: {
            reader_config: {
              data_columns: ['c1', 'c2']
            }
          }
        }
      }
    })
  });

  const report = await response.json();
  console.log(report.inputs);
  ```
</CodeGroup>

**Response — `200 OK`**

```json theme={"system"}
{
  "inputs": {
    "worker.data": [
      {
        "kind": "file",
        "file_id": "fil_2abc3def4ghi5jkl6mno7pqr",
        "valid": true,
        "error": null
      },
      {
        "kind": "file",
        "file_id": "fil_3xyz4abc5def6ghi7jkl8mno",
        "valid": false,
        "error": "..."
      }
    ]
  }
}
```

A checkpoint item is echoed by `checkpoint_id` instead, and is always valid:

```json theme={"system"}
{
  "inputs": {
    "worker.checkpoint": [
      {
        "kind": "checkpoint",
        "checkpoint_id": "ckp_2abc3def4ghi5jkl6mno7pqr",
        "valid": true,
        "error": null
      }
    ]
  }
}
```

## Error responses

An invalid pipeline or port selection is rejected with `400`; per-file failures are reported in the `200` body instead.

```json 400 - Invalid request (pipeline/ports) theme={"system"}
{
  "code": "INVALID_REQUEST",
  "message": "...",
  "suggestion": "...",
  "error_uid": "err_abc123"
}
```

The `suggestion` field may be `null`.
