Skip to content
Framework Docs

List Batch Jobs

client.Beta.Batch.List(ctx, query) (*PaginatedBatchItems[BetaBatchListResponse], error)
GET/api/v1/beta/batch-processing

List batch processing jobs with optional filtering.

Filter by directory_id, job_type, or status. Results are paginated with configurable limit and offset.

ParametersExpand Collapse
query BetaBatchListParams
DirectoryID param.Field[string]optional

Filter by directory ID

JobType param.Field[BetaBatchListParamsJobType]optional

Filter by job type (PARSE, EXTRACT, CLASSIFY)

const BetaBatchListParamsJobTypeParse BetaBatchListParamsJobType = "parse"
const BetaBatchListParamsJobTypeExtract BetaBatchListParamsJobType = "extract"
const BetaBatchListParamsJobTypeClassify BetaBatchListParamsJobType = "classify"
Limit param.Field[int64]optional

Maximum number of jobs to return

maximum1000
minimum1
Offset param.Field[int64]optional

Number of jobs to skip for pagination

minimum0
OrganizationID param.Field[string]optional
ProjectID param.Field[string]optional
Status param.Field[BetaBatchListParamsStatus]optional

Filter by job status (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED)

const BetaBatchListParamsStatusPending BetaBatchListParamsStatus = "pending"
const BetaBatchListParamsStatusRunning BetaBatchListParamsStatus = "running"
const BetaBatchListParamsStatusDispatched BetaBatchListParamsStatus = "dispatched"
const BetaBatchListParamsStatusCompleted BetaBatchListParamsStatus = "completed"
const BetaBatchListParamsStatusFailed BetaBatchListParamsStatus = "failed"
const BetaBatchListParamsStatusCancelled BetaBatchListParamsStatus = "cancelled"
ReturnsExpand Collapse
type BetaBatchListResponse struct{…}

Response schema for a batch processing job.

ID string

Unique identifier for the batch job

JobType BetaBatchListResponseJobType

Type of processing operation (parse or classify)

One of the following:
const BetaBatchListResponseJobTypeParse BetaBatchListResponseJobType = "parse"
const BetaBatchListResponseJobTypeExtract BetaBatchListResponseJobType = "extract"
const BetaBatchListResponseJobTypeClassify BetaBatchListResponseJobType = "classify"
ProjectID string

Project this job belongs to

Status BetaBatchListResponseStatus

Current job status

One of the following:
const BetaBatchListResponseStatusPending BetaBatchListResponseStatus = "pending"
const BetaBatchListResponseStatusRunning BetaBatchListResponseStatus = "running"
const BetaBatchListResponseStatusDispatched BetaBatchListResponseStatus = "dispatched"
const BetaBatchListResponseStatusCompleted BetaBatchListResponseStatus = "completed"
const BetaBatchListResponseStatusFailed BetaBatchListResponseStatus = "failed"
const BetaBatchListResponseStatusCancelled BetaBatchListResponseStatus = "cancelled"
TotalItems int64

Total number of items in the job

CompletedAt Timeoptional

Timestamp when job completed

formatdate-time
CreatedAt Timeoptional

Creation datetime

formatdate-time
DirectoryID stringoptional

Directory being processed

EffectiveAt Timeoptional
ErrorMessage stringoptional

Error message for the latest job attempt, if any.

FailedItems int64optional

Number of items that failed processing

JobRecordID stringoptional

The job record ID associated with this status, if any.

ProcessedItems int64optional

Number of items processed so far

SkippedItems int64optional

Number of items skipped (already processed or size limit)

StartedAt Timeoptional

Timestamp when job processing started

formatdate-time
UpdatedAt Timeoptional

Update datetime

formatdate-time
WorkflowID stringoptional

Async job tracking ID

List Batch Jobs

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/llamacloud-prod-go"
  "github.com/stainless-sdks/llamacloud-prod-go/option"
)

func main() {
  client := llamacloudprod.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Beta.Batch.List(context.TODO(), llamacloudprod.BetaBatchListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "items": [
    {
      "id": "bjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "job_type": "parse",
      "project_id": "proj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "status": "pending",
      "total_items": 0,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "created_at": "2019-12-27T18:11:19.117Z",
      "directory_id": "dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "effective_at": "2019-12-27T18:11:19.117Z",
      "error_message": "error_message",
      "failed_items": 0,
      "job_record_id": "job_record_id",
      "processed_items": 0,
      "skipped_items": 0,
      "started_at": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "workflow_id": "workflow_id"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "id": "bjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "job_type": "parse",
      "project_id": "proj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "status": "pending",
      "total_items": 0,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "created_at": "2019-12-27T18:11:19.117Z",
      "directory_id": "dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "effective_at": "2019-12-27T18:11:19.117Z",
      "error_message": "error_message",
      "failed_items": 0,
      "job_record_id": "job_record_id",
      "processed_items": 0,
      "skipped_items": 0,
      "started_at": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "workflow_id": "workflow_id"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}