> ## 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.

# Report Call Error

> Report a call issue through the frontend API-key-authenticated error reporting endpoint.

Reports an error or issue with a specific call to help improve the service.

### Request

**Method:** `POST`\
**Endpoint:** `/api/report-call-error`\
**Headers:**

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

**Request Body:**

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

**Parameters:**

* `uid` (string, required): Your user ID
* `agentId` (string, required): The ID of the agent that received the call
* `callId` (string, required): The ID of the call with the error
* `email` (string, required): Your email address for follow-up
* `reason` (string, required): Description of the error or issue

### Response

**Success Response (200):**

```json theme={null}
{
  "success": true
}
```

**Error Responses:**

* `400 Bad Request`: Invalid request body
* `401 Unauthorized`: Invalid or missing API key, or insufficient permissions
* `404 Not Found`: Call not found or invalid call ID
* `500 Internal Server Error`: Server error or problem submitting the error report

### Example

```bash theme={null}
curl -X POST https://app.phonely.ai/api/report-call-error \
  -H "X-Authorization: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123",
    "agentId": "agent456",
    "callId": "call789",
    "email": "user@example.com",
    "reason": "Agent did not respond properly to customer questions"
  }'
```

### Notes

* This endpoint helps improve the service by collecting feedback on call issues
* The error report will be sent to the Phonely team for review
* A link to the call history will be included in the error report


## OpenAPI

````yaml POST /report-call-error
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:
  /report-call-error:
    post:
      summary: Report an issue with a call
      description: Submit an error report for a specific call with feedback and suggestions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportCallErrorRequest'
      responses:
        '200':
          description: Error report submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates if the report was submitted successfully
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Call or agent not found
          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:
    ReportCallErrorRequest:
      type: object
      required:
        - uid
        - agentId
        - callId
        - email
        - reason
      properties:
        uid:
          type: string
          description: User ID
        agentId:
          type: string
          description: ID of the agent involved in the call
        callId:
          type: string
          description: ID of the call being reported
        email:
          type: string
          format: email
          description: Email address for feedback communication
        reason:
          type: string
          description: Detailed explanation of the issue or feedback
    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

````