/affinda-documents | Type: Application | PCID required: Yes
Tools
affinda_documents_batch_create_annotations
Batch create annotations Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
body | object[] | Yes | — | Request body |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rectangles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pageIndex": {
"type": "integer"
},
"x0": {
"type": "number"
},
"y0": {
"type": "number"
},
"x1": {
"type": "number"
},
"y1": {
"type": "number"
}
}
},
"description": "x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles."
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"pageIndex": {
"type": "integer",
"description": "The page number within the document, starting from 0."
},
"dataPoint": {
"type": "string",
"description": "Data point's identifier"
},
"field": {
"type": "string",
"description": "Field's identifier"
},
"raw": {
"type": "string",
"description": "Raw data extracted from the before any post-processing"
},
"parsed": {
"description": "The parsed value"
},
"isClientVerified": {
"type": "boolean",
"description": "Indicates whether the data has been validated by a human"
},
"parent": {
"type": "integer",
"description": "The parent annotation's ID"
},
"validationResults": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created": {
"type": "array",
"description": "List of validation results created during this operation."
},
"updated": {
"type": "array",
"description": "List of validation results updated during this operation."
},
"deleted": {
"type": "array",
"description": "List of validation results deleted during this operation."
}
}
},
"description": "The validation results created, changed or deleted as a result of creating the annotation."
}
},
"required": [
"document",
"pageIndex"
]
},
"description": "Request body"
}
},
"required": [
"PCID",
"body"
]
}
affinda_documents_batch_create_validation_results
Batch create validation results Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
body | object[] | Yes | — | Request body |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"annotations": {
"type": "array",
"items": {
"type": "integer"
},
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
},
"required": [
"annotations",
"ruleSlug",
"message",
"document"
]
},
"description": "Request body"
}
},
"required": [
"PCID",
"body"
]
}
affinda_documents_batch_delete_annotations
Batch delete annotations Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
body | integer[] | Yes | — | Array of annotation IDs to be deleted |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"body": {
"type": "array",
"items": {
"type": "integer"
},
"description": "Array of annotation IDs to be deleted"
}
},
"required": [
"PCID",
"body"
]
}
affinda_documents_batch_delete_validation_results
Batch delete validation results Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids | integer[] | Yes | — | List of validation result IDs to delete. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"ids": {
"type": "array",
"items": {
"type": "integer"
},
"description": "List of validation result IDs to delete."
}
},
"required": [
"PCID",
"ids"
]
}
affinda_documents_batch_update_annotations
Batch update annotations Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
body | object[] | Yes | — | Request body |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Annotation's ID"
},
"rectangles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pageIndex": {
"type": "integer"
},
"x0": {
"type": "number"
},
"y0": {
"type": "number"
},
"x1": {
"type": "number"
},
"y1": {
"type": "number"
}
}
},
"description": "x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles."
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"pageIndex": {
"type": "integer",
"description": "The page number within the document, starting from 0."
},
"raw": {
"type": "string",
"description": "Raw data extracted from the before any post-processing"
},
"parsed": {
"description": "The parsed value"
},
"isClientVerified": {
"type": "boolean",
"description": "Indicates whether the data has been validated by a human"
},
"dataPoint": {
"type": "string",
"description": "Data point's identifier"
},
"parent": {
"type": "integer",
"description": "The parent annotation's ID"
},
"validationResults": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created": {
"type": "array",
"description": "List of validation results created during this operation."
},
"updated": {
"type": "array",
"description": "List of validation results updated during this operation."
},
"deleted": {
"type": "array",
"description": "List of validation results deleted during this operation."
}
}
},
"description": "The validation results created, changed or deleted as a result of updating the annotation."
}
},
"required": [
"id"
]
},
"description": "Request body"
}
},
"required": [
"PCID",
"body"
]
}
affinda_documents_create_annotation
Create a annotation Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
dataPoint | string | No | — | Data point’s identifier | |
document | string | Yes | — | Unique identifier for the document | |
field | string | null | No | — | Field’s identifier |
isClientVerified | boolean | No | — | Indicates whether the data has been validated by a human | |
pageIndex | integer | null | Yes | — | The page number within the document, starting from 0. |
parent | integer | null | No | — | The parent annotation’s ID |
parsed | object | No | — | The parsed value | |
raw | string | null | No | — | Raw data extracted from the before any post-processing |
rectangles | object[] | No | — | x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles. | |
validationResults | object[] | No | — | The validation results created, changed or deleted as a result of creating the annotation. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"dataPoint": {
"type": "string",
"description": "Data point's identifier"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"field": {
"type": [
"string",
"null"
],
"description": "Field's identifier"
},
"isClientVerified": {
"type": "boolean",
"description": "Indicates whether the data has been validated by a human"
},
"pageIndex": {
"type": [
"integer",
"null"
],
"description": "The page number within the document, starting from 0."
},
"parent": {
"type": [
"integer",
"null"
],
"description": "The parent annotation's ID"
},
"parsed": {
"description": "The parsed value"
},
"raw": {
"type": [
"string",
"null"
],
"description": "Raw data extracted from the before any post-processing"
},
"rectangles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pageIndex": {
"type": "integer",
"description": "Page Index"
},
"x0": {
"type": "number",
"description": "The x0 value"
},
"y0": {
"type": "number",
"description": "The y0 value"
},
"x1": {
"type": "number",
"description": "The x1 value"
},
"y1": {
"type": "number",
"description": "The y1 value"
}
},
"required": [
"x0",
"y0",
"x1",
"y1"
]
},
"description": "x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles."
},
"validationResults": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results created during this operation."
},
"updated": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results updated during this operation."
},
"deleted": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results deleted during this operation."
}
}
},
"description": "The validation results created, changed or deleted as a result of creating the annotation."
}
},
"required": [
"PCID",
"document",
"pageIndex"
]
}
affinda_documents_create_document
Upload a document for parsing Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
snake_case | boolean | No | — | Whether to return the response in snake_case instead of camelCase. Default is false. | |
collection | string | No | — | Uniquely identify a collection. | |
compact | boolean | No | — | If true, the returned parse result (assuming wait is also true) will be a compact version of the full result. | |
customIdentifier | string | No | — | Specify a custom identifier for the document if you need one, not required to be unique. | |
deleteAfterParse | boolean | No | — | If true, no data will be stored after parsing. Only compatible with requests where wait: True. | |
documentType | string | null | No | — | The document type’s identifier. Provide if you already know the document type. |
enableValidationTool | boolean | No | — | If true, the document will be viewable in the Affinda Validation Tool. Set to False to optimize parsing speed. | |
expiryTime | string | null | No | — | The date/time in ISO-8601 format when the document will be automatically deleted. Defaults to no expiry. |
file | string | No | — | File as binary data blob. Supported formats: PDF, DOC, DOCX, TXT, RTF, HTML, PNG, JPG, TIFF, ODT, XLS, XLSX | |
fileName | string | null | No | — | Optional filename of the file |
identifier | string | No | — | Deprecated in favor of customIdentifier. | |
language | string | null | No | — | Language code in ISO 639-1 format. Must specify zh-cn or zh-tw for Chinese. |
limitToExamples | string[] | No | — | Restrict LLM example selection to the specified document identifiers. | |
llmHint | string | null | No | — | Optional hint inserted into the LLM prompt when processing this document. |
lowPriority | boolean | No | — | Explicitly mark this document as low priority. | |
regionBias | string | No | — | A JSON representation of the RegionBias object. | |
rejectDuplicates | boolean | null | No | — | If “true”, parsing will fail when the uploaded document is duplicate of an existing document, no credits will be consumed. If “false”, will parse the document normally whether its a duplicate or not. If not provided, will fallback to the workspace settings. |
url | string | null | No | — | URL to download the document. |
useOcr | boolean | null | No | — | If true, the document will be treated like an image, and the text will be extracted using OCR. If false, the document will be treated like a PDF, and the text will be extracted using the parser. If not set, we will determine whether to use OCR based on whether words are found in the document. |
wait | boolean | No | — | If “true” (default), will return a response only after processing has completed. If “false”, will return an empty data object which can be polled at the GET endpoint until processing is complete. | |
warningMessages | object[] | No | — | Warning Messages | |
workspace | string | No | — | Uniquely identify a workspace. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"snake_case": {
"type": "boolean",
"description": "Whether to return the response in snake_case instead of camelCase. Default is false."
},
"collection": {
"type": "string",
"description": "Uniquely identify a collection."
},
"compact": {
"type": "boolean",
"description": "If true, the returned parse result (assuming `wait` is also true) will be a compact version of the full result."
},
"customIdentifier": {
"type": "string",
"description": "Specify a custom identifier for the document if you need one, not required to be unique."
},
"deleteAfterParse": {
"type": "boolean",
"description": "If true, no data will be stored after parsing. Only compatible with requests where wait: True."
},
"documentType": {
"type": [
"string",
"null"
],
"description": "The document type's identifier. Provide if you already know the document type."
},
"enableValidationTool": {
"type": "boolean",
"description": "If true, the document will be viewable in the Affinda Validation Tool. Set to False to optimize parsing speed."
},
"expiryTime": {
"type": [
"string",
"null"
],
"description": "The date/time in ISO-8601 format when the document will be automatically deleted. Defaults to no expiry."
},
"file": {
"type": "string",
"description": "File as binary data blob. Supported formats: PDF, DOC, DOCX, TXT, RTF, HTML, PNG, JPG, TIFF, ODT, XLS, XLSX"
},
"fileName": {
"type": [
"string",
"null"
],
"description": "Optional filename of the file"
},
"identifier": {
"type": "string",
"description": "Deprecated in favor of `customIdentifier`."
},
"language": {
"type": [
"string",
"null"
],
"description": "Language code in ISO 639-1 format. Must specify zh-cn or zh-tw for Chinese."
},
"limitToExamples": {
"type": "array",
"items": {
"type": "string"
},
"description": "Restrict LLM example selection to the specified document identifiers."
},
"llmHint": {
"type": [
"string",
"null"
],
"description": "Optional hint inserted into the LLM prompt when processing this document."
},
"lowPriority": {
"type": "boolean",
"description": "Explicitly mark this document as low priority."
},
"regionBias": {
"type": "string",
"description": "A JSON representation of the RegionBias object."
},
"rejectDuplicates": {
"type": [
"boolean",
"null"
],
"description": "If \"true\", parsing will fail when the uploaded document is duplicate of an existing document, no credits will be consumed. If \"false\", will parse the document normally whether its a duplicate or not. If not provided, will fallback to the workspace settings."
},
"url": {
"type": [
"string",
"null"
],
"description": "URL to download the document."
},
"useOcr": {
"type": [
"boolean",
"null"
],
"description": "If true, the document will be treated like an image, and the text will be extracted using OCR. If false, the document will be treated like a PDF, and the text will be extracted using the parser. If not set, we will determine whether to use OCR based on whether words are found in the document."
},
"wait": {
"type": "boolean",
"description": "If \"true\" (default), will return a response only after processing has completed. If \"false\", will return an empty data object which can be polled at the GET endpoint until processing is complete."
},
"warningMessages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"warningCode": {
"type": "string",
"description": "Warning Code"
},
"warningDetail": {
"type": "string",
"description": "Warning Detail"
}
}
},
"description": "Warning Messages"
},
"workspace": {
"type": "string",
"description": "Uniquely identify a workspace."
}
},
"required": [
"PCID"
]
}
affinda_documents_create_document_type
Create a document type Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
description | string | null | No | — | A description of the document type. |
name | string | Yes | — | The name of the document type. | |
organization | string | Yes | — | The identifier of the organization this document type belongs to. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"description": {
"type": [
"string",
"null"
],
"description": "A description of the document type."
},
"name": {
"type": "string",
"description": "The name of the document type."
},
"organization": {
"type": "string",
"description": "The identifier of the organization this document type belongs to."
}
},
"required": [
"PCID",
"name",
"organization"
]
}
affinda_documents_create_validation_result
Create a validation result Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
annotations | integer[] | Yes | — | List of annotation ids that were validated | |
document | string | Yes | — | Unique identifier for the document | |
message | string | Yes | — | Message explaining why the validation failed | |
passed | boolean | null | No | — | Whether the validation passed or not, null if the validation was not applicable |
ruleSlug | string | Yes | — | The kebab-case slug of the validation rule that was applied |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"annotations": {
"type": "array",
"items": {
"type": "integer"
},
"description": "List of annotation ids that were validated"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"passed": {
"type": [
"boolean",
"null"
],
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
}
},
"required": [
"PCID",
"annotations",
"document",
"message",
"ruleSlug"
]
}
affinda_documents_delete_annotation
Delete an annotation Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | integer | Yes | — | Annotation’s ID |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Annotation's ID"
}
},
"required": [
"PCID",
"id"
]
}
affinda_documents_delete_document
Delete a document Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document’s identifier |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document's identifier"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_delete_document_type
Delete a document type Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document type identifier |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document type identifier"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_delete_validation_result
Delete a validation result Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | integer | Yes | — | Validation result’s ID. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Validation result's ID."
}
},
"required": [
"PCID",
"id"
]
}
affinda_documents_get_all_annotations
Get list of all annotations Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
document | string | Yes | — | Filter by document. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"document": {
"type": "string",
"description": "Filter by document."
}
},
"required": [
"PCID",
"document"
]
}
affinda_documents_get_all_documents
Get list of all documents Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
offset | integer | No | — | The number of documents to skip before starting to collect the result set. |
limit | integer | No | — | The numbers of results to return. |
workspace | string | No | — | Filter by workspace. |
collection | string | No | — | Filter by collection. |
state | string | No | — | Filter by the document’s state. |
tags | integer[] | No | — | Filter by tag’s IDs. |
created_dt | string | No | — | Filter by created datetime. |
search | string | No | — | Partial, case-insensitive match with file name or tag name. |
ordering | string[] | No | — | Sort the result set. A ”-” at the beginning denotes DESC sort, e.g. -created_dt. Sort by multiple fields is supported. Supported values include: ‘file_name’, ‘extractor’, ‘created_dt’, ‘validated_dt’, ‘archived_dt’ and ‘parsed__<dataPointSlug>’. |
include_data | boolean | No | — | By default, this endpoint returns only the meta data of the documents. Set this to true will return a summary of the data that was parsed. If you want to retrieve the full set of data for a document, use the GET /documents/{identifier} endpoint. |
exclude | string[] | No | — | Exclude some documents from the result. |
in_review | boolean | No | — | Exclude documents that are currently being reviewed. |
failed | boolean | No | — | Filter by failed status. |
ready | boolean | No | — | Filter by ready status. |
validatable | boolean | No | — | Filter for validatable documents. |
has_challenges | boolean | No | — | Filter for documents with challenges. |
custom_identifier | string | No | — | Filter for documents with this custom identifier. |
compact | boolean | No | — | If “true”, the response is compacted to annotations’ parsed data. Annotations’ meta data are excluded. Default is “false”. |
count | boolean | No | — | If “false”, the documents count is not computed, thus saving time for large collections. Default is “true”. |
snake_case | boolean | No | — | Whether to return the response in snake_case instead of camelCase. Default is false. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"offset": {
"type": "integer",
"description": "The number of documents to skip before starting to collect the result set."
},
"limit": {
"type": "integer",
"description": "The numbers of results to return."
},
"workspace": {
"type": "string",
"description": "Filter by workspace."
},
"collection": {
"type": "string",
"description": "Filter by collection."
},
"state": {
"type": "string",
"description": "Filter by the document's state.",
"enum": [
"uploaded",
"review",
"validated",
"archived",
"rejected"
]
},
"tags": {
"type": "array",
"items": {
"type": "integer"
},
"description": "Filter by tag's IDs."
},
"created_dt": {
"type": "string",
"description": "Filter by created datetime.",
"enum": [
"today",
"yesterday",
"week",
"month",
"year"
]
},
"search": {
"type": "string",
"description": "Partial, case-insensitive match with file name or tag name."
},
"ordering": {
"type": "array",
"items": {
"type": "string"
},
"description": "Sort the result set. A \"-\" at the beginning denotes DESC sort, e.g. -created_dt. Sort by multiple fields is supported. Supported values include: 'file_name', 'extractor', 'created_dt', 'validated_dt', 'archived_dt' and 'parsed__<dataPointSlug>'."
},
"include_data": {
"type": "boolean",
"description": "By default, this endpoint returns only the meta data of the documents. Set this to `true` will return a summary of the data that was parsed. If you want to retrieve the full set of data for a document, use the `GET /documents/{identifier}` endpoint."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Exclude some documents from the result."
},
"in_review": {
"type": "boolean",
"description": "Exclude documents that are currently being reviewed."
},
"failed": {
"type": "boolean",
"description": "Filter by failed status."
},
"ready": {
"type": "boolean",
"description": "Filter by ready status."
},
"validatable": {
"type": "boolean",
"description": "Filter for validatable documents."
},
"has_challenges": {
"type": "boolean",
"description": "Filter for documents with challenges."
},
"custom_identifier": {
"type": "string",
"description": "Filter for documents with this custom identifier."
},
"compact": {
"type": "boolean",
"description": "If \"true\", the response is compacted to annotations' parsed data. Annotations' meta data are excluded. Default is \"false\"."
},
"count": {
"type": "boolean",
"description": "If \"false\", the documents count is not computed, thus saving time for large collections. Default is \"true\"."
},
"snake_case": {
"type": "boolean",
"description": "Whether to return the response in snake_case instead of camelCase. Default is false."
}
},
"required": [
"PCID"
]
}
affinda_documents_get_all_validation_results
Get list of all validation results Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
offset | integer | No | — | The number of documents to skip before starting to collect the result set. |
limit | integer | No | — | The numbers of results to return. |
document | string | Yes | — | Filter by document. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"offset": {
"type": "integer",
"description": "The number of documents to skip before starting to collect the result set."
},
"limit": {
"type": "integer",
"description": "The numbers of results to return."
},
"document": {
"type": "string",
"description": "Filter by document."
}
},
"required": [
"PCID",
"document"
]
}
affinda_documents_get_annotation
Get specific annotation Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | integer | Yes | — | Annotation’s ID |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Annotation's ID"
}
},
"required": [
"PCID",
"id"
]
}
affinda_documents_get_document
Get specific document Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document’s identifier |
format | string | No | — | Specify which format you want the response to be. Default is “json” |
compact | boolean | No | — | If “true”, the response is compacted to annotations’ parsed data. Annotations’ meta data are excluded. Default is “false”. |
snake_case | boolean | No | — | Whether to return the response in snake_case instead of camelCase. Default is false. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document's identifier"
},
"format": {
"type": "string",
"description": "Specify which format you want the response to be. Default is \"json\"",
"enum": [
"json",
"xml",
"hr-xml"
]
},
"compact": {
"type": "boolean",
"description": "If \"true\", the response is compacted to annotations' parsed data. Annotations' meta data are excluded. Default is \"false\"."
},
"snake_case": {
"type": "boolean",
"description": "Whether to return the response in snake_case instead of camelCase. Default is false."
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_get_document_type
Get a document type Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document type identifier |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document type identifier"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_get_document_types
List document types Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
organization | string | No | — | Filter by organization identifier |
workspace | string | No | — | Filter by workspace identifier |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"organization": {
"type": "string",
"description": "Filter by organization identifier"
},
"workspace": {
"type": "string",
"description": "Filter by workspace identifier"
}
},
"required": [
"PCID"
]
}
affinda_documents_get_redacted_document
Get redacted document Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document identifier |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document identifier"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_get_validation_result
Get specific validation result Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | integer | Yes | — | Validation result’s ID. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Validation result's ID."
}
},
"required": [
"PCID",
"id"
]
}
affinda_documents_json_schema_from_document_type
Generate JSON schema from a document type Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document type’s identifier |
title | string | No | — | Title for the JSON schema |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document type's identifier"
},
"title": {
"type": "string",
"description": "Title for the JSON schema"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_pydantic_models_from_document_type
Generate Pydantic models from a document type Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
identifier | string | Yes | — | Document type’s identifier |
model_name | string | No | — | Name for the Pydantic model |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document type's identifier"
},
"model_name": {
"type": "string",
"description": "Name for the Pydantic model"
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_update_annotation
Update an annotation Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
id | integer | Yes | — | Annotation’s ID | |
dataPoint | string | No | — | Data point’s identifier | |
document | string | No | — | Unique identifier for the document | |
field | string | null | No | — | Field’s identifier |
isClientVerified | boolean | No | — | Indicates whether the data has been validated by a human | |
pageIndex | integer | null | No | — | The page number within the document, starting from 0. |
parent | integer | null | No | — | The parent annotation’s ID |
parsed | object | No | — | The parsed value | |
raw | string | null | No | — | Raw data extracted from the before any post-processing |
rectangles | object[] | No | — | x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles. | |
validationResults | object[] | No | — | The validation results created, changed or deleted as a result of updating the annotation. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Annotation's ID"
},
"dataPoint": {
"type": "string",
"description": "Data point's identifier"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"field": {
"type": [
"string",
"null"
],
"description": "Field's identifier"
},
"isClientVerified": {
"type": "boolean",
"description": "Indicates whether the data has been validated by a human"
},
"pageIndex": {
"type": [
"integer",
"null"
],
"description": "The page number within the document, starting from 0."
},
"parent": {
"type": [
"integer",
"null"
],
"description": "The parent annotation's ID"
},
"parsed": {
"description": "The parsed value"
},
"raw": {
"type": [
"string",
"null"
],
"description": "Raw data extracted from the before any post-processing"
},
"rectangles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pageIndex": {
"type": "integer",
"description": "Page Index"
},
"x0": {
"type": "number",
"description": "The x0 value"
},
"y0": {
"type": "number",
"description": "The y0 value"
},
"x1": {
"type": "number",
"description": "The x1 value"
},
"y1": {
"type": "number",
"description": "The y1 value"
}
},
"required": [
"x0",
"y0",
"x1",
"y1"
]
},
"description": "x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles."
},
"validationResults": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results created during this operation."
},
"updated": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results updated during this operation."
},
"deleted": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Validation Result's ID"
},
"annotations": {
"type": "array",
"description": "List of annotation ids that were validated"
},
"passed": {
"type": "boolean",
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
}
}
},
"description": "List of validation results deleted during this operation."
}
}
},
"description": "The validation results created, changed or deleted as a result of updating the annotation."
}
},
"required": [
"PCID",
"id"
]
}
affinda_documents_update_document
Update a document Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
identifier | string | Yes | — | Document’s identifier | |
compact | boolean | No | — | If “true”, the response is compacted to annotations’ parsed data. Annotations’ meta data are excluded. Default is “false”. | |
snake_case | boolean | No | — | Whether to return the response in snake_case instead of camelCase. Default is false. | |
collection | string | No | — | Uniquely identify a collection. | |
customIdentifier | string | No | — | Specify a custom identifier for the document if you need one, not required to be unique. | |
documentType | string | null | No | — | The document type’s identifier. Provide if you already know the document type. |
expiryTime | string | null | No | — | The date/time in ISO-8601 format when the document will be automatically deleted. Defaults to no expiry. |
fileName | string | null | No | — | Optional filename of the file |
isArchived | boolean | No | — | Is Archived | |
isConfirmed | boolean | No | — | Is Confirmed | |
isRejected | boolean | No | — | Is Rejected | |
language | string | null | No | — | Language code in ISO 639-1 format. Must specify zh-cn or zh-tw for Chinese. |
llmHint | string | null | No | — | Optional hint inserted into the LLM prompt when processing this document. |
skipParse | boolean | No | — | Skip Parse | |
warningMessages | object[] | No | — | Warning Messages | |
workspace | string | No | — | Uniquely identify a workspace. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document's identifier"
},
"compact": {
"type": "boolean",
"description": "If \"true\", the response is compacted to annotations' parsed data. Annotations' meta data are excluded. Default is \"false\"."
},
"snake_case": {
"type": "boolean",
"description": "Whether to return the response in snake_case instead of camelCase. Default is false."
},
"collection": {
"type": "string",
"description": "Uniquely identify a collection."
},
"customIdentifier": {
"type": "string",
"description": "Specify a custom identifier for the document if you need one, not required to be unique."
},
"documentType": {
"type": [
"string",
"null"
],
"description": "The document type's identifier. Provide if you already know the document type."
},
"expiryTime": {
"type": [
"string",
"null"
],
"description": "The date/time in ISO-8601 format when the document will be automatically deleted. Defaults to no expiry."
},
"fileName": {
"type": [
"string",
"null"
],
"description": "Optional filename of the file"
},
"isArchived": {
"type": "boolean",
"description": "Is Archived"
},
"isConfirmed": {
"type": "boolean",
"description": "Is Confirmed"
},
"isRejected": {
"type": "boolean",
"description": "Is Rejected"
},
"language": {
"type": [
"string",
"null"
],
"description": "Language code in ISO 639-1 format. Must specify zh-cn or zh-tw for Chinese."
},
"llmHint": {
"type": [
"string",
"null"
],
"description": "Optional hint inserted into the LLM prompt when processing this document."
},
"skipParse": {
"type": "boolean",
"description": "Skip Parse"
},
"warningMessages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"warningCode": {
"type": "string",
"description": "Warning Code"
},
"warningDetail": {
"type": "string",
"description": "Warning Detail"
}
}
},
"description": "Warning Messages"
},
"workspace": {
"type": "string",
"description": "Uniquely identify a workspace."
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_update_document_type
Update a document type Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
identifier | string | Yes | — | Document type identifier | |
description | string | null | No | — | A new description of the document type. |
name | string | No | — | The new name of the document type. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"identifier": {
"type": "string",
"description": "Document type identifier"
},
"description": {
"type": [
"string",
"null"
],
"description": "A new description of the document type."
},
"name": {
"type": "string",
"description": "The new name of the document type."
}
},
"required": [
"PCID",
"identifier"
]
}
affinda_documents_update_validation_result
Update a validation result Parameters:| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
id | integer | Yes | — | Validation result’s ID. | |
annotations | integer[] | No | — | List of annotation ids that were validated | |
document | string | No | — | Unique identifier for the document | |
message | string | No | — | Message explaining why the validation failed | |
passed | boolean | null | No | — | Whether the validation passed or not, null if the validation was not applicable |
ruleSlug | string | No | — | The kebab-case slug of the validation rule that was applied |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"id": {
"type": "integer",
"description": "Validation result's ID."
},
"annotations": {
"type": "array",
"items": {
"type": "integer"
},
"description": "List of annotation ids that were validated"
},
"document": {
"type": "string",
"description": "Unique identifier for the document"
},
"message": {
"type": "string",
"description": "Message explaining why the validation failed"
},
"passed": {
"type": [
"boolean",
"null"
],
"description": "Whether the validation passed or not, null if the validation was not applicable"
},
"ruleSlug": {
"type": "string",
"description": "The kebab-case slug of the validation rule that was applied"
}
},
"required": [
"PCID",
"id"
]
}

