> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getvoxai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getvoxai.com/_mcp/server.

# Export caller data

POST https://api.getvoxai.com/v1/caller-requests/export
Content-Type: application/json

Returns everything the platform keeps about a phone number for your organization, to answer a request of access or portability (GDPR art. 15 and 20): every call in the shape of `GET /calls/{call_id}` with its transcript, every outbound contact with the values you loaded and the origin you declared, and the objection. The export is recorded in the register as an `access` request, with the one-month deadline counted from `received_at`. Live keys only. A number with more than 200 calls cannot be exported here. Required scope: `caller_requests:manage`. It is not available with a test key (`vx_test_`): the response is `403 not_available_in_test_mode`. This is a read that uses POST only so that its input (a phone number, a search text) travels in the body and never in the URL. It takes no `Idempotency-Key`, nothing is stored, and the response is never cached or repeated.

Reference: https://docs.getvoxai.com/api-reference/privacy-requests/caller-requests-export

## Authentication

- `Authorization` header (bearer token, required) — API key created by an Owner or Admin of the organization. Never in the query string.

## Request

### Headers

- `VoxAI-Version` (enum, optional) — API version for this request; defaults to the version the key is pinned to.
  - Allowed values: `2026-10-01`

### Body (application/json)

This endpoint expects an object.

- `phone_number` (string, required) — The phone number of the person, in international format (E.164), for example +393331234567. It travels only in the request body.
- `received_at` (datetime, optional) — When you received the person's request (ISO 8601). It starts the one-month deadline of GDPR art. 12(3). Default: now. Not earlier than 365 days ago and not in the future.
- `reference` (string, optional) — Your own reference for the request, for example the case number: 1 to 64 letters, digits, dots, underscores, colons or hyphens. It must not be personal data.

## Response

### 200

Successful response.

- `object` ("caller_data_export", required) — Always `caller_data_export`.
- `request_id` (string, required) — The id of the request in the register (`GET /caller-requests`).
- `generated_at` (datetime, required) — When the export was made, ISO 8601 UTC.
- `calls` (list of CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItems, required) — Every call of this number, each in the shape of `GET /calls/{id}` plus its transcript. At most 200: beyond that the export is refused.
- `contacts` (list of CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItems, required) — Every outbound contact with this number.
- `objection` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaObjection, required) — The do-not-call list of the organization: `active` is true if this number has objected to being called.

## Errors

### 400 Bad Request Error

Possible errors: * `invalid_api_version`: The `VoxAI-Version` header names a version that does not exist. Use one of the versions listed in the `VoxAI-Version` parameter, or omit the header to use the version the key is pinned to. * `invalid_request`: The path, query or body does not match the schema of the operation: a missing or unknown field, a wrong type, a value out of range. Fix the request. `details` lists each problem as `{ location, path, message }`: `location` is `params`, `query` or `body` and `path` points to the field.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 401 Unauthorized Error

Possible errors: - `invalid_api_key`: The `Authorization` header is missing, malformed, or carries a key that does not exist, was revoked or has expired. Send `Authorization: Bearer vx_live_…` (or `vx_test_…`) with an active key. Create a new key in the app if this one expired.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 403 Forbidden Error

Possible errors: - `feature_not_available`: The plan of the organization does not include the API, or the feature this operation needs. Upgrade the plan in the app. Reads and deletions stay available after a downgrade. - `insufficient_scope`: The key does not have the scope this operation requires (written in the description of the operation). Create a key with the required scope (an Owner or Admin can do it in the app), or ask for the scope to be added. - `ip_not_allowed`: The key has an IP allow-list and the request comes from an address that is not on it. Call from an allowed address, or add this address to the key in the app. - `organization_suspended`: The organization that owns the key is suspended. Contact the organization Owner: nothing can be done through the API until the organization is active again.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 422 Unprocessable Entity Error

Possible errors: - `caller_export_too_large`: This number has more calls than an immediate export can hold (200). Contact support with the `requestId` to receive the export by other means. - `too_many_records`: Too many records were found for this number, so the operation was stopped for safety. Contact support with the `requestId`: the request will be handled by hand.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 429 Too Many Requests Error

Possible errors: - `rate_limited`: Too many requests: over the per-minute limit of this key or of the whole organization (see `rate_limits` in `GET /me`), or over a limit of the operation itself, such as the hourly limit on webhook tests and resends. Wait for the number of seconds in the `Retry-After` header, then retry. Spread requests over time.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 500 Internal Server Error

Possible errors: - `internal_error`: An unexpected error on our side. Retry once after a few seconds. For writes marked as retriable, retry with the same `Idempotency-Key`, so the operation is never done twice; for the other writes, first read the state of the resource, then retry with a NEW key only if the operation did not happen. If it persists, contact support with the `requestId`.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

### 503 Service Unavailable Error

Possible errors: - `api_not_configured`: The API is not enabled on this service. Contact support. - `service_unavailable`: A component the operation depends on is temporarily unavailable. Retry after a few seconds. For writes marked as retriable, use the same `Idempotency-Key`; for the other writes, first read the state of the resource, then retry with a NEW key only if the operation did not happen.

- `error` (string, required) — Human-readable message in English.
- `code` (string, required) — Stable machine-readable code; decide what to do from this, never from the message.
- `requestId` (string, required) — Same value as the X-Request-Id response header; quote it when contacting support.
- `details` (any, optional) — Extra information, only on some codes. For `invalid_request` it is a list of `{ location, path, message }`, one per field (`location` is `params`, `query` or `body`) with a problem; for the other codes its fields depend on the code (for example `details.limit`).

## Types

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItems

- `object` ("call", required) — Always `call`.
- `id` (string, required) — Id of the call: use it with `GET /calls/{call_id}`, the transcript and the events.
- `started_at` (datetime, required, nullable) — When the call started, ISO 8601 UTC; `null` if it never started.
- `ended_at` (datetime, required, nullable) — When the call ended, ISO 8601 UTC; `null` while it is in progress.
- `duration_seconds` (integer, required) — Talk time in seconds. 0 for missed calls. It is not the billed time (see `GET /usage`).
- `direction` (enum, required) — `inbound`: a phone call received on a line of the organization. `outbound`: a phone call made by an agent (`POST /calls` or a campaign). `web`: a conversation in the web widget.
  - Allowed values: `inbound`, `outbound`, `web`
- `status` (enum, required) — How the call went. `completed`: the conversation ended normally. `transferred`: the agent handed the call to a person. `forwarded`: an inbound call forwarded to the business number without the agent (answering mode, or a backup number). `interrupted`: the call was cut before its natural end. `failed`: the call could not take place because of an error. `in_progress`: the call is still going on. Rejected before an agent answered: `missed_lines_busy` (all concurrent-call lines busy), `missed_quota` (plan minutes used up), `missed_suspended` (organization suspended), `missed_platform` (the service was at capacity), `missed_agent_suspended` (the agent is suspended).
  - Allowed values: `completed`, `transferred`, `forwarded`, `interrupted`, `failed`, `in_progress`, `missed_lines_busy`, `missed_quota`, `missed_suspended`, `missed_platform`, `missed_agent_suspended`
- `caller_number` (string, required, nullable) — The other party of the call, in international format: who called (inbound) or who was called (outbound). `null` on the web channel.
- `line_number` (string, required, nullable) — The phone line of the organization used by the call, in international format. `null` on the web channel.
- `agent` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsAgent, required, nullable) — The agent that handled the call (the first one, for calls that passed between agents); `null` if no agent took part.
- `handoff_count` (integer, required) — How many times the call passed from one agent of a team to another. 0 for calls handled by one agent.
- `summary` (string, required, nullable) — Free text written by the agent after the call; it may contain personal data of the caller. Only on the single call, never in the list. Reading it is recorded in the audit log. `null` if there is no summary.
- `report_card` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCard, required) — The report card of the call, with each criterion.
- `transfer` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTransfer, required) — The transfer to a person, if the agent tried one.
- `sms_sent_count` (integer, required) — SMS sent by the agent during the call.
- `collected_data` (list of CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsCollectedDataItems, required) — Information the agent extracted from the conversation, as configured on the agent; personal data of the caller. Reading it is recorded in the audit log. Empty if nothing was collected.
- `transcript` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTranscript, required) — The transcript of the call, in the shape of `GET /calls/{call_id}/transcript`.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItems

A contact with this number, with the values and the origin you declared.

- `id` (string, required) — The id of the contact (for a single call, the id of `GET /outbound-calls/{outbound_call_id}`).
- `kind` (enum, required) — `campaign`: a contact loaded in a campaign. `single_call`: a number called with `POST /calls`.
  - Allowed values: `campaign`, `single_call`
- `campaign_ids` (list of string, required) — The campaigns the contact belongs to; empty for a single call.
- `status` (enum, required) — Where the contact stands. `pending`: not called yet. `dialing`: being called. `answered`: a person answered. `voicemail_left`: the agent left a message on an answering machine. `no_answer`: nobody answered (it may be retried). `invalid_number`: the number does not exist or is a fax. `completed`: the call ended normally. `failed`: the call could not be made. `missing_variables`: a variable the agent needs was missing. `destination_not_allowed`: the number cannot be called (only Italian landline, mobile and toll-free (800, 803) numbers can). `objected`: the number is on the do-not-call list.
  - Allowed values: `pending`, `dialing`, `answered`, `voicemail_left`, `no_answer`, `invalid_number`, `completed`, `failed`, `missing_variables`, `destination_not_allowed`, `objected`
- `attempts` (integer, required) — How many times the number was dialed; 0 when it was never called.
- `goal_achieved` (boolean, required, nullable) — Whether the agent reached its goal, from the report card; `null` until the call is evaluated.
- `variables` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItemsVariables, required) — The values loaded for this contact, exactly as you sent them.
- `contact_origin` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItemsContactOrigin, required, nullable) — Where the right to call this person was declared to come from (GDPR art. 15(1)(g): the person may ask where their number comes from). `null` if it was never declared.
- `created_at` (datetime, required, nullable) — When the contact was created, ISO 8601 UTC.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaObjection

The do-not-call list of the organization: `active` is true if this number has objected to being called.

- `active` (boolean, required) — `true` if this number is on the do-not-call list of the organization.
- `since` (datetime, required, nullable) — When the objection was recorded, ISO 8601 UTC; `null` when there is none.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsAgent

The agent that handled the call (the first one, for calls that passed between agents); `null` if no agent took part.

- `id` (string, required) — Id of the agent.
- `name` (string, required, nullable) — Name of the agent; `null` if the agent was deleted.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCard

The report card of the call, with each criterion.

- `status` (enum, required) — `evaluated`: the report card is ready. `pending`: the call ended a few minutes ago and the report card is being computed. `not_evaluated`: the call has no report card (for example it was missed or too short).
  - Allowed values: `evaluated`, `pending`, `not_evaluated`
- `outcome` (enum, required) — Overall judgement of the call: `positive` (goal reached), `needs_review` (worth a look), `negative` (goal not reached). `null` while there is no report card.
  - Allowed values: `positive`, `needs_review`, `negative`
- `criteria` (list of CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCardCriteriaItems, required) — Every criterion of the report card, in the order configured on the agent. Empty while the report card is not ready.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTransfer

The transfer to a person, if the agent tried one.

- `status` (enum, required) — `none`: no transfer to a person. `attempted`: the agent tried, nobody answered. `answered`: a person took the call.
  - Allowed values: `none`, `attempted`, `answered`
- `duration_seconds` (integer, required) — Seconds spent with the person after an answered transfer; 0 otherwise.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsCollectedDataItems

- `key` (string, required) — Stable key of the piece of information, as configured on the agent.
- `label` (string, required) — Name shown in the app.
- `value` (string, required) — The value extracted from the conversation, as text.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTranscript

The transcript of the call, in the shape of `GET /calls/{call_id}/transcript`.

- `object` ("call_transcript", required) — Always `call_transcript`.
- `call_id` (string, required) — Id of the call.
- `status` (enum, required) — `available`: `turns` holds the conversation. `processing`: the call is still in progress. `unavailable`: there is nothing to read; `turns` is empty.
  - Allowed values: `available`, `processing`, `unavailable`
- `turns` (list of CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTranscriptTurnsItems, required) — The conversation, turn by turn, in order.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItemsVariables

The values loaded for this contact, exactly as you sent them.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaContactsItemsContactOrigin

Where the right to call this person was declared to come from (GDPR art. 15(1)(g): the person may ask where their number comes from). `null` if it was never declared.

- `basis` (string, required) — The legal basis declared: `contract`, `callback_request`, `consent` or `legitimate_interest`.
- `purpose` (string, required) — The purpose declared: `service` or `marketing`.
- `reference` (string, required, nullable) — Your reference given with the declaration; `null` if none.
- `opposition_register_checked_on` (string, required, nullable) — The date you checked the national opposition register, as declared; `null` if not declared.
- `declared_at` (string, required) — When the origin was declared, ISO 8601 UTC.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCardCriteriaItems

- `key` (string, required) — Stable key of the criterion, as configured on the agent.
- `label` (string, required) — Name of the criterion shown in the app.
- `description` (string, required, nullable) — What the criterion checks, as configured on the agent; `null` if it has no description.
- `type` (enum, required) — Kind of value. `outcome`: the overall outcome (`value` is `positive`, `needs_review` or `negative`). `yes_no`: `value` is a boolean. `number`: `value` is a number.
  - Allowed values: `outcome`, `yes_no`, `number`
- `value` (CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCardCriteriaItemsValue, required) — The value found in the conversation, of the kind given by `type`.
- `result` (enum, required) — Only on the `outcome` criterion: `ok` (positive), `partial` (needs review), `failed` (negative). Custom criteria have `null`, because only you know which value is good.
  - Allowed values: `ok`, `partial`, `failed`

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsTranscriptTurnsItems

- `index` (integer, required) — Position of the turn in the conversation, from 0.
- `at` (datetime, required, nullable) — When the turn was spoken, ISO 8601 UTC; `null` on some older calls.
- `speaker` (enum, required) — `caller`: the person on the other side. `agent`: the voice agent.
  - Allowed values: `caller`, `agent`
- `text` (string, required) — What was said, as transcribed.
- `agent_name` (string, optional) — Only on agent turns of calls that passed between agents: which agent spoke.

### CallerRequestsExportPostResponsesContentApplicationJsonSchemaCallsItemsReportCardCriteriaItemsValue

The value found in the conversation, of the kind given by `type`.

- string
- double
- boolean

## Examples

**Request**

```json
{
  "phone_number": "+393331234567",
  "received_at": "2026-11-15T10:00:00Z",
  "reference": "case-2026-118"
}
```

**Response**

```json
{
  "object": "caller_data_export",
  "request_id": "2c6e9a14-7b3f-4d21-9e8a-5f0b1c3d7e92",
  "generated_at": "2026-11-17T09:12:44Z",
  "calls": [],
  "contacts": [
    {
      "id": "6a1d3f8e-2b4c-4e9a-8d7f-0c5b9e1a3f26",
      "kind": "campaign",
      "campaign_ids": [
        "4f8b2e1a-9c3d-4a7e-b6f5-1d2c8e0a9b37"
      ],
      "status": "completed",
      "attempts": 1,
      "goal_achieved": true,
      "variables": {
        "nome_cliente": "Giulia"
      },
      "contact_origin": {
        "basis": "contract",
        "purpose": "service",
        "reference": "appointment-48213",
        "opposition_register_checked_on": null,
        "declared_at": "2026-11-10T08:00:00Z"
      },
      "created_at": "2026-11-10T08:00:00Z"
    }
  ],
  "objection": {
    "active": false,
    "since": null
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.getvoxai.com/v1/caller-requests/export"

payload = {
    "phone_number": "+393331234567",
    "received_at": "2026-11-15T10:00:00Z",
    "reference": "case-2026-118"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getvoxai.com/v1/caller-requests/export';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"phone_number":"+393331234567","received_at":"2026-11-15T10:00:00Z","reference":"case-2026-118"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getvoxai.com/v1/caller-requests/export"

	payload := strings.NewReader("{\n  \"phone_number\": \"+393331234567\",\n  \"received_at\": \"2026-11-15T10:00:00Z\",\n  \"reference\": \"case-2026-118\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getvoxai.com/v1/caller-requests/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phone_number\": \"+393331234567\",\n  \"received_at\": \"2026-11-15T10:00:00Z\",\n  \"reference\": \"case-2026-118\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getvoxai.com/v1/caller-requests/export")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phone_number\": \"+393331234567\",\n  \"received_at\": \"2026-11-15T10:00:00Z\",\n  \"reference\": \"case-2026-118\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getvoxai.com/v1/caller-requests/export', [
  'body' => '{
  "phone_number": "+393331234567",
  "received_at": "2026-11-15T10:00:00Z",
  "reference": "case-2026-118"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getvoxai.com/v1/caller-requests/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phone_number\": \"+393331234567\",\n  \"received_at\": \"2026-11-15T10:00:00Z\",\n  \"reference\": \"case-2026-118\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "phone_number": "+393331234567",
  "received_at": "2026-11-15T10:00:00Z",
  "reference": "case-2026-118"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getvoxai.com/v1/caller-requests/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```