Clavata Public API v1 (1.0.0)

Download OpenAPI specification:Download

Endpoints for creating and managing jobs via the Clavata Public API.

Public API

Endpoints for creating and managing jobs via the Clavata Public API.

Batch Processing

Get batch jobs

Retrieves batch jobs, optionally filtered by batch job IDs or states. If no filters are provided, all batch jobs will be returned.

Authorizations:
Bearer_Token
query Parameters
batchJobIds
Array of strings

IDs of the batch jobs to get. If not provided, all batch jobs will be returned.

states
Array of strings
Items Enum: "BATCH_JOB_STATE_UNSPECIFIED" "BATCH_JOB_STATE_ERROR" "BATCH_JOB_STATE_INITIALIZED" "BATCH_JOB_STATE_QUEUED" "BATCH_JOB_STATE_PREPROCESSING" "BATCH_JOB_STATE_PREPROCESSED" "BATCH_JOB_STATE_SUBMITTED" "BATCH_JOB_STATE_POSTPROCESSING" "BATCH_JOB_STATE_POSTPROCESSED" "BATCH_JOB_STATE_COMPLETED" "BATCH_JOB_STATE_CANCELLED"

The state of the batch jobs to get. If not provided, all batch jobs will be returned.

Responses

Response samples

Content type
application/json
{
  • "batchJobs": [
    ]
}

Create a new batch job

Creates a new batch job that can process multiple content items in bulk. Returns a presigned URL for uploading the input file. Start the job by making a POST request to StartBatchJob after uploading the input file.

Authorizations:
Bearer_Token
Request Body schema: application/json
required
name
string (The name for the batch job)
policyId
string (The policy to be used for the batch job)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "policyId": "string"
}

Response samples

Content type
application/json
{
  • "batchJobId": "string",
  • "name": "string",
  • "error": {
    },
  • "inputFileUploadUrl": "string"
}

Cancel a batch job

Cancels a batch job. This will stop the batch job from being processed further.

Authorizations:
Bearer_Token
path Parameters
batchJobId
required
string

The ID of the batch job to cancel

Request Body schema: application/json
required
object (GatewayServiceCancelBatchJobBody)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "batchJobId": "string",
  • "state": "BATCH_JOB_STATE_UNSPECIFIED",
  • "error": {
    }
}

Start a batch job

Starts a batch job that has been created. The batch job must have an input file uploaded before it can be started.

Authorizations:
Bearer_Token
path Parameters
batchJobId
required
string

The ID of the batch job to start

Request Body schema: application/json
required
object (GatewayServiceStartBatchJobBody)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "batchJobId": "string",
  • "state": "BATCH_JOB_STATE_UNSPECIFIED",
  • "error": {
    }
}

Get Jobs

List jobs

Retrieves a list of jobs with optional filtering by time ranges and status. Incomplete jobs will only include basic information.

Authorizations:
Bearer_Token
query Parameters
query.createdTimeRange.start
string <date-time>

The start of the time range

query.createdTimeRange.end
string <date-time>

The end of the time range

query.createdTimeRange.inclusive
boolean

Whether to treat the time range as inclusive or exclusive

query.updatedTimeRange.start
string <date-time>

The start of the time range

query.updatedTimeRange.end
string <date-time>

The end of the time range

query.updatedTimeRange.inclusive
boolean

Whether to treat the time range as inclusive or exclusive

query.completedTimeRange.start
string <date-time>

The start of the time range

query.completedTimeRange.end
string <date-time>

The end of the time range

query.completedTimeRange.inclusive
boolean

Whether to treat the time range as inclusive or exclusive

query.status
string
Default: "JOB_STATUS_UNSPECIFIED"
Enum: "JOB_STATUS_UNSPECIFIED" "JOB_STATUS_PENDING" "JOB_STATUS_RUNNING" "JOB_STATUS_COMPLETED" "JOB_STATUS_FAILED" "JOB_STATUS_CANCELED"

The status of the job

query.policyId
string

Policy ID that created the job

pageSize
integer <int32>

The maximum number of jobs to return

pageToken
string

A token identifying the page to return; for keyset pagination

Responses

Response samples

Content type
application/json
{
  • "jobs": [
    ],
  • "nextPageToken": "string"
}

Get job details

Retrieves details of a specific job, including evaluation results if the job is complete.

Authorizations:
Bearer_Token
path Parameters
jobUuid
required
string

jobId is the unique identifier of the job

Responses

Response samples

Content type
application/json
{
  • "job": {
    }
}

Create Jobs

Create a new job

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

Authorizations:
Bearer_Token
Request Body schema: application/json
required
required
Array of objects (Content Data)

The content data to be evaluated. Only one content type should be set per entry.

policyId
required
string (The policy keys to be evaluated)
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.

object (Webhook Details (Optional))

A POST request to make when the job is complete.

object (v1CreateJobRequestOptions)

Options for evaluation behavior.

Responses

Request samples

Content type
application/json
{
  • "contentData": [
    ],
  • "policyId": "string",
  • "threshold": 0.1,
  • "expedited": true,
  • "webhook": {
    },
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "job": {
    }
}

Stream job results in real-time

Initiates a streaming job that processes content data and returns results as they become available. Useful for real-time content evaluation.

Authorizations:
Bearer_Token
Request Body schema: application/json
required
required
Array of objects (Content Data)

The content data to be evaluated. Only one content type should be set per entry.

policyId
required
string (policy_keys is the list of policy names to be evaluated. If empty, all policies will be evaluated)
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.

object (v1EvaluateRequestOptions)

Options for evaluation behavior.

Responses

Request samples

Content type
application/json
{
  • "contentData": [
    ],
  • "policyId": "string",
  • "threshold": 0.1,
  • "expedited": true,
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    },
  • "error": {
    }
}