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

# Get Agent

> Return one API-key-authenticated frontend agent record by agent ID.

## Get Agents

Retrieves detailed information about a specific agent.

### Request

**Method:** `POST`\
**Endpoint:** `/api/get-agent`\
**Headers:**

* `X-Authorization`: Your API key (required)
* `Content-Type`: `application/json`

**Request Body:**

```json theme={null}
{
  "uid": "string",
  "agentId": "string"
}
```

**Parameters:**

* `uid` (string, required): Your user ID
* `agentId` (string, required): The ID of the agent to retrieve

### Response

**Success Response (200):**

```json theme={null}
{
  "uid": "string",
  "agentId": "string", 
  "name": "string",
  "country": "string",
  "businessPhoneNumber": "string"
}
```

**Error Responses:**

* `400 Bad Request`: Invalid request body
* `401 Unauthorized`: Invalid or missing API key, or insufficient permissions
* `500 Internal Server Error`: Server error

### Example

```bash theme={null}
curl -X POST https://app.phonely.ai/api/get-agent \
  -H "X-Authorization: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123",
    "agentId": "agent456"
  }'
```


## OpenAPI

````yaml POST /get-agent
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /get-agent:
    post:
      summary: Get agent information
      description: Retrieve agent information based on the provided user ID and agent ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentRequest:
      type: object
      required:
        - uid
        - agentId
      properties:
        uid:
          type: string
          description: User ID
        agentId:
          type: string
          description: Agent ID
    AgentResponse:
      type: object
      properties:
        uid:
          type: string
          description: User ID
        agentId:
          type: string
          description: Agent ID
        name:
          type: string
          description: Agent name
        country:
          type: string
          description: Country code
          nullable: true
        businessPhoneNumber:
          type: string
          description: Business phone number
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````