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

# Get Agent by ID

> Retrieves a specific agent by its identifier for a designated location. The locationId parameter is mandatory, and the agent must maintain an active status to be retrieved.



## OpenAPI

````yaml /api-reference/agent-studio/openapi.json get /agent-studio/public-api/agents/{agentId}
openapi: 3.0.0
info:
  title: Agent Studio API
  description: >-
    Documentation for Agent Studio API — list, retrieve, and execute AI agents
    built in Agent Studio.
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Agents
    description: Manage and execute Agent Studio agents
paths:
  /agent-studio/public-api/agents/{agentId}:
    get:
      tags:
        - Agents
      summary: Get Agent by ID
      description: >-
        Retrieves a specific agent by its identifier for a designated location.
        The locationId parameter is mandatory, and the agent must maintain an
        active status to be retrieved.
      operationId: get-agent-by-id
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
        - name: agentId
          in: path
          description: The unique identifier for the agent
          required: true
          schema:
            type: string
        - name: locationId
          in: query
          description: Location ID (required)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Agent retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponseDTO'
        '400':
          description: Bad Request — locationId is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '404':
          description: Agent not found or not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorDTO'
      security:
        - bearer: []
components:
  schemas:
    AgentResponseDTO:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the agent
          example: agent_abc123
        locationId:
          type: string
          description: Location ID
          example: loc_abc123
        name:
          type: string
          description: Name of the agent
          example: Customer Support Bot
        description:
          type: string
          description: Description of the agent
        status:
          type: string
          description: Agent status
          enum:
            - active
            - inactive
        type:
          type: string
          description: Type of agent
        config:
          type: object
          description: Agent configuration settings
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
    NotFoundDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 404
        message:
          type: string
          example: Agent not found
        error:
          type: string
          example: Not Found
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
    InternalServerErrorDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 500
        message:
          type: string
          example: Internal server error
        error:
          type: string
          example: Internal Server Error
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````