Skip to content

Processing API

API Key

The Processing API provides endpoints for retrieving and managing processed documents. These endpoints allow you to access the results of completed jobs and retrieve user documents using API key authentication.

API Endpoints

Get Processing Document

GET /processing/ID/document

Retrieve a specific processed document by its ID.

Terminal window
curl -X GET https://api.shrinked.com/processing/doc123456/document \
-H "x-api-key: YOUR_API_KEY"

Get User Documents

GET /processing/user/userId/documents

Retrieve all processed documents for a specific user.

Terminal window
curl -X GET https://api.shrinked.com/processing/user/user123456/documents?limit=20&sortBy=createdAt&sortOrder=desc \
-H "x-api-key: YOUR_API_KEY"

Get Document Content By Section

GET /processing/ID/sections/sectionId

Retrieve a specific section of a processed document.

Terminal window
curl -X GET https://api.shrinked.com/processing/doc123456/sections/section1 \
-H "x-api-key: YOUR_API_KEY"

Get Document Summary

GET /processing/ID/summary

Retrieve a summary of a processed document.

Terminal window
curl -X GET https://api.shrinked.com/processing/doc123456/summary?length=medium \
-H "x-api-key: YOUR_API_KEY"

Get Document Metadata

GET /processing/ID/metadata

Retrieve metadata about a processed document.

Terminal window
curl -X GET https://api.shrinked.com/processing/doc123456/metadata \
-H "x-api-key: YOUR_API_KEY"

Document Structure

Processed documents typically contain the following components:

Title

Document title automatically extracted from content

Content

Full processed text content

Metadata

Processing metadata (source, time, count, language)

Sections

Organized document sections with titles

Summary

Concise summary of the document

Keywords

Key topics and entities detected in the content

The structure of the document may vary depending on the processing scenario used when creating the job.

Working with Large Documents

Use Pagination

When retrieving user documents, use pagination parameters (limit and offset) to manage large result sets.

Request Specific Sections

For particularly large documents, retrieve specific sections rather than the entire document to improve performance.

Use the Summary Endpoint

Start with the summary endpoint to get a quick overview before requesting the full document.

Export to PDF

Use the PDF API to export documents in portable formats for offline viewing and distribution.

Capsules API

Manage and interact with AI-generated content capsules using the Capsules API.

Error Handling

The Processing API uses standard HTTP status codes:

Status CodeDescription
200Request successful
400Bad request (invalid parameters)
401Unauthorized (invalid credentials)
403Forbidden (insufficient permissions)
404Document not found
500Server error

Error responses include a descriptive message to help troubleshoot issues:

{
"error": {
"code": "DOCUMENT_NOT_FOUND",
"message": "The requested document could not be found"
}
}

Common Error Codes

Error CodeDescription
DOCUMENT_NOT_FOUNDThe requested document does not exist
SECTION_NOT_FOUNDThe requested section does not exist
INVALID_DOCUMENT_IDThe document ID format is invalid
ACCESS_DENIEDYou don’t have permission to access this document
PROCESSING_INCOMPLETEThe document is still being processed