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

# Discover agents on an agent platform

> List the Retell agents and connection candidates available to a provider API key. Supply credentials.apiKey or an existing agentId. This request does not register agents or save credentials.



## OpenAPI

````yaml openapi.json POST /v1/agents:discover
openapi: 3.1.0
info:
  title: Egma Platform API
  version: 1.0.0
  description: >-
    The customer-facing HTTP interface used by Egma's web app, CLI, and outside
    clients.
servers:
  - url: https://app.egma.ai
security: []
paths:
  /v1/agents:discover:
    post:
      tags:
        - Agents
      summary: Discover agents on an agent platform
      description: >-
        List the Retell agents and connection candidates available to a provider
        API key. Supply credentials.apiKey or an existing agentId. This request
        does not register agents or save credentials.
      operationId: discoverAgents
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            description: >-
              Project to act in. A project-scoped API key already identifies its
              project.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agentPlatform:
                  type: string
                  enum:
                    - retell
                  description: >-
                    Provider to query. Agent discovery currently supports
                    Retell.
                credentials:
                  type: object
                  description: >-
                    Retell account credential for this discovery request. Omit
                    it when using agentId to reuse a saved key.
                  properties:
                    apiKey:
                      type: string
                      description: >-
                        Retell API key with access to the agents you want to
                        list.
                      examples:
                        - YOUR_RETELL_API_KEY
                  required:
                    - apiKey
                  additionalProperties: false
                agentId:
                  type: string
                  minLength: 1
                  description: >-
                    Existing Egma agent whose stored Retell key should be used.
                    Omit credentials when supplying this field.
                  examples:
                    - agt_01M0E4J0BBE1FVDVTZ1BSS5C97
              required:
                - agentPlatform
              additionalProperties: false
              examples:
                - agentPlatform: retell
                  credentials:
                    apiKey: YOUR_RETELL_API_KEY
                - agentPlatform: retell
                  agentId: agt_01M0E4J0BBE1FVDVTZ1BSS5C97
      responses:
        '200':
          description: The agents and supported simulation connection candidates.
          content:
            application/json:
              schema:
                type: object
                properties:
                  agents:
                    type: array
                    items:
                      type: object
                      properties:
                        platformAgentId:
                          type: string
                        name:
                          type: string
                        modality:
                          type: string
                          enum:
                            - chat
                            - voice
                          description: >-
                            The modality Retell reports for this agent,
                            including when no supported connection candidate is
                            available yet.
                        connectionCandidates:
                          type: array
                          items:
                            type: object
                            properties:
                              agentPlatform:
                                type: string
                                enum:
                                  - retell
                              connectionType:
                                type: string
                                enum:
                                  - retell_text_mode
                                  - retell_web_call
                                  - phone_number
                              accessVariant:
                                type: string
                                enum:
                                  - retell_text_mode.api_key
                                  - retell_web_call.api_key
                                  - phone_number.public_e164
                              modality:
                                type: string
                                enum:
                                  - chat
                                  - voice
                              productLabel:
                                type: string
                              config:
                                type: object
                                additionalProperties:
                                  type: string
                                description: >-
                                  Confirmed non-secret settings for this
                                  candidate. Copy these with its connection
                                  type, access variant, and modality when
                                  creating the connection.
                            required:
                              - agentPlatform
                              - connectionType
                              - accessVariant
                              - modality
                              - productLabel
                              - config
                            additionalProperties: false
                      required:
                        - platformAgentId
                        - name
                        - modality
                        - connectionCandidates
                      additionalProperties: false
                required:
                  - agents
                additionalProperties: false
        '400':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '401':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '403':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '422':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '429':
          description: The request rate limit was reached.
          headers:
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '503':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  schemas:
    Refusal:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
      required:
        - error
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Egma API key.
    sessionCookie:
      type: apiKey
      in: cookie
      name: egma.session_token
      description: >-
        The browser session cookie issued by Egma. HTTPS deployments add the
        standard __Secure- prefix.

````