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

# Take next available work in a project

> Atomically claims the next unassigned unit of work (task or group) in the given project for the current user. Both pools (groups + ungrouped tasks where status_type='OPEN') are merged and ranked by priority ASC then created_on ASC. The org's teamMatchingMode (strict|soft) and the caller's team memberships shape which candidates are eligible; platform admins are subject to the same routing as org members. projectId is required — cross-project / cross-org take-next is not supported.



## OpenAPI

````yaml /api-reference/api-docs.yaml post /api/tasks/assign-next
openapi: 3.0.1
info:
  title: Kodexa AI
  description: >-
    The Kodexa platform API provides programmatic access to document processing,
    intelligent automation, and data extraction capabilities. Use this API to
    manage organizations, projects, document stores, taxonomies, assistants, and
    processing pipelines. All endpoints require authentication via API key,
    Bearer token, or Basic auth.
  version: 8.0.0
  license:
    name: Commercial
    url: https://kodexa.ai
servers:
  - url: https://platform.kodexa.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - x-api-key: []
  - bearerAuth: []
tags:
  - name: AI Gateway
  - name: AccessTokens
    description: Manage API access tokens for programmatic authentication.
  - name: Account
    description: Account management endpoints for the authenticated user.
  - name: Activities
  - name: ActivityDocumentFamilies
  - name: ActivityPlans
  - name: Agent Runtimes
    description: Manage agent runtime definitions backed by AWS Bedrock AgentCore.
  - name: Agent Sessions
    description: View and manage stateful conversation sessions within agent runtimes.
  - name: Agents
    description: Manage agents — instantiated agent runtimes within an org+project.
  - name: Analytics
  - name: Applied Knowledge
    description: Manage applied knowledge instances used during document processing.
  - name: Applied Knowledge Sets
    description: Manage applied knowledge set configurations.
  - name: Assistants
    description: Manage AI assistants that process and analyze documents within a project.
  - name: Batch Updates
    description: Batch document update operations for efficient bulk processing.
  - name: Channel
    description: Manage messaging channels for real-time communication within the platform.
  - name: Channel Types
  - name: Content Exception
    description: View and manage content exceptions that occur during document processing.
  - name: Content Object
    description: >-
      Manage content objects — individual files or processing results within a
      document family.
  - name: Credit Transactions
    description: View and manage credit transactions for organization billing.
  - name: Data Definitions
    description: >-
      Manage data definitions (taxonomies) that define document structure and
      extraction rules.
  - name: Data Forms
    description: Manage data form definitions for structured data capture from documents.
  - name: Data Stores
    description: Manage data stores for structured data storage.
  - name: Document Assignments
    description: Manage document assignments linking document families to users for review.
  - name: Document Family Statistics
    description: View statistics about document families including processing metrics.
  - name: Document Statuses
    description: >-
      Manage document status definitions for tracking document processing
      states.
  - name: Document Stores
    description: >-
      Manage document stores — containers for organizing and processing
      documents within a project.
  - name: Document Transitions
    description: Track state transitions of documents through processing stages.
  - name: DocumentFamilies
    description: >-
      Manage document families — groups of related content objects representing
      a single logical document.
  - name: Events
    description: >-
      Manage and publish platform events for real-time notifications and
      integrations.
  - name: Execution Slices
    description: View execution slice details within pipeline executions.
  - name: Executions
    description: View and manage processing execution records.
  - name: Intakes
    description: >-
      Manage intake configurations for ingesting documents from external
      sources.
  - name: Knowledge Clause Features
    description: Manage features within knowledge clauses.
  - name: Knowledge Clauses
    description: Manage knowledge clauses within knowledge items.
  - name: Knowledge Feature Types
    description: Manage knowledge feature type definitions.
  - name: Knowledge Features
    description: >-
      Manage knowledge features representing specific data points within
      knowledge items.
  - name: Knowledge Item Types
    description: Manage knowledge item type definitions.
  - name: Knowledge Items
    description: Manage individual knowledge items within knowledge sets.
  - name: Knowledge Set Snapshots
    description: Manage snapshots of knowledge sets for versioning and comparison.
  - name: Knowledge Set Sources
    description: Manage source references for knowledge sets.
  - name: Knowledge Sets
    description: >-
      Manage knowledge sets — collections of extracted knowledge used for
      AI-assisted processing.
  - name: Labels
    description: >-
      Manage labels used for categorizing and tagging resources within an
      organization.
  - name: Linked Deltas
    description: Manage linked deltas representing changes between document versions.
  - name: Messages
    description: Manage messages within channels.
  - name: Model Costs
  - name: Module Runtimes
    description: Manage module runtime definitions within the orchestrator.
  - name: Modules
  - name: Orchestrator Modules
    description: Manage processing modules for orchestrator pipelines.
  - name: Organizations
    description: >-
      Manage organizations — the top-level tenant in Kodexa. All projects,
      stores, and resources belong to an organization.
  - name: Permissions
  - name: Platform Configuration
    description: Manage platform-wide configuration settings.
  - name: Platform Overview
    description: Platform configuration and overview endpoints.
  - name: Product Groups
    description: Manage product groups that bundle related products together.
  - name: Product Overview
    description: Browse and manage products available on the Kodexa platform.
  - name: Product Subscriptions
    description: Manage product subscriptions linking organizations to products.
  - name: ProductProjectTemplates
    description: >-
      Manage product project templates that define default project
      configurations.
  - name: Project Resources
  - name: Project Status
    description: Manage project status definitions for tracking project lifecycle.
  - name: Project Templates
    description: Manage project templates that define reusable project configurations.
  - name: Projects
    description: >-
      Manage projects within an organization. Projects group related document
      stores, assistants, tasks, and processing pipelines.
  - name: Prompts
    description: Manage prompt templates used by AI assistants for document processing.
  - name: Purge Items
    description: Manage purge items for scheduled content cleanup.
  - name: Recent Executions
    description: View recent execution history for document processing.
  - name: Resource Resolution
  - name: Role Permissions
  - name: Roles
  - name: Service Bridges
  - name: Sessions
    description: Manage processing sessions for document operations.
  - name: Step Executions
    description: View step-level execution details within pipeline executions.
  - name: Tag Metadata
    description: Manage tag metadata definitions for document labeling and categorization.
  - name: Task Groups
  - name: Task Statuses
    description: Manage task status definitions for tracking task workflow states.
  - name: TaskActivity
    description: Track activity history on tasks, including status changes and comments.
  - name: TaskDocumentFamilies
    description: Manage the association between tasks and document families.
  - name: TaskGroupHistory
  - name: TaskTemplates
    description: Manage task templates that define reusable task configurations.
  - name: Tasks
    description: >-
      Manage tasks for document review workflows. Tasks have assignees,
      statuses, due dates, and can contain document families.
  - name: Team Members
    description: Manage team membership assignments.
  - name: Team Org Assignments
  - name: Team Project Assignments
  - name: Teams
    description: Manage teams for collaborative access control within projects.
  - name: Triggers
  - name: Users
    description: Manage platform user accounts.
  - name: Workspaces
    description: Manage workspaces for organizing project resources.
externalDocs:
  description: Kodexa Developer Documentation
  url: https://developer.kodexa.ai
paths:
  /api/tasks/assign-next:
    post:
      tags:
        - Tasks
      summary: Take next available work in a project
      description: >-
        Atomically claims the next unassigned unit of work (task or group) in
        the given project for the current user. Both pools (groups + ungrouped
        tasks where status_type='OPEN') are merged and ranked by priority ASC
        then created_on ASC. The org's teamMatchingMode (strict|soft) and the
        caller's team memberships shape which candidates are eligible; platform
        admins are subject to the same routing as org members. projectId is
        required — cross-project / cross-org take-next is not supported.
      operationId: assignNextTask
      parameters:
        - name: projectId
          in: query
          description: Project to scope the take-next pools to.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Polymorphic result envelope. `type` discriminates: GROUP (a group
            was claimed, `group` set), TASK (a task was claimed, `task` set),
            EMPTY (nothing assignable, `reason` and `message` set). EMPTY
            reasons: `no_work` (pool empty), `excluded_by_team_filter` (pool has
            candidates but the team filter discarded them all), `claim_race`
            (candidates existed but every one was claimed concurrently).
          content:
            application/json:
              schema:
                type: object
                properties:
                  group:
                    $ref: '#/components/schemas/TaskGroup'
                    description: Present when type=GROUP.
                  message:
                    type: string
                    description: >-
                      Human-readable string the UI may display directly. Present
                      when type=EMPTY.
                  reason:
                    type: string
                    description: Present when type=EMPTY.
                    enum:
                      - no_work
                      - excluded_by_team_filter
                      - claim_race
                  task:
                    $ref: '#/components/schemas/Task'
                    description: Present when type=TASK.
                  type:
                    type: string
                    description: Result discriminator.
                    enum:
                      - GROUP
                      - TASK
                      - EMPTY
                required:
                  - type
        '400':
          description: Bad Request — the request body or parameters are invalid.
        '401':
          description: Unauthorized — authentication is required.
        '403':
          description: Forbidden — the authenticated user does not have permission.
components:
  schemas:
    TaskGroup:
      type: object
      properties:
        assignee:
          allOf:
            - $ref: '#/components/schemas/PlatformUser'
          nullable: true
        assigneeId:
          type: string
          nullable: true
        assignmentType:
          type: string
          nullable: true
        changeSequence:
          type: integer
          format: int32
        completedTaskCount:
          type: integer
          format: int32
        createdOn:
          type: string
          format: date-time
        deleteUserEmail:
          type: string
        deleteUserId:
          type: string
        deleted:
          type: boolean
          nullable: true
        deletedDate:
          type: string
          format: date-time
          nullable: true
        description:
          type: string
        doneStatusSlug:
          type: string
          nullable: true
        effectiveCreatedOn:
          type: string
          format: date-time
          nullable: true
        history:
          type: array
          items:
            $ref: '#/components/schemas/TaskGroupHistory'
          nullable: true
        id:
          type: string
        locked:
          type: boolean
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
        name:
          type: string
        priority:
          type: integer
          format: int32
          nullable: true
        project:
          allOf:
            - $ref: '#/components/schemas/Project'
          nullable: true
        projectId:
          type: string
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/TaskStatus'
          nullable: true
        statusSlug:
          type: string
          nullable: true
        taskCount:
          type: integer
          format: int32
        team:
          allOf:
            - $ref: '#/components/schemas/Team'
          nullable: true
        teamId:
          type: string
          nullable: true
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - projectId
        - name
        - taskCount
        - completedTaskCount
    Task:
      type: object
      properties:
        assignee:
          allOf:
            - $ref: '#/components/schemas/PlatformUser'
          nullable: true
        assigneeId:
          type: string
          nullable: true
          description: ID of the user assigned to this task.
        changeSequence:
          type: integer
          format: int32
          description: Optimistic locking version number.
        completedDate:
          type: string
          format: date-time
          nullable: true
          description: Date when the task was completed.
        createdByActivityId:
          type: string
          nullable: true
        createdOn:
          type: string
          format: date-time
          description: Timestamp when the task was created.
        deleteUserEmail:
          type: string
          description: Email of the user who deleted the task.
        deleteUserId:
          type: string
          description: ID of the user who deleted the task.
        deleted:
          type: boolean
          description: Whether the task has been soft-deleted.
        deletedDate:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the task was soft-deleted.
        description:
          type: string
          description: Detailed description of the task.
          example: Review and validate all Q4 2025 invoices.
        dueDate:
          type: string
          format: date-time
          nullable: true
          description: Due date for the task.
        effectiveCreatedOn:
          type: string
          format: date-time
          nullable: true
          description: >-
            Document-arrival timestamp used for FIFO take-next ordering: the
            earliest created_on across the task's non-deleted document families,
            falling back to the task's own created_on when it has none.
            Maintained by the database; read-only.
        id:
          type: string
          description: Unique identifier (UUID) for the task.
          example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
        locked:
          type: boolean
          description: Whether the task is locked for editing.
        lockedAt:
          type: string
          format: date-time
          nullable: true
        lockedById:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/TaskMetadata'
          description: Task metadata including custom fields.
        parentTask:
          allOf:
            - $ref: '#/components/schemas/Task'
          nullable: true
        parentTaskId:
          type: string
          nullable: true
          description: ID of the parent task (for sub-tasks).
        plan:
          allOf:
            - $ref: '#/components/schemas/Activity'
          nullable: true
        priority:
          type: integer
          format: int32
          nullable: true
          description: Priority level of the task (lower number = higher priority).
          example: 1
        project:
          allOf:
            - $ref: '#/components/schemas/Project'
          nullable: true
        projectId:
          type: string
          nullable: true
          description: ID of the project this task belongs to.
        properties:
          type: object
          additionalProperties: {}
          nullable: true
          description: Task properties for UI state and configuration.
        searchText:
          type: string
          description: Full-text searchable representation of the task.
        signal:
          $ref: '#/components/schemas/TaskSignal'
          description: Signal from human reviewer for plan-aware task completion.
        statusSlug:
          type: string
          nullable: true
        taskActivities:
          type: array
          items:
            $ref: '#/components/schemas/TaskActivity'
          nullable: true
        taskGroup:
          allOf:
            - $ref: '#/components/schemas/TaskGroup'
          nullable: true
        taskGroupId:
          type: string
          nullable: true
        team:
          allOf:
            - $ref: '#/components/schemas/Team'
          nullable: true
        teamId:
          type: string
          nullable: true
        template:
          allOf:
            - $ref: '#/components/schemas/TaskTemplate'
          nullable: true
        templateId:
          type: string
          nullable: true
          description: ID of the task template used.
        title:
          type: string
          description: Title of the task.
          example: Review Q4 invoices
        updatedOn:
          type: string
          format: date-time
          description: Timestamp when the task was last updated.
        uuid:
          type: string
          description: Secondary UUID identifier.
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - projectId
        - project
        - title
        - description
        - metadata
        - properties
        - templateId
        - template
        - dueDate
        - completedDate
        - assigneeId
        - assignee
        - teamId
        - team
        - parentTaskId
        - parentTask
        - taskActivities
        - plan
        - searchText
        - priority
        - locked
        - signal
        - deleted
        - deletedDate
        - deleteUserEmail
        - deleteUserId
      description: >-
        A task represents a unit of work in a document review workflow, with an
        assignee, status, and due date.
    PlatformUser:
      type: object
      properties:
        active:
          type: boolean
        bio:
          type: string
        businessGroup:
          type: string
        changeSequence:
          type: integer
          format: int32
          description: Optimistic locking version number.
        createdOn:
          type: string
          format: date-time
          description: Timestamp when the user was created.
        email:
          type: string
        firstName:
          type: string
        groupsJson:
          type: string
        id:
          type: string
          description: Unique identifier (UUID) for the user.
        image:
          type: string
        invited:
          type: boolean
        isExternallyManaged:
          type: boolean
        lastName:
          type: string
        preferences:
          $ref: '#/components/schemas/UserPreferences'
        rolesJson:
          type: string
        searchText:
          type: string
        security:
          $ref: '#/components/schemas/UserRoles'
        showDeveloperTools:
          type: boolean
        title:
          type: string
        updatedOn:
          type: string
          format: date-time
          description: Timestamp when the user was last updated.
        userHash:
          type: string
        userStorage:
          $ref: '#/components/schemas/UserStorage'
        userType:
          type: string
        uuid:
          type: string
          description: Secondary UUID identifier.
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - email
        - searchText
        - firstName
        - lastName
        - bio
        - userStorage
        - showDeveloperTools
        - image
        - userHash
        - isExternallyManaged
        - security
        - userType
        - active
        - title
        - businessGroup
        - preferences
        - rolesJson
        - groupsJson
        - invited
      description: A platform user represents a user account in the Kodexa platform.
    TaskGroupHistory:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        content:
          type: string
        createdOn:
          type: string
          format: date-time
        detail:
          nullable: true
        id:
          type: string
        taskGroup:
          allOf:
            - $ref: '#/components/schemas/TaskGroup'
          nullable: true
        taskGroupId:
          type: string
          nullable: true
        updatedOn:
          type: string
          format: date-time
        user:
          nullable: true
        userId:
          type: string
          nullable: true
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - taskGroupId
    Project:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
          description: Optimistic locking version number.
        color:
          type: string
          description: Display color for the project (max 25 characters).
          example: '#4A90D9'
        createdOn:
          type: string
          format: date-time
          description: Timestamp when the project was created.
        dataFlow:
          $ref: '#/components/schemas/ProjectDataFlow'
          description: Project data flow configuration.
        description:
          type: string
          description: Human-readable description of the project.
          example: Automated invoice processing pipeline.
        documentStatuses:
          type: array
          items:
            $ref: '#/components/schemas/DocumentStatus'
          nullable: true
        id:
          type: string
          description: Unique identifier (UUID) for the project.
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        memory:
          $ref: '#/components/schemas/ProjectMemory'
          description: Project-level memory and configuration.
        name:
          type: string
          description: Display name of the project.
          example: Invoice Processing
        notes:
          type: string
          description: Free-form notes about the project.
        options:
          $ref: '#/components/schemas/ProjectOptions'
          description: Project options and settings.
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          nullable: true
        organizationId:
          type: string
          nullable: true
          description: ID of the organization this project belongs to.
        owner:
          allOf:
            - $ref: '#/components/schemas/PlatformUser'
          nullable: true
        ownerId:
          type: string
          nullable: true
          description: ID of the user who owns this project.
        projectTemplateRef:
          type: string
          description: Reference to the project template used to create this project.
        searchText:
          type: string
        slug:
          type: string
          description: >-
            URL-friendly identifier. Automatically lowercased. Pattern:
            ^[a-z0-9-]+$
          example: invoice-processing
        status:
          allOf:
            - $ref: '#/components/schemas/ProjectStatus'
          nullable: true
        statusId:
          type: string
          nullable: true
          description: ID of the current project status.
        statusType:
          type: string
          description: 'Project lifecycle state: ACTIVE, ARCHIVED, or PENDING_DELETE.'
          example: ACTIVE
        templateArticleId:
          type: string
        updatedOn:
          type: string
          format: date-time
          description: Timestamp when the project was last updated.
        uuid:
          type: string
          description: Secondary UUID identifier.
          example: 7c9e667974254de944be07fc1f90ae7
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - organization
        - name
        - description
        - slug
        - ownerId
        - owner
        - statusId
        - status
        - templateArticleId
        - projectTemplateRef
        - searchText
        - notes
        - color
        - memory
        - dataFlow
        - options
        - statusType
        - documentStatuses
      description: >-
        A project groups related document stores, assistants, tasks, and
        processing pipelines within an organization.
    TaskStatus:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        color:
          type: string
        createdOn:
          type: string
          format: date-time
        deleteUserEmail:
          type: string
          nullable: true
        deleteUserId:
          type: string
          nullable: true
        deleted:
          type: boolean
        deletedDate:
          type: string
          format: date-time
          nullable: true
        deprecated:
          type: boolean
        extensionPackRef:
          type: string
        icon:
          type: string
        id:
          type: string
        label:
          type: string
        lockDocumentFamily:
          type: boolean
          nullable: true
        locked:
          type: boolean
          nullable: true
        metadata:
          nullable: true
        name:
          type: string
        orgSlug:
          type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/OrgRef'
          nullable: true
        organizationId:
          type: string
        project:
          allOf:
            - $ref: '#/components/schemas/Project'
          nullable: true
        projectId:
          type: string
          nullable: true
        publicAccess:
          type: boolean
        ref:
          type: string
        sequence:
          type: integer
          format: int32
        slug:
          type: string
        statusType:
          $ref: '#/components/schemas/TaskStatusType'
        template:
          type: boolean
        type:
          type: string
        updatedOn:
          type: string
          format: date-time
        uri:
          type: string
          description: >-
            Computed resource URI (scheme://orgSlug/slug), present on serialized
            responses.
        uuid:
          type: string
        yamlSource:
          type: string
          nullable: true
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - slug
        - name
        - publicAccess
        - template
        - deprecated
        - deleted
      description: A task status defines a named state for tracking task workflow progress.
    Team:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        createdOn:
          type: string
          format: date-time
        description:
          type: string
        id:
          type: string
        name:
          type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          nullable: true
        organizationId:
          type: string
          nullable: true
        searchText:
          type: string
        slug:
          type: string
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - name
        - description
        - slug
        - organizationId
        - organization
        - searchText
      description: >-
        A team groups users together for collaborative access control within
        projects.
    TaskMetadata:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/TaskTemplateAction'
          nullable: true
        dataProperties:
          type: object
          additionalProperties: {}
          nullable: true
    Activity:
      type: object
      properties:
        activityPlanId:
          type: string
          nullable: true
        activityPlanSlug:
          type: string
          nullable: true
        badges:
          nullable: true
        candidateKnowledgeSets:
          type: array
          items:
            $ref: '#/components/schemas/ActivityCandidateKnowledgeSetSummary'
          nullable: true
        changeSequence:
          type: integer
          format: int32
        completedOn:
          type: string
          format: date-time
          nullable: true
        completedWorkUnits:
          type: integer
          format: int32
          nullable: true
        createdOn:
          type: string
          format: date-time
        currentSequence:
          type: integer
          format: int32
          nullable: true
        deleteUserEmail:
          type: string
        deleteUserId:
          type: string
        deleted:
          type: boolean
        deletedDate:
          type: string
          format: date-time
          nullable: true
        description:
          type: string
          nullable: true
        documentFamilies:
          type: array
          items:
            $ref: '#/components/schemas/ActivityDocumentFamilySummary'
          nullable: true
        errorDetails:
          type: string
          nullable: true
        failedWorkUnits:
          type: integer
          format: int32
          nullable: true
        id:
          type: string
        inputs:
          nullable: true
        knowledgeAgent:
          type: boolean
          nullable: true
        knowledgeFeatures:
          type: array
          items:
            $ref: '#/components/schemas/ActivityKnowledgeFeatureSummary'
          nullable: true
        lifecycleState:
          type: string
        metadata:
          nullable: true
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          nullable: true
        organizationId:
          type: string
          nullable: true
        parentActivityId:
          type: string
          nullable: true
        priority:
          type: integer
          format: int32
        projectId:
          type: string
          nullable: true
        replacedByActivityId:
          type: string
          nullable: true
        runningWorkUnits:
          type: integer
          format: int32
          nullable: true
        startedByIntakeId:
          type: string
          nullable: true
        startedByTriggerId:
          type: string
          nullable: true
        startedOn:
          type: string
          format: date-time
          nullable: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/Step'
          nullable: true
        title:
          type: string
          nullable: true
        totalWorkUnits:
          type: integer
          format: int32
          nullable: true
        triggerKind:
          type: string
        triggerMetadata:
          nullable: true
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
        version:
          type: integer
          format: int32
          nullable: true
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - organization
        - projectId
        - activityPlanId
        - title
        - triggerKind
        - priority
        - lifecycleState
        - currentSequence
        - metadata
        - startedOn
        - completedOn
        - version
        - deleted
        - deletedDate
        - deleteUserEmail
        - deleteUserId
    TaskSignal:
      type: object
      properties:
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
        notes:
          type: string
        outcome:
          $ref: '#/components/schemas/TaskSignalOutcome'
        requestedItems:
          type: array
          items:
            type: object
            additionalProperties: {}
          nullable: true
    TaskActivity:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        content:
          type: string
        createdOn:
          type: string
          format: date-time
        detail:
          $ref: '#/components/schemas/TaskActivityDetail'
        id:
          type: string
        searchText:
          type: string
        task:
          allOf:
            - $ref: '#/components/schemas/Task'
          nullable: true
        taskId:
          type: string
          nullable: true
        updatedOn:
          type: string
          format: date-time
        user:
          nullable: true
        userId:
          type: string
          nullable: true
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - taskId
        - task
        - content
        - detail
        - userId
        - user
        - searchText
      description: >-
        A task activity records an event in the task's history, such as status
        changes or comments.
    TaskTemplate:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        createdOn:
          type: string
          format: date-time
        deleteUserEmail:
          type: string
          nullable: true
        deleteUserId:
          type: string
          nullable: true
        deleted:
          type: boolean
        deletedDate:
          type: string
          format: date-time
          nullable: true
        deprecated:
          type: boolean
        description:
          type: string
        extensionPackRef:
          type: string
        id:
          type: string
        initialStatusSlug:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/TaskTemplateMetadata'
        name:
          type: string
        orgSlug:
          type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/OrgRef'
          nullable: true
        organizationId:
          type: string
        project:
          allOf:
            - $ref: '#/components/schemas/Project'
          nullable: true
        projectId:
          type: string
          nullable: true
        publicAccess:
          type: boolean
        ref:
          type: string
        slug:
          type: string
        template:
          type: boolean
        title:
          type: string
        type:
          type: string
        updatedOn:
          type: string
          format: date-time
        uri:
          type: string
          description: >-
            Computed resource URI (scheme://orgSlug/slug), present on serialized
            responses.
        uuid:
          type: string
        yamlSource:
          type: string
          nullable: true
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - slug
        - name
        - publicAccess
        - template
        - deprecated
        - deleted
        - description
        - metadata
      description: >-
        A task template defines a reusable task configuration with default
        values.
    UserPreferences:
      type: object
      properties:
        showOnboarding:
          type: boolean
          nullable: true
        showScrollbars:
          type: boolean
          nullable: true
        showWelcomeMessage:
          type: boolean
          nullable: true
    UserRoles:
      type: object
      properties:
        roles:
          type: array
          items:
            type: string
          nullable: true
    UserStorage:
      type: object
      properties:
        favoriteLinks:
          type: array
          items:
            $ref: '#/components/schemas/FavoriteLink'
          nullable: true
    ProjectDataFlow:
      type: object
      properties:
        edges:
          type: array
          items:
            $ref: '#/components/schemas/DataFlowEdge'
          nullable: true
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/DataFlowNode'
          nullable: true
        viewPort:
          allOf:
            - $ref: '#/components/schemas/FlowViewPort'
          nullable: true
    DocumentStatus:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        color:
          type: string
        createdOn:
          type: string
          format: date-time
        icon:
          type: string
        id:
          type: string
        project:
          allOf:
            - $ref: '#/components/schemas/Project'
          nullable: true
        projectId:
          type: string
          nullable: true
        slug:
          type: string
        status:
          type: string
        statusType:
          $ref: '#/components/schemas/StatusType'
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - projectId
        - color
        - icon
        - status
        - slug
        - statusType
      description: >-
        A document status defines a named state for tracking document processing
        progress.
    ProjectMemory:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
          nullable: true
        orderedDashboards:
          type: array
          items:
            type: string
          nullable: true
        recentFilters:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
        recentQueries:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
    ProjectOptions:
      type: object
      properties:
        companion:
          allOf:
            - $ref: '#/components/schemas/CompanionConfig'
          nullable: true
        dataOptions:
          type: array
          items:
            $ref: '#/components/schemas/Option'
          nullable: true
        dataProperties:
          type: object
          additionalProperties: {}
          nullable: true
        executionPolicy:
          allOf:
            - $ref: '#/components/schemas/ExecutionPolicy'
          nullable: true
        groupTaxonTypeFeatures:
          type: object
          additionalProperties: {}
          nullable: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/Option'
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        taskOptions:
          allOf:
            - $ref: '#/components/schemas/ProjectTaskOptions'
          nullable: true
        taxonTypeFeatures:
          type: object
          additionalProperties: {}
          nullable: true
    Organization:
      type: object
      properties:
        archived:
          type: boolean
          nullable: true
        authGroupLink:
          $ref: '#/components/schemas/AuthGroupLink'
        changeSequence:
          type: integer
          format: int32
          description: Optimistic locking version number, incremented on each update.
        createdOn:
          type: string
          format: date-time
          description: Timestamp when the organization was created.
        defaultToPrivateTemplates:
          type: boolean
          description: Whether new templates default to private access.
        description:
          type: string
          description: Human-readable description of the organization.
          example: Document processing organization for Acme Corp.
        enterpriseOrganization:
          type: boolean
          nullable: true
          description: Whether this is an enterprise-tier organization.
        features:
          type: object
          additionalProperties: {}
          nullable: true
          description: Feature flags enabled for the organization.
        hasImage:
          type: boolean
          description: Whether the organization has a profile image.
        id:
          type: string
          description: Unique identifier (UUID) for the organization.
          example: 550e8400-e29b-41d4-a716-446655440000
        memory:
          $ref: '#/components/schemas/OrganizationMemory'
          description: Organization-level memory and configuration.
        name:
          type: string
          description: Display name of the organization.
          example: Acme Corp
        organizationStatus:
          type: string
          description: Current status of the organization (e.g., ACTIVE, SUSPENDED).
          example: ACTIVE
        properties:
          type: object
          additionalProperties: {}
          nullable: true
          description: Arbitrary key-value properties for the organization.
        publicAccess:
          type: boolean
          description: Whether the organization is publicly visible.
        searchText:
          type: string
          description: Full-text searchable representation of the organization.
        slug:
          type: string
          description: >-
            URL-friendly identifier, 3-100 characters. Automatically lowercased.
            Pattern: ^[a-z0-9-]+$
          example: acme-corp
        stripeCustomerId:
          type: string
        supportAccess:
          type: boolean
          description: Whether Kodexa support has been granted access.
        supportAccessExpiresAt:
          type: string
          format: date-time
          nullable: true
          description: When support access expires.
        updatedOn:
          type: string
          format: date-time
          description: Timestamp when the organization was last updated.
        uuid:
          type: string
          description: Secondary UUID identifier.
          example: 550e8400e29b41d4a716446655440000
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - name
        - searchText
        - slug
        - publicAccess
        - description
        - organizationStatus
        - authGroupLink
        - hasImage
        - defaultToPrivateTemplates
        - memory
        - supportAccess
        - supportAccessExpiresAt
        - stripeCustomerId
        - enterpriseOrganization
        - properties
        - features
      description: >-
        An organization is the top-level tenant in Kodexa. All projects, stores,
        and resources belong to an organization.
    ProjectStatus:
      type: object
      properties:
        changeSequence:
          type: integer
          format: int32
        color:
          type: string
        createdOn:
          type: string
          format: date-time
        icon:
          type: string
        id:
          type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          nullable: true
        organizationId:
          type: string
          nullable: true
        production:
          type: boolean
        status:
          type: string
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - organization
        - color
        - icon
        - status
        - production
      description: A project status defines a named state for tracking project lifecycle.
    OrgRef:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    TaskStatusType:
      type: string
      enum:
        - OPEN
        - IN_PROGRESS
        - DONE
        - BLOCKED
        - PENDING
    TaskTemplateAction:
      type: object
      properties:
        label:
          type: string
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        slug:
          type: string
          description: >-
            The action's identity: the dependsOn qualifier other plan steps
            reference and the correlation token recorded on task completion.
        type:
          type: string
        uuid:
          type: string
          description: >-
            DEPRECATED — legacy spelling of slug. Readers alias it; writers must
            set slug. Will be removed once stored metadata has converged (watch
            the materializer's legacy-uuid warnings).
          deprecated: true
    ActivityCandidateKnowledgeSetSummary:
      type: object
      properties:
        currentSnapshotId:
          type: string
          nullable: true
        id:
          type: string
        name:
          type: string
        openQuestions:
          nullable: true
        projectId:
          type: string
          nullable: true
        slug:
          type: string
        status:
          type: string
        updatedOn:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - slug
        - name
        - status
    ActivityDocumentFamilySummary:
      type: object
      properties:
        id:
          type: string
        path:
          type: string
          nullable: true
      required:
        - id
    ActivityKnowledgeFeatureSummary:
      type: object
      properties:
        featureTypeColor:
          type: string
          nullable: true
        featureTypeIcon:
          type: string
          nullable: true
        featureTypeId:
          type: string
          nullable: true
        featureTypeName:
          type: string
          nullable: true
        featureTypeSlug:
          type: string
          nullable: true
        id:
          type: string
        slug:
          type: string
      required:
        - id
        - slug
    Step:
      type: object
      properties:
        activityId:
          type: string
          nullable: true
        agentId:
          type: string
          nullable: true
        agentRuntimeId:
          type: string
          nullable: true
        agentSessionId:
          type: string
          nullable: true
        approvalCriteria:
          nullable: true
        approvalOutcome:
          type: string
          nullable: true
        approverRole:
          type: string
          nullable: true
        bridgeActions:
          nullable: true
        bridgeResult:
          nullable: true
        bypass:
          type: boolean
        changeSequence:
          type: integer
          format: int32
        childTaskId:
          type: string
          nullable: true
        completedActionUuid:
          type: string
          nullable: true
        completedDocFamilyIds:
          nullable: true
        completedOn:
          type: string
          format: date-time
          nullable: true
        conditionExpression:
          nullable: true
        createdOn:
          type: string
          format: date-time
        currentDocFamilyId:
          type: string
          nullable: true
        dependsOn:
          type: array
          items:
            $ref: '#/components/schemas/StepRef'
          nullable: true
        description:
          type: string
          nullable: true
        disableCache:
          type: boolean
          nullable: true
        endpointName:
          type: string
          nullable: true
        enrichment:
          nullable: true
        errorDetails:
          nullable: true
        executionId:
          type: string
          nullable: true
        id:
          type: string
        includeDocument:
          nullable: true
        insertedAt:
          type: string
          format: date-time
          nullable: true
        insertedById:
          type: string
          nullable: true
        joinPolicy:
          type: string
          nullable: true
        llmModelName:
          type: string
          nullable: true
        logGroup:
          type: string
          nullable: true
        logStream:
          type: string
          nullable: true
        mappedOutput:
          nullable: true
        maxParallel:
          type: integer
          format: int32
          nullable: true
        maxStepsToInsert:
          type: integer
          format: int32
          nullable: true
        metadata:
          nullable: true
        moduleRef:
          type: string
          nullable: true
        moduleRefs:
          nullable: true
        name:
          type: string
          nullable: true
        options:
          nullable: true
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          nullable: true
        organizationId:
          type: string
          nullable: true
        outputMapping:
          nullable: true
        perDocument:
          type: boolean
          nullable: true
        plannerContext:
          nullable: true
        prompt:
          type: string
          nullable: true
        promptActions:
          nullable: true
        promptBody:
          type: string
          nullable: true
        promptRendered:
          type: string
          nullable: true
        promptResult:
          nullable: true
        promptTemplateRef:
          type: string
          nullable: true
        promptVariables:
          nullable: true
        requestBody:
          nullable: true
        requestHeaders:
          nullable: true
        requestPath:
          nullable: true
        requestQuery:
          nullable: true
        requestScript:
          type: string
          nullable: true
        result:
          nullable: true
        scriptActions:
          nullable: true
        scriptBody:
          type: string
          nullable: true
        scriptResult:
          nullable: true
        scriptSidecars:
          nullable: true
        sequence:
          type: integer
          format: int32
          nullable: true
        serviceBridgeRef:
          type: string
          nullable: true
        setDocumentStatus:
          type: string
          nullable: true
        skipReason:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        startedOn:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
        taskData:
          nullable: true
        taskStatusSlug:
          type: string
          nullable: true
        taskTemplateRef:
          type: string
          nullable: true
        timeoutSeconds:
          type: integer
          format: int32
          nullable: true
        treatAsError:
          type: string
          nullable: true
        type:
          type: string
        updatedOn:
          type: string
          format: date-time
        uuid:
          type: string
        waitForCompletion:
          type: boolean
          nullable: true
      required:
        - id
        - uuid
        - createdOn
        - updatedOn
        - changeSequence
        - organizationId
        - organization
        - activityId
        - sequence
        - name
        - status
        - type
        - startedOn
        - completedOn
        - errorDetails
        - conditionExpression
        - insertedById
        - insertedAt
    TaskSignalOutcome:
      type: string
      enum:
        - APPROVED
        - REJECTED
        - NEEDS_REWORK
        - ESCALATED
    TaskActivityDetail:
      type: object
      properties:
        interpolatedValues:
          type: object
          additionalProperties: {}
          nullable: true
        type:
          $ref: '#/components/schemas/TaskActivityType'
    TaskTemplateMetadata:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/TaskTemplateAction'
          nullable: true
        agentShortcuts:
          type: array
          items:
            $ref: '#/components/schemas/AgentShortcut'
          nullable: true
        aiNaming:
          allOf:
            - $ref: '#/components/schemas/AINamingConfig'
          nullable: true
        chatPrompt:
          allOf:
            - $ref: '#/components/schemas/ChatPromptConfig'
          nullable: true
        companion:
          allOf:
            - $ref: '#/components/schemas/TaskCompanionConfig'
          nullable: true
        documentFamilyGroups:
          type: array
          items:
            $ref: '#/components/schemas/DocumentFamilyGroup'
          nullable: true
        executionPolicy:
          allOf:
            - $ref: '#/components/schemas/ExecutionPolicy'
          nullable: true
        forms:
          type: array
          items:
            $ref: '#/components/schemas/TemplateDataForm'
          nullable: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/TaskTemplateOption'
          nullable: true
        priority:
          type: integer
          format: int32
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        teamSlug:
          type: string
        workspaceId:
          type: string
    FavoriteLink:
      type: object
      properties:
        link:
          type: string
    DataFlowEdge:
      type: object
      properties:
        id:
          type: string
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        source:
          type: string
        target:
          type: string
    DataFlowNode:
      type: object
      properties:
        dimensions:
          allOf:
            - $ref: '#/components/schemas/NodeDimensions'
          nullable: true
        id:
          type: string
        parentId:
          type: string
        position:
          allOf:
            - $ref: '#/components/schemas/NodePosition'
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        type:
          type: string
    FlowViewPort:
      type: object
      properties:
        x:
          type: number
          format: double
        'y':
          type: number
          format: double
        zoom:
          type: number
          format: double
      required:
        - x
        - 'y'
        - zoom
    StatusType:
      type: string
      enum:
        - UNRESOLVED
        - RESOLVED
    CompanionConfig:
      type: object
      properties:
        agentRuntimeRef:
          type: string
          nullable: true
        moduleRefs:
          type: array
          items:
            type: string
          nullable: true
        prompt:
          type: string
          nullable: true
    Option:
      type: object
      properties:
        aliases:
          type: array
          items:
            type: string
          nullable: true
        default: {}
        description:
          type: string
        developerOnly:
          type: boolean
          nullable: true
        displayProperties:
          type: object
          additionalProperties: {}
          nullable: true
        falseLabel:
          type: string
        featureFlag:
          type: string
        groupOptions:
          type: array
          items:
            $ref: '#/components/schemas/Option'
          nullable: true
        hint:
          type: string
        label:
          type: string
        listDescription:
          type: string
        listLabel:
          type: string
        listType:
          type: string
        name:
          type: string
        overviewMarkdown:
          type: string
        possibleValues:
          type: array
          items:
            $ref: '#/components/schemas/PossibleValue'
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        required:
          type: boolean
          nullable: true
        showIf:
          type: string
        showOnPopup:
          type: boolean
          nullable: true
        subType:
          type: string
        supportArticle:
          type: string
        tabName:
          type: string
        type:
          type: string
    ExecutionPolicy:
      type: object
      properties:
        backoffBaseSeconds:
          type: integer
          format: int32
          nullable: true
        backoffStrategy:
          type: string
          nullable: true
        maxAttempts:
          type: integer
          format: int32
          nullable: true
        onExhausted:
          type: string
          nullable: true
        timeoutSeconds:
          type: integer
          format: int32
          nullable: true
    ProjectTaskOptions:
      type: object
      properties:
        showNewTask:
          type: boolean
      required:
        - showNewTask
    AuthGroupLink:
      type: object
      properties:
        authGroup:
          type: string
    OrganizationMemory:
      type: object
      properties:
        orderedDashboards:
          type: array
          items:
            type: string
          nullable: true
    StepRef:
      type: object
      properties:
        actionUuid:
          type: string
          nullable: true
        awaitOnly:
          type: boolean
        id:
          type: string
      required:
        - id
    TaskActivityType:
      type: string
      enum:
        - TASK_CREATED
        - TITLE_CHANGED
        - DESCRIPTION_UPDATED
        - STATUS_CHANGED
        - ASSIGNEE_CHANGED
        - DUE_DATE_CHANGED
        - PROJECT_CHANGED
        - COMMENT
        - TASK_LOCKED
        - TASK_UNLOCKED
        - TASK_SAVED
    AgentShortcut:
      type: object
      properties:
        icon:
          type: string
        id:
          type: string
        label:
          type: string
        prompt:
          type: string
      required:
        - id
        - label
        - prompt
    AINamingConfig:
      type: object
      properties:
        enabled:
          type: boolean
        prompt:
          type: string
      required:
        - enabled
    ChatPromptConfig:
      type: object
      properties:
        enabled:
          type: boolean
        prompt:
          type: string
      required:
        - enabled
    TaskCompanionConfig:
      type: object
      properties:
        agentRuntimeRef:
          type: string
          nullable: true
        moduleRefs:
          type: array
          items:
            type: string
          nullable: true
        prompt:
          type: string
          nullable: true
    DocumentFamilyGroup:
      type: object
      properties:
        automaticallyAdd:
          type: boolean
          nullable: true
        documentFamilyFilter:
          type: string
        editable:
          type: boolean
          nullable: true
        hardMaxPages:
          type: integer
          format: int32
          nullable: true
        knowledgeFeatures:
          type: array
          items:
            $ref: '#/components/schemas/DocumentFamilyGroupFeature'
          nullable: true
        maxHits:
          type: integer
          format: int32
          nullable: true
        maxPages:
          type: integer
          format: int32
          nullable: true
        maxSize:
          type: integer
          format: int32
          nullable: true
        name:
          type: string
        notes:
          type: string
        required:
          type: boolean
          nullable: true
        sort:
          type: string
        titlePrompt:
          type: string
        uniqueFilenames:
          type: boolean
          nullable: true
        uploadOnly:
          type: boolean
          nullable: true
    TemplateDataForm:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/TaskTemplateAction'
          nullable: true
        availablePanels:
          type: object
          additionalProperties:
            type: boolean
          nullable: true
        dataFormRef:
          type: string
        properties:
          type: object
          additionalProperties: {}
          nullable: true
    TaskTemplateOption:
      type: object
      properties:
        aliases:
          type: array
          items:
            type: string
          nullable: true
        default: {}
        description:
          type: string
        developerOnly:
          type: boolean
          nullable: true
        displayProperties:
          type: object
          additionalProperties: {}
          nullable: true
        falseLabel:
          type: string
        featureFlag:
          type: string
        groupOptions:
          type: array
          items:
            $ref: '#/components/schemas/TaskTemplateOption'
          nullable: true
        hint:
          type: string
        label:
          type: string
        listDescription:
          type: string
        listLabel:
          type: string
        listType:
          type: string
        name:
          type: string
        overviewMarkdown:
          type: string
        possibleValues:
          type: array
          items:
            $ref: '#/components/schemas/TaskPossibleValue'
          nullable: true
        properties:
          type: object
          additionalProperties: {}
          nullable: true
        required:
          type: boolean
          nullable: true
        showIf:
          type: string
        showOnPopup:
          type: boolean
          nullable: true
        subType:
          type: string
        supportArticle:
          type: string
        tabName:
          type: string
        type:
          type: string
    NodeDimensions:
      type: object
      properties:
        height:
          type: number
          format: double
        width:
          type: number
          format: double
      required:
        - width
        - height
    NodePosition:
      type: object
      properties:
        x:
          type: number
          format: double
        'y':
          type: number
          format: double
      required:
        - x
        - 'y'
    PossibleValue:
      type: object
      properties:
        description:
          type: string
        label:
          type: string
        value: {}
    DocumentFamilyGroupFeature:
      type: object
      properties:
        featureTypeRef:
          type: string
        required:
          type: boolean
          nullable: true
      required:
        - featureTypeRef
    TaskPossibleValue:
      type: object
      properties:
        description:
          type: string
        label:
          type: string
        value: {}
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Create one from the Kodexa platform UI under
        Settings > Access Tokens.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token obtained from the authentication provider.

````