curl --request POST \
  --url https://api-prod.extend.app/v1/processors/:id/publish \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "releaseType": "<string>",
  "description": "<string>",
  "config": {
    "type": "<string>",
    "baseProcessor": "<string>",
    "baseVersion": "<string>",
    "fields": [
      {
        "id": "<string>",
        "name": "<string>",
        "type": "<string>",
        "description": "<string>",
        "schema": [
          {}
        ],
        "enum": [
          {
            "value": "<string>",
            "description": "<string>"
          }
        ]
      }
    ],
    "extractionRules": "<string>",
    "advancedOptions": {
      "fixedPageLimit": 123,
      "documentKind": "<string>",
      "keyDefinitions": "<string>",
      "modelReasoningInsightsEnabled": true,
      "advancedMultimodalEnabled": true,
      "citationsEnabled": true,
      "advancedFigureParsingEnabled": true,
      "chunkingOptions": {
        "chunkingStrategy": "<string>",
        "customSemanticChunkingRules": "<string>",
        "pageChunkSize": 123,
        "chunkSelectionStrategy": "<string>"
      }
    }
  }
}'
{
  "success": true,
  "processorVersion": {
    "object": "document_processor_version",
    "id": "processor_version_5678",
    "processorId": "processor_1234",
    "processorType": "EXTRACT",
    "description": "Updated extraction rules for invoice processing",
    "version": "1.2.0",
    "config": {
      "fields": [
        {
          "id": "invoice_number",
          "name": "invoice_number",
          "description": "The invoice number",
          "type": "string",
        },
        {
          "id": "invoice_date",
          "name": "invoice_date",
          "description": "The date of the invoice",
          "type": "date",
        }
      ]
    },
    "createdAt": "2024-03-01T14:00:00Z",
    "updatedAt": "2024-03-01T14:00:00Z"
  }
}

This endpoint allows you to publish a new version of an existing processor. Publishing a new version creates a snapshot of the processor’s current configuration and makes it available for use in workflows. Publishing a new version does not automatically update existing workflows using this processor. You may need to manually update workflows to use the new version if desired.

Path Parameters

id
string
required

The ID of the processor to publish a new version for.

Body

releaseType
string
required

The type of release for this version. The two options are: “major” and “minor”, which will increment the version number accordingly.

description
string

A description of the changes in this version. This helps track the evolution of the processor over time.

config
object

Optionally supply a config to be used in this published version. If not supplied, the config for your existing draft version will be used.

Your config will take one of three shapes depending on the processor type:

Configuration for an extraction processor.

Configuration for a classification processor.

Configuration for a splitter processor.

Response

success
boolean

A true or false value indicating whether the processor version was published successfully or not.

processorVersion
ProcessorVersion

A ProcessorVersion object representing the newly published version of the processor. See the ProcessorVersion object for more details.

Error Responses

success
boolean

Will be false if the request failed.

error
string

A description of the error that occurred.

Common Errors

  • 400 Bad Request: If the request body fails schema validation or if there’s an issue with the provided configuration, particularly when it comes to the config which depends on the processor type.
{
  "success": true,
  "processorVersion": {
    "object": "document_processor_version",
    "id": "processor_version_5678",
    "processorId": "processor_1234",
    "processorType": "EXTRACT",
    "description": "Updated extraction rules for invoice processing",
    "version": "1.2.0",
    "config": {
      "fields": [
        {
          "id": "invoice_number",
          "name": "invoice_number",
          "description": "The invoice number",
          "type": "string",
        },
        {
          "id": "invoice_date",
          "name": "invoice_date",
          "description": "The date of the invoice",
          "type": "date",
        }
      ]
    },
    "createdAt": "2024-03-01T14:00:00Z",
    "updatedAt": "2024-03-01T14:00:00Z"
  }
}