# Split

## Create Split Job

`SplitCreateResponse split().create(SplitCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/split/jobs`

Create a document split job.

### Parameters

- `SplitCreateParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `String fileInput`

    File ID or parse job ID

  - `Optional<Configuration> configuration`

    Split configuration with categories and splitting strategy.

    - `List<SplitCategory> categories`

      Categories to split documents into.

      - `String name`

        Name of the category.

      - `Optional<String> description`

        Optional description of what content belongs in this category.

    - `Optional<SplittingStrategy> splittingStrategy`

      Strategy for splitting documents.

      - `Optional<AllowUncategorized> allowUncategorized`

        Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

        - `FORBID("forbid")`

        - `INCLUDE("include")`

        - `OMIT("omit")`

      - `Optional<String> customInstructions`

        Free-form guidance for where segment boundaries are placed.

      - `Optional<Long> minPagesPerSplit`

        Minimum pages per segment. Shorter segments are merged into an adjacent segment; 1 disables merging.

  - `Optional<String> configurationId`

    Saved configuration ID

  - `Optional<String> transactionId`

    Idempotency key scoped to the project. Reusing a key returns the original job; the new request body is ignored.

  - `Optional<List<String>> webhookConfigurationIds`

    IDs of saved webhook configurations to notify for this job.

  - `Optional<List<WebhookConfiguration>> webhookConfigurations`

    Outbound webhook endpoints to notify on job status changes

    - `Optional<List<WebhookEvent>> webhookEvents`

      Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are delivered.

      - `BATCH_CANCELLED("batch.cancelled")`

      - `BATCH_ERROR("batch.error")`

      - `BATCH_PENDING("batch.pending")`

      - `BATCH_RUNNING("batch.running")`

      - `BATCH_SUCCESS("batch.success")`

      - `CLASSIFY_CANCELLED("classify.cancelled")`

      - `CLASSIFY_ERROR("classify.error")`

      - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

      - `CLASSIFY_PENDING("classify.pending")`

      - `CLASSIFY_RUNNING("classify.running")`

      - `CLASSIFY_SUCCESS("classify.success")`

      - `EXTRACT_CANCELLED("extract.cancelled")`

      - `EXTRACT_ERROR("extract.error")`

      - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

      - `EXTRACT_PENDING("extract.pending")`

      - `EXTRACT_SUCCESS("extract.success")`

      - `PARSE_CANCELLED("parse.cancelled")`

      - `PARSE_ERROR("parse.error")`

      - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

      - `PARSE_PENDING("parse.pending")`

      - `PARSE_RUNNING("parse.running")`

      - `PARSE_SUCCESS("parse.success")`

      - `SHEETS_CANCELLED("sheets.cancelled")`

      - `SHEETS_ERROR("sheets.error")`

      - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

      - `SHEETS_PENDING("sheets.pending")`

      - `SHEETS_SUCCESS("sheets.success")`

      - `SPLIT_CANCELLED("split.cancelled")`

      - `SPLIT_ERROR("split.error")`

      - `SPLIT_PENDING("split.pending")`

      - `SPLIT_PROCESSING("split.processing")`

      - `SPLIT_SUCCESS("split.success")`

      - `UNMAPPED_EVENT("unmapped_event")`

    - `Optional<WebhookHeaders> webhookHeaders`

      Custom HTTP headers sent with each webhook request (e.g. auth tokens)

    - `Optional<String> webhookOutputFormat`

      Response format sent to the webhook: 'string' (default) or 'json'

    - `Optional<String> webhookSigningSecret`

      Shared signing secret used to sign webhook deliveries. When set, each request includes an HMAC-SHA256 signature of the request body in the 'LC-Signature' header (value 'sha256=<hex>'). Recompute the HMAC over the raw request body with this secret to verify the delivery is authentic.

    - `Optional<String> webhookUrl`

      URL to receive webhook POST notifications

### Returns

- `class SplitCreateResponse:`

  A split job.

  - `String id`

    Unique identifier for the split job.

  - `List<SplitCategory> categories`

    Categories used for splitting.

    - `String name`

      Name of the category.

    - `Optional<String> description`

      Optional description of what content belongs in this category.

  - `DocumentInputType documentInputType`

    Whether the input was a file or parse job

    - `FILE_ID("file_id")`

    - `PARSE_JOB_ID("parse_job_id")`

    - `URL("url")`

  - `String fileInput`

    File ID or parse job ID

  - `String projectId`

    Project this job belongs to.

  - `String status`

    Current job status. Valid values are: pending, processing, completed, failed, cancelled.

  - `String userId`

    User who created this job.

  - `Optional<String> configurationId`

    Split configuration ID used for this job.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<String> errorMessage`

    Error message if the job failed.

  - `Optional<SplitResultResponse> result`

    Result of a completed split job.

    - `List<SplitSegmentResponse> segments`

      List of document segments.

      - `String category`

        Category name this split belongs to.

      - `String confidenceCategory`

        Categorical confidence level. Valid values are: high, medium, low.

      - `List<long> pages`

        1-indexed page numbers in this split.

  - `Optional<SplittingStrategy> splittingStrategy`

    Strategy used for splitting.

    - `Optional<AllowUncategorized> allowUncategorized`

      Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

      - `FORBID("forbid")`

      - `INCLUDE("include")`

      - `OMIT("omit")`

    - `Optional<String> customInstructions`

      Free-form guidance for where segment boundaries are placed.

    - `Optional<Long> minPagesPerSplit`

      Minimum pages per segment. Shorter segments are merged into an adjacent segment; 1 disables merging.

  - `Optional<String> transactionId`

    Idempotency key scoped to the project, if one was provided.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.split.SplitCreateParams;
import ai.llamaindex.llamacloud.models.split.SplitCreateResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        SplitCreateParams params = SplitCreateParams.builder()
            .fileInput("dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
            .build();
        SplitCreateResponse split = client.split().create(params);
    }
}
```

#### Response

```json
{
  "id": "id",
  "categories": [
    {
      "name": "x",
      "description": "x"
    }
  ],
  "document_input_type": "file_id",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "project_id",
  "status": "status",
  "user_id": "user_id",
  "configuration_id": "configuration_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "error_message": "error_message",
  "result": {
    "segments": [
      {
        "category": "category",
        "confidence_category": "confidence_category",
        "pages": [
          0
        ]
      }
    ]
  },
  "splitting_strategy": {
    "allow_uncategorized": "forbid",
    "custom_instructions": "Start a new segment at every signature page.",
    "min_pages_per_split": 1
  },
  "transaction_id": "transaction_id",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## List Split Jobs

`SplitListPage split().list(SplitListParamsparams = SplitListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/split/jobs`

List document split jobs.

### Parameters

- `SplitListParams params`

  - `Optional<LocalDateTime> createdAtOnOrAfter`

    Include items created at or after this timestamp (inclusive)

  - `Optional<LocalDateTime> createdAtOnOrBefore`

    Include items created at or before this timestamp (inclusive)

  - `Optional<List<String>> jobIds`

    Filter by specific job IDs

  - `Optional<String> organizationId`

  - `Optional<Long> pageSize`

  - `Optional<String> pageToken`

  - `Optional<String> projectId`

  - `Optional<Status> status`

    Filter by job status (pending, processing, completed, failed, cancelled)

    - `CANCELLED("cancelled")`

    - `COMPLETED("completed")`

    - `FAILED("failed")`

    - `PENDING("pending")`

    - `PROCESSING("processing")`

### Returns

- `class SplitListResponse:`

  A split job.

  - `String id`

    Unique identifier for the split job.

  - `List<SplitCategory> categories`

    Categories used for splitting.

    - `String name`

      Name of the category.

    - `Optional<String> description`

      Optional description of what content belongs in this category.

  - `DocumentInputType documentInputType`

    Whether the input was a file or parse job

    - `FILE_ID("file_id")`

    - `PARSE_JOB_ID("parse_job_id")`

    - `URL("url")`

  - `String fileInput`

    File ID or parse job ID

  - `String projectId`

    Project this job belongs to.

  - `String status`

    Current job status. Valid values are: pending, processing, completed, failed, cancelled.

  - `String userId`

    User who created this job.

  - `Optional<String> configurationId`

    Split configuration ID used for this job.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<String> errorMessage`

    Error message if the job failed.

  - `Optional<SplitResultResponse> result`

    Result of a completed split job.

    - `List<SplitSegmentResponse> segments`

      List of document segments.

      - `String category`

        Category name this split belongs to.

      - `String confidenceCategory`

        Categorical confidence level. Valid values are: high, medium, low.

      - `List<long> pages`

        1-indexed page numbers in this split.

  - `Optional<SplittingStrategy> splittingStrategy`

    Strategy used for splitting.

    - `Optional<AllowUncategorized> allowUncategorized`

      Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

      - `FORBID("forbid")`

      - `INCLUDE("include")`

      - `OMIT("omit")`

    - `Optional<String> customInstructions`

      Free-form guidance for where segment boundaries are placed.

    - `Optional<Long> minPagesPerSplit`

      Minimum pages per segment. Shorter segments are merged into an adjacent segment; 1 disables merging.

  - `Optional<String> transactionId`

    Idempotency key scoped to the project, if one was provided.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.split.SplitListPage;
import ai.llamaindex.llamacloud.models.split.SplitListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        SplitListPage page = client.split().list();
    }
}
```

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "categories": [
        {
          "name": "x",
          "description": "x"
        }
      ],
      "document_input_type": "file_id",
      "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "project_id": "project_id",
      "status": "status",
      "user_id": "user_id",
      "configuration_id": "configuration_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "error_message": "error_message",
      "result": {
        "segments": [
          {
            "category": "category",
            "confidence_category": "confidence_category",
            "pages": [
              0
            ]
          }
        ]
      },
      "splitting_strategy": {
        "allow_uncategorized": "forbid",
        "custom_instructions": "Start a new segment at every signature page.",
        "min_pages_per_split": 1
      },
      "transaction_id": "transaction_id",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```

## Get Split Job

`SplitGetResponse split().get(SplitGetParamsparams = SplitGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/split/jobs/{split_job_id}`

Get a document split job.

### Parameters

- `SplitGetParams params`

  - `Optional<String> splitJobId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class SplitGetResponse:`

  A split job.

  - `String id`

    Unique identifier for the split job.

  - `List<SplitCategory> categories`

    Categories used for splitting.

    - `String name`

      Name of the category.

    - `Optional<String> description`

      Optional description of what content belongs in this category.

  - `DocumentInputType documentInputType`

    Whether the input was a file or parse job

    - `FILE_ID("file_id")`

    - `PARSE_JOB_ID("parse_job_id")`

    - `URL("url")`

  - `String fileInput`

    File ID or parse job ID

  - `String projectId`

    Project this job belongs to.

  - `String status`

    Current job status. Valid values are: pending, processing, completed, failed, cancelled.

  - `String userId`

    User who created this job.

  - `Optional<String> configurationId`

    Split configuration ID used for this job.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<String> errorMessage`

    Error message if the job failed.

  - `Optional<SplitResultResponse> result`

    Result of a completed split job.

    - `List<SplitSegmentResponse> segments`

      List of document segments.

      - `String category`

        Category name this split belongs to.

      - `String confidenceCategory`

        Categorical confidence level. Valid values are: high, medium, low.

      - `List<long> pages`

        1-indexed page numbers in this split.

  - `Optional<SplittingStrategy> splittingStrategy`

    Strategy used for splitting.

    - `Optional<AllowUncategorized> allowUncategorized`

      Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

      - `FORBID("forbid")`

      - `INCLUDE("include")`

      - `OMIT("omit")`

    - `Optional<String> customInstructions`

      Free-form guidance for where segment boundaries are placed.

    - `Optional<Long> minPagesPerSplit`

      Minimum pages per segment. Shorter segments are merged into an adjacent segment; 1 disables merging.

  - `Optional<String> transactionId`

    Idempotency key scoped to the project, if one was provided.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.split.SplitGetParams;
import ai.llamaindex.llamacloud.models.split.SplitGetResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        SplitGetResponse split = client.split().get("split_job_id");
    }
}
```

#### Response

```json
{
  "id": "id",
  "categories": [
    {
      "name": "x",
      "description": "x"
    }
  ],
  "document_input_type": "file_id",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "project_id",
  "status": "status",
  "user_id": "user_id",
  "configuration_id": "configuration_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "error_message": "error_message",
  "result": {
    "segments": [
      {
        "category": "category",
        "confidence_category": "confidence_category",
        "pages": [
          0
        ]
      }
    ]
  },
  "splitting_strategy": {
    "allow_uncategorized": "forbid",
    "custom_instructions": "Start a new segment at every signature page.",
    "min_pages_per_split": 1
  },
  "transaction_id": "transaction_id",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Delete Split Job

`JsonValue split().delete(SplitDeleteParamsparams = SplitDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**delete** `/api/v1/split/jobs/{split_job_id}`

Delete a split job and its results.

### Parameters

- `SplitDeleteParams params`

  - `Optional<String> splitJobId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class SplitDeleteResponse:`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.split.SplitDeleteParams;
import ai.llamaindex.llamacloud.models.split.SplitDeleteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        SplitDeleteResponse split = client.split().delete("split_job_id");
    }
}
```

#### Response

```json
{}
```

## Cancel Split Job

`SplitCancelResponse split().cancel(SplitCancelParamsparams = SplitCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/split/jobs/{split_job_id}/cancel`

Cancel a running split job.

Requests cancellation; the job transitions to CANCELLED asynchronously once processing stops. Returns the job, which may still be in its current non-terminal state. Jobs already in a terminal state (COMPLETED, FAILED, CANCELLED) cannot be cancelled.

### Parameters

- `SplitCancelParams params`

  - `Optional<String> splitJobId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class SplitCancelResponse:`

  A split job.

  - `String id`

    Unique identifier for the split job.

  - `List<SplitCategory> categories`

    Categories used for splitting.

    - `String name`

      Name of the category.

    - `Optional<String> description`

      Optional description of what content belongs in this category.

  - `DocumentInputType documentInputType`

    Whether the input was a file or parse job

    - `FILE_ID("file_id")`

    - `PARSE_JOB_ID("parse_job_id")`

    - `URL("url")`

  - `String fileInput`

    File ID or parse job ID

  - `String projectId`

    Project this job belongs to.

  - `String status`

    Current job status. Valid values are: pending, processing, completed, failed, cancelled.

  - `String userId`

    User who created this job.

  - `Optional<String> configurationId`

    Split configuration ID used for this job.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<String> errorMessage`

    Error message if the job failed.

  - `Optional<SplitResultResponse> result`

    Result of a completed split job.

    - `List<SplitSegmentResponse> segments`

      List of document segments.

      - `String category`

        Category name this split belongs to.

      - `String confidenceCategory`

        Categorical confidence level. Valid values are: high, medium, low.

      - `List<long> pages`

        1-indexed page numbers in this split.

  - `Optional<SplittingStrategy> splittingStrategy`

    Strategy used for splitting.

    - `Optional<AllowUncategorized> allowUncategorized`

      Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

      - `FORBID("forbid")`

      - `INCLUDE("include")`

      - `OMIT("omit")`

    - `Optional<String> customInstructions`

      Free-form guidance for where segment boundaries are placed.

    - `Optional<Long> minPagesPerSplit`

      Minimum pages per segment. Shorter segments are merged into an adjacent segment; 1 disables merging.

  - `Optional<String> transactionId`

    Idempotency key scoped to the project, if one was provided.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.split.SplitCancelParams;
import ai.llamaindex.llamacloud.models.split.SplitCancelResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        SplitCancelResponse response = client.split().cancel("split_job_id");
    }
}
```

#### Response

```json
{
  "id": "id",
  "categories": [
    {
      "name": "x",
      "description": "x"
    }
  ],
  "document_input_type": "file_id",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "project_id",
  "status": "status",
  "user_id": "user_id",
  "configuration_id": "configuration_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "error_message": "error_message",
  "result": {
    "segments": [
      {
        "category": "category",
        "confidence_category": "confidence_category",
        "pages": [
          0
        ]
      }
    ]
  },
  "splitting_strategy": {
    "allow_uncategorized": "forbid",
    "custom_instructions": "Start a new segment at every signature page.",
    "min_pages_per_split": 1
  },
  "transaction_id": "transaction_id",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
