# Get Agent-Corpus Connections

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v2/agents/{agent_id}/corpora:
    get:
      summary: Get Agent-Corpus Connections
      deprecated: false
      description: >-
        Allows retrieving agent-corpus connections filtered by agent id. This
        endpoint supports pagination and filtering options.


        Staging behaviour:

        - Pass ``agent_version=staging`` as a query parameter to fetch the
        staging version's agent-corpus connections instead of the published
        agent's.


        Query Parameters:

        - is_enabled: To filter connections based on enabled status.

        - verbosity: To determine the verbosity of the response. Valid values
        are "low", "medium", "high". Default is "high".

        - query: The query to search for corpus names (case-insensitive,
        optional).

        - sort_by: Field to sort by (supports 'is_enabled', 'modified_on',
        'created_on'). Prefix with '-' for descending. Default is '-is_enabled'.

        - paginated: To enable pagination. Valid values are "true", "false".
        Default is "false".

        - page: The page number to retrieve when pagination is enabled. Default
        is 1.

        - items_per_page: Number of items per page when pagination is enabled.
        Default is 50.


        Returns:

        - JsonResponse with the retrieved agent-corpus connections or error
        message.

        - Response structure is consistent:
          - Non-paginated: {"items": [...], "meta": null}
          - Paginated: {"items": [...], "meta": {"count": int, "num_pages": int, "current_page": int}}

        Current Version:

        - 2.0.0
      operationId: api_v2_agents_corpora_list_retrieve
      tags:
        - Agents
        - Agents
        - v2
      parameters:
        - name: agent_id
          in: path
          description: ''
          required: true
          example: 0
          schema:
            type: integer
        - name: is_enabled
          in: query
          description: >-
            Filter by enabled status. Valid values are 'true', 'false'. Default
            is 'true'.
          required: false
          example: ''
          schema:
            type: string
            minLength: 1
            nullable: true
        - name: items_per_page
          in: query
          description: Number of items per page when pagination is enabled. Default is 50.
          required: false
          example: 0
          schema:
            type: integer
            minimum: 1
            default: 50
        - name: page
          in: query
          description: Page number to retrieve when pagination is enabled.
          required: false
          example: 0
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: paginated
          in: query
          description: 'Enable pagination. Valid values: true, false.'
          required: false
          example: ''
          schema:
            type: boolean
            default: false
        - name: query
          in: query
          description: Search term to filter corpora by name (case-insensitive). Optional.
          required: false
          example: ''
          schema:
            type: string
            nullable: true
        - name: sort_by
          in: query
          description: >-
            Field to sort by (supports 'is_enabled', 'modified_on',
            'created_on'). Prefix with '-' for descending. Default is
            '-is_enabled'.
          required: false
          example: ''
          schema:
            type: string
            default: '-is_enabled'
            minLength: 1
        - name: verbosity
          in: query
          description: >-
            Verbosity level. Valid values are 'low', 'medium', 'high'. Default
            is 'high'.
          required: false
          example: ''
          schema:
            type: string
            default: high
            minLength: 1
        - name: Organization-Id
          in: header
          description: 'ID of the organization. Optional. '
          required: false
          example: 0
          schema:
            type: integer
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: API KEY FOR EJENTO APIs
          required: true
          example: '{{your-api-key}}'
          schema:
            type: string
            default: '{{your-api-key}}'
        - name: Authorization
          in: header
          description: AUTH TOKEN
          example: Bearer {{your-access-token}}
          schema:
            type: string
            default: Bearer {{your-access-token}}
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCorpusListGetResponseSchema_V2'
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCorpusListGet400ResponseSchema_V2'
          headers: {}
          x-apidog-name: Bad Request
        '403':
          description: >-
            The subscription key belongs to a different organization than the
            one this request names, or you do not have access to the
            organization it names. An organization that does not exist returns
            the same response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: false
                  message:
                    type: string
                  data:
                    type: object
                    default: {}
                    x-apidog-orders: []
                    properties: {}
                    x-apidog-ignore-properties: []
                required:
                  - success
                  - message
                  - data
                x-apidog-orders:
                  - success
                  - message
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Record Not Found
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCorpusListGet404ResponseSchema_V2'
          headers: {}
          x-apidog-name: Server Error
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCorpusListGet500ResponseSchema_V2'
          headers: {}
          x-apidog-name: ''
        '503':
          description: >-
            The organization for this request could not be verified. Try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: false
                  message:
                    type: string
                  data:
                    type: object
                    default: {}
                    x-apidog-orders: []
                    properties: {}
                    x-apidog-ignore-properties: []
                required:
                  - success
                  - message
                  - data
                x-apidog-orders:
                  - success
                  - message
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: Agents
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/998119/apis/api-19061053-run
components:
  schemas:
    AgentCorpusListGetResponseSchema_V2:
      type: object
      properties:
        message:
          type: string
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/AgentCorpusListGetHVResponseSerializer_V2'
      required:
        - message
        - success
        - data
      x-apidog-orders:
        - message
        - success
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGetHVResponseSerializer_V2:
      type: object
      properties:
        agent_corpus:
          type: array
          items:
            $ref: '#/components/schemas/AgentCorpusListGet_HVSerializer_V2'
      required:
        - agent_corpus
      x-apidog-orders:
        - agent_corpus
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        created_by:
          type: string
          readOnly: true
          nullable: true
        modified_by:
          type: string
          readOnly: true
          nullable: true
        created_on:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        modified_on:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        agent:
          $ref: '#/components/schemas/AgentCorpusListGet_HVAgentCustomSerializer_V2'
        corpus:
          $ref: '#/components/schemas/AgentCorpusListGet_HVCorpusCustomSerializer_V2'
        is_enabled:
          type: boolean
        is_default:
          type: boolean
        is_deleted:
          type: boolean
        parent:
          type: integer
          nullable: true
        connected_by:
          type: integer
      required:
        - id
        - created_by
        - modified_by
        - created_on
        - modified_on
        - agent
        - corpus
      x-apidog-orders:
        - id
        - created_by
        - modified_by
        - created_on
        - modified_on
        - agent
        - corpus
        - is_enabled
        - is_default
        - is_deleted
        - parent
        - connected_by
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVCorpusCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        indexing_mode:
          $ref: >-
            #/components/schemas/AgentCorpusListGet_HVIndexingModeCustomSerializer_V2
        name:
          type: string
          maxLength: 255
          nullable: true
        description:
          type: string
          nullable: true
        owner:
          $ref: '#/components/schemas/AgentCorpusListGet_HVUserCustomSerializer_V2'
        tags:
          type: array
          items:
            type: string
      required:
        - id
        - indexing_mode
        - owner
        - tags
      x-apidog-orders:
        - id
        - indexing_mode
        - name
        - description
        - owner
        - tags
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVUserCustomSerializer_V2:
      type: object
      description: >-
        Adds organization-aware ``is_superuser`` and ``is_staff`` serializer
        fields.


        The values are derived from the user's organization relations rather
        than

        Django's global flags.
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        is_superuser:
          type: boolean
          readOnly: true
          description: Whether the user is an admin of the organization.
        first_name:
          type: string
          maxLength: 30
          nullable: true
        last_name:
          type: string
          maxLength: 30
          nullable: true
        organization:
          $ref: >-
            #/components/schemas/AgentCorpusListGet_HVOrganizationCustomSerializer_V2
      required:
        - id
        - is_superuser
        - organization
      x-apidog-orders:
        - id
        - email
        - is_superuser
        - first_name
        - last_name
        - organization
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVOrganizationCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        org_name:
          type: string
          maxLength: 256
      required:
        - id
        - org_name
      x-apidog-orders:
        - id
        - org_name
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVIndexingModeCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mode:
          enum:
            - exhaustive
            - moderate
            - basic
          type: string
          description: |-
            * `exhaustive` - Exhaustive
            * `moderate` - Moderate
            * `basic` - Basic
      required:
        - id
        - mode
      x-apidog-orders:
        - id
        - mode
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVAgentCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        agent_type:
          $ref: >-
            #/components/schemas/AgentCorpusListGet_HVAgentTypeCustomSerializer_V2
        instructions:
          type: array
          items:
            $ref: >-
              #/components/schemas/AgentCorpusListGet_HVInstructionCustomSerializer_V2
          readOnly: true
        agent_name:
          type: string
          maxLength: 256
        domain:
          type: string
          nullable: true
        prefix_prompt:
          type: string
          nullable: true
        alias:
          type: string
          maxLength: 512
          nullable: true
        is_deleted:
          type: boolean
        created_by:
          type: string
          readOnly: true
          nullable: true
        access:
          type: string
          maxLength: 512
        project:
          type: integer
          nullable: true
        llm_config:
          type: integer
          nullable: true
      required:
        - id
        - agent_type
        - instructions
        - agent_name
        - created_by
      x-apidog-orders:
        - id
        - agent_type
        - instructions
        - agent_name
        - domain
        - prefix_prompt
        - alias
        - is_deleted
        - created_by
        - access
        - project
        - llm_config
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVInstructionCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        created_by:
          type: string
          readOnly: true
          nullable: true
        modified_by:
          type: string
          readOnly: true
          nullable: true
        created_on:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        modified_on:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        instruction:
          type: string
        is_deleted:
          type: boolean
        parent:
          type: integer
          nullable: true
        agent:
          type: integer
      required:
        - id
        - created_by
        - modified_by
        - created_on
        - modified_on
        - instruction
        - agent
      x-apidog-orders:
        - id
        - created_by
        - modified_by
        - created_on
        - modified_on
        - instruction
        - is_deleted
        - parent
        - agent
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet_HVAgentTypeCustomSerializer_V2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 512
      required:
        - id
        - name
      x-apidog-orders:
        - id
        - name
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet400ResponseSchema_V2:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: Bad Request
        data:
          type: object
          additionalProperties:
            type: string
          default: {}
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - success
        - message
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet404ResponseSchema_V2:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: Not Found
        data:
          type: object
          additionalProperties:
            type: string
          default: {}
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - success
        - message
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AgentCorpusListGet500ResponseSchema_V2:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: Internal Server Error
        data:
          type: object
          additionalProperties:
            type: string
          default: {}
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - success
        - message
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    cookieAuth:
      type: apikey
      in: cookie
      name: sessionid
    oauth2:
      type: oauth2
      flows: {}
    APIKeyHeader:
      type: apikey
      in: header
      name: X-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/login/access-token
    ejentoAuthKey:
      type: apikey
      in: header
      name: ejento-auth-key
      description: Server-to-server authentication key (EJENTO_SECRET / EJENTO_AUTH_KEY)
    Ocp-Apim-Subscription-Key:
      type: apikey
      in: header
      name: Ocp-Apim-Subscription-Key
      description: Subscription key. Required on every endpoint.
    Authorization:
      type: bearer
      scheme: bearer
      description: >-
        Your access token, sent as `Authorization: Bearer <token>` alongside the
        subscription key.
    Combination:
      group:
        - id: 619278
        - id: 619279
      type: combination
servers:
  - url: https://{{your-server-name}}
    description: Prod Env
security: []

```
