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

# Get Collections

> Get a list of all collections of your app.



## OpenAPI

````yaml get /apps/{app_id}/collections
openapi: 3.0.0
info:
  version: 1.0.0
  title: API
servers: []
security: []
paths:
  /apps/{app_id}/collections:
    get:
      summary: Get Collections
      description: Get a list of all collections of your app.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the app
          name: app_id
          in: path
        - schema:
            type: string
            description: What you want to search for in collections
          required: false
          name: search
          in: query
        - schema:
            type: array
            items:
              type: string
            description: Tags to filter collections by (you can use up to 20)
            example:
              - tag_xxx
              - tag_yyy
          required: false
          name: tags
          in: query
        - schema:
            type: number
          required: false
          description: Page number
          name: page
          in: query
        - schema:
            type: number
          required: false
          description: Number of items to take
          name: take
          in: query
        - schema:
            type: string
          required: false
          description: Next page token (Only used on special endpoints)
          name: next
          in: query
      responses:
        '200':
          description: You'll receive an array of collections.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CollectionSchema'
components:
  schemas:
    CollectionSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the collection
        name:
          type: string
          description: Name of the collection
        description:
          type: string
          nullable: true
          description: Description of the collection
        app:
          allOf:
            - $ref: '#/components/schemas/AppPublicSchema'
            - description: Public information about an app (organization)
        config:
          type: object
          nullable: true
          properties:
            id:
              type: string
              description: Unique identifier for the collection configuration
            rules:
              type: array
              items:
                $ref: '#/components/schemas/RuleSchema'
              description: List of rules associated with the collection
            mappings:
              type: array
              items:
                $ref: '#/components/schemas/CollectionConfigMappingSchema'
              description: List of input field mappings of the collection
            created_at:
              type: string
              nullable: true
              description: Timestamp when the configuration was created
              format: date
            updated_at:
              type: string
              nullable: true
              description: Timestamp when the configuration was last updated
              format: date
          required:
            - id
            - rules
            - mappings
            - created_at
            - updated_at
          description: Configuration of the collection. Including rules, triggers, etc.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
          description: Tags attached to this collection
        records_count:
          type: number
          description: How many records are in the collection
        deleted:
          type: boolean
          description: Has the collection been deleted
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/TriggerSchema'
          description: Triggers associated with the collection
        created_at:
          type: string
          nullable: true
          description: Timestamp when the collection was created
          format: date
        updated_at:
          type: string
          nullable: true
          description: Timestamp when the collection was last updated
          format: date
        link:
          type: string
          description: Link to the collection in the UI
      required:
        - id
        - name
        - description
        - app
        - config
        - tags
        - records_count
        - deleted
        - triggers
        - created_at
        - updated_at
        - link
      description: Detailed information about a collection
    AppPublicSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the app
        name:
          type: string
          description: Name of the app
        verified:
          type: boolean
          description: Verification status of the app
      required:
        - id
        - name
        - verified
      description: Associated app with the workflow
    RuleSchema:
      type: object
      properties:
        name:
          type: string
          description: Name of the rule
          example: Check Business Name
        key:
          type: string
          description: Unique key of the rule within the collection
          example: CHECK_BUSINESS_NAME
        execution_order:
          type: string
          description: When to run this rule compared to others
          example: before-all
        on_success:
          type: string
          enum:
            - PASS
            - FAIL
            - WARN
          description: Action to take if the rule passes
          example: PASS
        on_fail:
          type: string
          enum:
            - PASS
            - FAIL
            - WARN
          description: Action to take if the rule fails
          example: WARN
        step_key:
          type: string
          nullable: true
          description: Step key to run the rule on
        workflow_id:
          type: string
          description: Unique identifier of the linked workflow
          example: work_xxx
        workflow_version_id:
          type: string
          description: Unique identifier of the specific workflow version to use
          example: workv_xxx
        workflow_use_latest:
          type: boolean
          description: Should the rule use the latest version of the workflow?
          example: true
        workflow_input_default:
          allOf:
            - $ref: '#/components/schemas/InputValuesSchema'
            - description: Default config input values to execute the workflow with
              example:
                business_name: Example Corp
        disabled:
          type: boolean
          description: Whether the rule is disabled
          example: false
      required:
        - name
        - key
        - on_success
        - on_fail
        - workflow_id
        - workflow_version_id
        - workflow_use_latest
      description: Detailed information about a rule
    CollectionConfigMappingSchema:
      type: object
      properties:
        source_path:
          type: string
          description: Path to the source input field
          example: LOAN_APPLICATION:income
        destination_paths:
          type: array
          items:
            type: string
          description: Paths to the destination input fields to map to
          example:
            - MONTHLY_INCOME:amount
            - ANNUAL_INCOME:amount
      required:
        - source_path
        - destination_paths
      description: Mapping of a source field to multiple destination fields
    TagSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the tag
        name:
          type: string
          description: Name of the tag
        color:
          type: string
          nullable: true
          description: Color associated with the tag
        app_id:
          type: string
          description: Identifier for the associated app
        created_at:
          type: string
          nullable: true
          description: Timestamp when the tag was created
          format: date
        updated_at:
          type: string
          nullable: true
          description: Timestamp when the tag was last updated
          format: date
      required:
        - id
        - name
        - color
        - app_id
        - created_at
        - updated_at
      description: >-
        Detailed information about an app tag (which can be attached to records,
        workflows, etc.)
    TriggerSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the trigger
        type:
          type: string
          enum:
            - ENCOMPASS
            - PERSONA
          description: Service that the trigger is connected to
          example: ENCOMPASS
        name:
          type: string
          nullable: true
          description: Name of the trigger
          example: My Encompass Trigger
        config:
          $ref: '#/components/schemas/TriggerConfigSchema'
        enabled:
          type: boolean
          description: Whether the trigger is enabled or not
        connection_id:
          type: string
          nullable: true
          description: Unique identifier of the connected service
          example: con_xxx
        collection_id:
          type: string
          description: Unique identifier of the collection this trigger belongs to
        created_at:
          type: string
          nullable: true
          description: Creation date of the trigger
          format: date
        updated_at:
          type: string
          nullable: true
          description: Last update date of the trigger
          format: date
      required:
        - id
        - type
        - name
        - config
        - enabled
        - connection_id
        - collection_id
        - created_at
        - updated_at
      description: Detailed information about a trigger
    InputValuesSchema:
      type: object
      nullable: true
      additionalProperties:
        nullable: true
      description: Default config input values of the workflow
    TriggerConfigSchema:
      oneOf:
        - $ref: '#/components/schemas/TriggerEncompassConfigSchema'
        - $ref: '#/components/schemas/TriggerPersonaConfigSchema'
      discriminator:
        propertyName: type
        mapping:
          ENCOMPASS: '#/components/schemas/TriggerEncompassConfigSchema'
          PERSONA: '#/components/schemas/TriggerPersonaConfigSchema'
      description: Configuration of the trigger
    TriggerEncompassConfigSchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - ENCOMPASS
          description: Type of the trigger connection
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/TriggerMappingSchema'
          maxItems: 512
          description: Mappings of the trigger
        pull_on_millestones:
          type: array
          items:
            type: string
            maxLength: 512
          maxItems: 5
          description: Milestones to pull from Encompass
          example:
            - Application Received
            - Underwriting Complete
            - Clear to Close
        pull_on_folders:
          type: array
          items:
            type: string
            maxLength: 512
          maxItems: 5
          description: Folders to pull from Encompass
          example:
            - Loan Folder
            - Document Folder
            - Underwriting Folder
      required:
        - type
      description: Configuration for an Encompass trigger
    TriggerPersonaConfigSchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - PERSONA
          description: Type of the trigger connection
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/TriggerMappingSchema'
          maxItems: 512
          description: Mappings of the trigger
      required:
        - type
      description: Configuration for a Persona trigger
    TriggerMappingSchema:
      oneOf:
        - $ref: '#/components/schemas/MappingFieldDocumentSchema'
        - $ref: '#/components/schemas/MappingFieldPropertySchema'
      discriminator:
        propertyName: type
        mapping:
          document: '#/components/schemas/MappingFieldDocumentSchema'
          property: '#/components/schemas/MappingFieldPropertySchema'
      description: Detailed information about a trigger mapping
    MappingFieldDocumentSchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - document
        name:
          type: string
        entity_path:
          type: string
        input_path:
          type: array
          items:
            type: string
          maxItems: 512
      required:
        - type
        - entity_path
        - input_path
      description: Detailed information about a document mapping field
    MappingFieldPropertySchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - property
        name:
          type: string
        entity_path:
          type: string
        input_path:
          type: array
          items:
            type: string
          maxItems: 512
      required:
        - type
        - entity_path
        - input_path
      description: Detailed information about a property mapping field

````