Skip to main content

Add document action

POST 

/documents/:documentId/actions

Add one or more actions to a document; this appends actions and does not replace previous actions

Each action type supports a different set of parameters as shown in the table below:

Action Parameters

ActionTypeParameterDescriptionExample
OCRocrParseTypesOcr Parsing strategy to useTEXT, FORMS, TABLES, QUERIES (requires 'ocrTextractQueries')
OCRocrTextractQueriesRequired for "QUERIES", questions to ask Textract
OCRocrEngineOcr Engine to usetesseract or textract
OCRocrOutputTypeConvert OCR result to an Output format (textract table only)true
OCRocrNumberOfPagesNumber of pages to OCR (from start)-1
OCRaddPdfDetectedCharactersAsTextPDF Documents convert images to texttrue or false
DATA_CLASSIFICATIONllmPromptEntityNameLLM Prompt Entity Name
FULLTEXTcharacterMaxMaximum number of characters to add to Fulltext destination-1
DOCUMENTTAGGINGengineTagging Engine to usechatgpt
DOCUMENTTAGGINGtagsComma-deliminted list of keywordsauthor,title,description
WEBHOOKurlWebhook URLhttps://yourdomain.com/webhook-endpoint
NOTIFICATIONnotificationTypeType of Notificationemail
NOTIFICATIONnotificationToCcNotification Carbon Copyemail@yourdomain.com
NOTIFICATIONnotificationToBccNotification Blind Carbon Copyemail@yourdomain.com
NOTIFICATIONnotificationSubjectNotification SubjectEmail Subject
NOTIFICATIONnotificationTextNotification as TextEmail Text
NOTIFICATIONnotificationHtmlNotification as HtmlEmail HTML Text
QUEUEqueueIdId of Queue
IDPmappingIdId of Mapping
EVENTBRIDGEeventBusNameThe name or ARN of the Amazon EventBridge to receive the event.
RESIZEwidthThe width of the image to resize (or 'auto').
RESIZEheightThe height of the image to resize (or 'auto').
RESIZEoutputTypeThe output type of the image (optional).
RESIZEpathThe path to use when creating resized document (optional).

Request

Path Parameters

    documentId stringrequired

    Document Identifier

Query Parameters

    siteId string

    Site Identifier

Body

    actions

    object[]

    List of Actions

  • Array [

  • type DocumentActionType (string)required

    Type of the Document Action

    Possible values: [ANTIVIRUS, DOCUMENTTAGGING, FULLTEXT, NOTIFICATION, OCR, QUEUE, WEBHOOK, IDP, PUBLISH, PDFEXPORT, EVENTBRIDGE, RESIZE, DATA_CLASSIFICATION, MALWARE_SCAN]

    parameters

    object

    ocrTextractQueries

    object[]

  • Array [

  • text string

    Natural-language question

    alias string

    Label to identify this query in the result

    pages string[]

    Page selection

  • ]

  • ocrParseTypes string

    OCR: Parse types - TEXT, FORMS, TABLES, QUERIES (must include ocrTextractQueries)

    ocrEngine OcrEngine (string)

    Type of OCR Engine to use

    Possible values: [TESSERACT, TEXTRACT]

    ocrOutputType OcrOutputType (string)

    OCR Engine output format (textract table only)

    Possible values: [CSV]

    ocrNumberOfPages string

    Number of pages to OCR (from start) (-1 all)

    addPdfDetectedCharactersAsText string

    OCR: For the rewriting of the PDF document, converting any image text to searchable text

    llmPromptEntityName string

    DATA_CLASSIFICATION: Set the LLM Prompt Entity Name

    url string

    Webhook: Callback URL

    characterMax string

    Fulltext: Maximum number of characters (-1 unlimited, Typesense defaults to 2048 characters)

    engine string

    DocumentTagging: Engine to use for document tagging generation

    Possible values: [chatgpt]

    notificationType string

    Notification Type

    Possible values: [email]

    notificationToCc string

    Who to carbon copy on the notification to (comma-delimited list)

    notificationToBcc string

    Who to blind carbon copy on the notification to (comma-delimited list)

    notificationSubject string

    Subject of the notification

    notificationText string

    Text of the notification

    notificationHtml string

    Html of the notification

    tags string

    DocumentTagging: Comma-deliminted list of keywords to generate tags for

    mappingId string

    Id of Mapping

    eventBusName string

    The name or ARN of the event bus to receive the event

    width string

    The width of the image to resize (or 'auto')

    height string

    The height of the image to resize (or 'auto')

    path string

    The path to use when creating resized document (optional)

    outputType string

    The output type of the image

    queueId string

    Id of Queue

  • ]

Responses

200 OK

Response Headers

  • Access-Control-Allow-Origin

    string

  • Access-Control-Allow-Methods

    string

  • Access-Control-Allow-Headers

    string

Schema

    message string

    Document Action message

Loading...