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

# Get Retrieval Info

> Return metadata of the contents used to generate the response for a given message.



## OpenAPI

````yaml api-reference/openapi.json get /agents/{agent_id}/query/{message_id}/retrieval/info
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /agents/{agent_id}/query/{message_id}/retrieval/info:
    get:
      tags:
        - /agents/{id}/query
      summary: Get Retrieval Info
      description: >-
        Return metadata of the contents used to generate the response for a
        given message.
      operationId: >-
        Get_Retrieval_Info_agents__agent_id__query__message_id__retrieval_info_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the agent which sent the provided message.
            title: Agent Id
          description: ID of the agent which sent the provided message.
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              ID of the message for which the content metadata needs to be
              retrieved.
            title: Message Id
          description: >-
            ID of the message for which the content metadata needs to be
            retrieved.
        - name: content_ids
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            description: List of content ids for which to get the metadata.
            title: Content Ids
          description: List of content ids for which to get the metadata.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrievalInfoQueryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RetrievalInfoQueryResponse:
      properties:
        content_metadatas:
          items:
            oneOf:
              - $ref: '#/components/schemas/UnstructuredContentMetadata'
              - $ref: '#/components/schemas/StructuredContentMetadata'
              - $ref: '#/components/schemas/FileAnalysisContentMetadata'
              - $ref: '#/components/schemas/ContextualAgentContentMetadata'
            description: Content type
            discriminator:
              propertyName: content_type
              mapping:
                contextual_agent_response:
                  $ref: '#/components/schemas/ContextualAgentContentMetadata'
                file_analysis:
                  $ref: '#/components/schemas/FileAnalysisContentMetadata'
                structured:
                  $ref: '#/components/schemas/StructuredContentMetadata'
                unstructured:
                  $ref: '#/components/schemas/UnstructuredContentMetadata'
          type: array
          title: Content Metadatas
          description: List of content metadatas.
          default: []
      type: object
      title: RetrievalInfoQueryResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnstructuredContentMetadata:
      properties:
        x0:
          type: number
          title: X0
          description: X coordinate of the top left corner on the bounding box.
        y0:
          type: number
          title: Y0
          description: Y coordinate of the top left corner on the bounding box.
        x1:
          type: number
          title: X1
          description: X coordinate of the bottom right corner on the bounding box.
        y1:
          type: number
          title: Y1
          description: Y coordinate of the bottom right corner on the bounding box.
        page:
          type: integer
          title: Page
          description: Page number of the content.
        page_img:
          type: string
          title: Page Img
          description: Image of the page on which the content occurs.
        width:
          type: number
          title: Width
          description: Width of the image.
        height:
          type: number
          title: Height
          description: Height of the image.
        content_id:
          type: string
          format: uuid
          title: Content Id
          description: Id of the content.
        document_id:
          type: string
          format: uuid
          title: Document Id
          description: Id of the document which the content belongs to.
        content_type:
          type: string
          const: unstructured
          title: Content Type
          default: unstructured
        content_text:
          type: string
          title: Content Text
          description: Text of the content.
      type: object
      required:
        - x0
        - y0
        - x1
        - y1
        - page
        - page_img
        - width
        - height
        - content_id
        - document_id
        - content_text
      title: UnstructuredContentMetadata
    StructuredContentMetadata:
      properties:
        content_id:
          type: string
          title: Content Id
          description: Id of the content.
        content_type:
          type: string
          const: structured
          title: Content Type
          default: structured
        content_text:
          title: Content Text
          description: Text of the content.
      type: object
      required:
        - content_id
        - content_text
      title: StructuredContentMetadata
    FileAnalysisContentMetadata:
      properties:
        gcp_location:
          type: string
          title: Gcp Location
          description: GCP location of the file.
        file_format:
          type: string
          title: File Format
          description: Format of the file.
        content_id:
          type: string
          format: uuid
          title: Content Id
          description: Id of the content.
        content_type:
          type: string
          const: file_analysis
          title: Content Type
          default: file_analysis
      type: object
      required:
        - gcp_location
        - file_format
        - content_id
      title: FileAnalysisContentMetadata
    ContextualAgentContentMetadata:
      properties:
        content_id:
          type: string
          format: uuid
          title: Content Id
          description: Id of the content.
        content_type:
          type: string
          const: contextual_agent_response
          title: Content Type
          default: contextual_agent_response
        agent_id:
          type: string
          title: Agent Id
          description: Id of the agent that generated the response.
        content_text:
          type: string
          title: Content Text
          description: The text content of the agent response.
      type: object
      required:
        - content_id
        - agent_id
        - content_text
      title: ContextualAgentContentMetadata
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````