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

# Get Calls

> Retrieve calls associated with an invoice

Retrieve all calls associated with a specific invoice ID.

<Note>
  This endpoint returns `false` if no calls exist for the given invoice ID, or
  an array of call objects if calls are found.
</Note>

## Request

<ParamField query="invoice_id" type="string" required>
  The unique identifier of the invoice to retrieve calls for
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token for API authentication
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url https://api.credira.com/v1/calls?invoice_id=inv_987654321 \
       --header 'Authorization: Bearer YOUR_API_KEY' \
       --header 'Content-Type: application/json'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch(
    "https://api.credira.com/v1/calls?invoice_id=inv_987654321",
    {
      method: "GET",
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample status="200" summary="Success">
  ```json theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "call_123456789",
        "invoice_id": "inv_987654321",
        "duration": 180,
        "status": "completed",
        "from": "+1234567890",
        "to": "+0987654321",
        "transcription_url": "https://api.credira.com/transcriptions/call_123456789.txt",
        "call_recording_url": "https://api.credira.com/recordings/call_123456789.mp3",
        "confidence_score": 0.95,
        "voice_agent_id": "agent_456789123",
        "timezone": "America/New_York",
        "account_id": "acc_789123456",
        "created_time": "2024-01-15T10:30:00Z"
      }
    ],
    "meta": {
      "timestamp": "2024-01-15T10:30:00Z",
      "request_id": "req_123456789",
      "total_calls": 1
    }
  }
  ```
</ResponseExample>

<ResponseExample status="400" summary="Bad Request">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "code": "INVALID_REQUEST",
      "message": "Missing required parameter: invoice_id"
    },
    "meta": {
      "timestamp": "2024-01-15T10:30:00Z",
      "request_id": "req_123456789"
    }
  }
  ```
</ResponseExample>

<ResponseExample status="401" summary="Unauthorized">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Invalid or missing API key"
    },
    "meta": {
      "timestamp": "2024-01-15T10:30:00Z",
      "request_id": "req_123456789"
    }
  }
  ```
</ResponseExample>

<ResponseExample status="404" summary="Not Found">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "code": "NOT_FOUND",
      "message": "Invoice not found"
    },
    "meta": {
      "timestamp": "2024-01-15T10:30:00Z",
      "request_id": "req_123456789"
    }
  }
  ```
</ResponseExample>

<ResponseExample status="429" summary="Too Many Requests">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "code": "RATE_LIMITED",
      "message": "Rate limit exceeded"
    },
    "meta": {
      "timestamp": "2024-01-15T10:30:00Z",
      "request_id": "req_123456789"
    }
  }
  ```
</ResponseExample>
