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

# Troubleshoot Splitting

export const splitJSON = 'split rules';

export const split = 'ADE Split';

export const adePythonLibrary = 'ade-python';

export const dpt2mini = 'DPT-2 mini';

export const dpt2 = 'DPT-2';

export const dpt1 = 'DPT-1';

export const dpt = 'Document Pre-Trained Transformer';

export const companyName = 'LandingAI';

export const extract = 'ADE Extract';

export const parse = 'ADE Parse';

export const ade = 'Agentic Document Extraction';

Use this section to troubleshoot issues encountered when calling the [{split}](https://docs.landing.ai/api-reference/tools/ade-split) API ([https://api.va.landing.ai/v1/ade/split](https://api.va.landing.ai/v1/ade/split)).

## Common Status Codes

| Status Code | Name                  | Description                                                       | What to Do                                                                                                                                  |
| ----------- | --------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| 200         | Success               | Split classification completed successfully.                      | Continue with normal operations.                                                                                                            |
| 400         | Bad Request           | Invalid request due to markdown download failure from URL.        | Review error message for specific issue. See [Status 400](#status-400-bad-request).                                                         |
| 401         | Unauthorized          | Missing or invalid API key.                                       | Check that your `apikey` header is present and contains a valid [API key](./agentic-api-key).                                               |
| 402         | Payment Required      | Your account does not have enough credits to complete processing. | If you have multiple accounts, make sure you're using the correct [API key](./agentic-api-key). Add more credits to your account.           |
| 422         | Unprocessable Entity  | Input validation failed.                                          | Review your request parameters. See [Status 422](#status-422-unprocessable-entity).                                                         |
| 429         | Too Many Requests     | Rate limit exceeded.                                              | Wait before retrying. Reduce request frequency and implement exponential backoff.                                                           |
| 500         | Internal Server Error | Server error during split classification.                         | Retry. If the issue persists, contact [support@landing.ai](mailto:support@landing.ai). See [Status 500](#status-500-internal-server-error). |
| 504         | Gateway Timeout       | Request processing exceeded the timeout limit.                    | Reduce markdown content size. See [Status 504](#status-504-gateway-timeout).                                                                |

## Status 400: Bad Request

This status code indicates invalid request parameters or client-side errors. Review the specific error message to identify the issue.

### Error: Failed to download document from URL

This error occurs when the API cannot download the Markdown file from the provided `markdown_url`.

**Error message:**

```
Failed to download document from URL: {error_details}
```

**What to do:**

* Verify the URL is accessible and returns valid content.
* Check network connectivity and URL permissions.
* Ensure the URL points to a Markdown file (.md extension).

## Status 422: Unprocessable Entity

This status code indicates input validation failures. Review the error message and adjust your request parameters.

### Error: No markdown file, content, or URL provided

This error occurs when your request does not include the `markdown` parameter or `markdown_url` parameter, or when the values are empty.

**Error message:**

```
No markdown file, content, or URL provided.
```

**What to do:**

Add one of these parameters to your request:

* Use the `markdown` parameter to upload a Markdown file or provide inline Markdown content, OR
* Use the `markdown_url` parameter to provide a URL to a Markdown file.

### Error: Multiple markdown files detected

This error occurs when multiple Markdown files are included in the request.

**Error message:**

```
Multiple markdown files detected (X). Please provide only one markdown file.
```

**What to do:**

Send only one Markdown file per request.

### Error: Unsupported format

This error occurs when you provide a file other than Markdown (.md) to the split endpoint, such as PDF, DOCX, XLSX, or image files.

**Error message:**

```
Unsupported format: {mime_type} ({filename}). Supported formats: MD
```

**What to do:**

* The split endpoint only accepts Markdown files with a .md extension.
* If you have a PDF, DOCX, or other document format, use the [{parse} API](https://docs.landing.ai/api-reference/tools/ade-parse) endpoint to convert your document to Markdown first, then pass the parsed Markdown output to the split endpoint.
* Ensure your file has a .md extension and contains valid UTF-8 encoded Markdown content.

### Error: split\_class must contain at most 19 split classification names

This error occurs when you provide more than 19 Split Types in the `split_class` parameter.

**Error message:**

```
split_class must contain at most 19 split classification names
```

**What to do:**

* Reduce the number of Split Types to 19 or fewer.
* Consider combining similar Split Types or removing less important ones.
* For more information, see [Split Types](./ade-split#split-types).

## Status 500: Internal Server Error

This error indicates an unexpected server error occurred during split classification.

**Error message:**

```
Internal server error during split classification
```

**What to do:**

* Retry the request.
* Verify your [Split Rules](./ade-split#split-rules) are properly formatted with valid Split Type names, descriptions, and identifiers.
* Check that your Markdown content is valid and properly formatted.
* If the error persists, contact [support@landing.ai](mailto:support@landing.ai).

## Status 504: Gateway Timeout

This error occurs when the split classification process exceeds the timeout limit.

**Error message:**

```
Request timed out after {seconds} seconds
```

**What to do:**

* Reduce the size of your Markdown document.
* If processing a very large document, consider splitting it into smaller sections before using the split endpoint.
* If the error persists, contact [support@landing.ai](mailto:support@landing.ai).

## Best Practices for Avoiding Errors

* **Use parsed Markdown**: Always pass Markdown content that has been generated by the [{parse} API](./ade-separate-apis). The split endpoint expects structured Markdown with the specific format produced by the parse API.
* **Define clear Split Rules**: Provide detailed descriptions for each Split Type to help the model accurately classify your document sections. For guidance, see [Split Rules](./ade-split#split-rules).
* **Use appropriate identifiers**: Only specify identifiers when your document contains multiple instances of the same Split Type that need to be separated. For guidance, see [Identifiers](./ade-split#identifiers-optional).

## When Are Credits Consumed?

Credits are consumed only when the {split} API returns a 200 status code. All other responses, including errors, do not consume credits.
