> This page is for Платформа, version V4 (default).
> For other versions, use one of these documentation indexes:
> - V4 (default): https://developer.frame.io/platform/v4/llms.txt
> - Версия 4 экспериментальная: https://developer.frame.io/platform/v4-experimental/llms.txt
> - Предыдущая версия: https://developer.frame.io/platform/v2/llms.txt

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

# Поиск учетной записи

POST https://api.frame.io/v4/accounts/{account_id}/search
Content-Type: application/json

Search across assets, folders, and projects within an account.
Rate Limits: 100 calls per 1.00 minute(s) per account_user


Reference: https://developer.frame.io/platform/api-reference/search/search

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `account_id` (string, required)

### Query parameters

- `after` (string, optional) — Opaque Cursor query param for requests returning paginated results. NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
- `page_size` (integer, optional, default: 50)
- `include_total_count` (boolean, optional, default: false)

### Body (application/json)

This endpoint expects a SearchParams.

- `engine` (enum, required) — Search engine to use. Available engines: lexical, nlp.
  - Allowed values: `lexical`, `nlp`
- `query` (string, required) — The search query text
- `filters` (SearchParamsFilters, optional) — Filters to control which types of results are returned

## Response

### 200

OK

- `data` (list of SearchResponseDataItems, required) — List of search results
- `links` (Links, required) — Links to paginated data
- `total_count` (integer, optional, nullable) — Total number of matching results

## Errors

### 400 Bad Request Error

Bad request

- `errors` (list of BadRequestErrorsItems, required)

### 401 Unauthorized Error

Unauthorized

- `errors` (list of UnauthorizedErrorsItems, required)

### 403 Forbidden Error

Forbidden

- `errors` (list of ForbiddenErrorsItems, required)

### 404 Not Found Error

Not found

- `errors` (list of NotFoundErrorsItems, required)

### 409 Conflict Error

Conflict

- `errors` (list of ConflictErrorsItems, required)

### 422 Unprocessable Entity Error

Unprocessable content

- `errors` (list of UnprocessableContentErrorsItems, required)

### 429 Too Many Requests Error

Too many requests

- `errors` (list of TooManyRequestsErrorsItems, required)

## Types

### SearchParamsFilters

Filters to control which types of results are returned

- `files_and_version_stacks` (boolean, optional, default: true) — Include files and version stacks in search results
- `folders` (boolean, optional, default: true) — Include folders in search results
- `projects` (boolean, optional, default: true) — Include projects in search results

### SearchResponseDataItems

- AssetSearchResult: AssetSearchResult
- ProjectSearchResult: ProjectSearchResult

### Links

Links to paginated data

- `next` (string, required, nullable) — "Link to next page of data. This link is the request path with the addition of the `after` query parameter to fetch the next page of results. It only carries the `after` cursor. Other query params from the original request (e.g. `include`, `sort`, `page_size`, `include_total_count`, filters) are not preserved and must be re-added by the client on every subsequent request, including when following this link.

### BadRequestErrorsItems

- `detail` (string, required)
- `source` (BadRequestErrorsItemsSource, optional)
- `title` (string, optional)

### UnauthorizedErrorsItems

- `detail` (string, required)
- `source` (UnauthorizedErrorsItemsSource, optional)
- `title` (string, optional)

### ForbiddenErrorsItems

- `detail` (string, required)
- `source` (ForbiddenErrorsItemsSource, optional)
- `title` (string, optional)

### NotFoundErrorsItems

- `detail` (string, required)
- `source` (NotFoundErrorsItemsSource, optional)
- `title` (string, optional)

### ConflictErrorsItems

- `detail` (string, required)
- `source` (ConflictErrorsItemsSource, optional)
- `title` (string, optional)

### UnprocessableContentErrorsItems

- `detail` (string, required)
- `source` (UnprocessableContentErrorsItemsSource, optional)
- `title` (string, optional)

### TooManyRequestsErrorsItems

- `detail` (string, required)
- `source` (TooManyRequestsErrorsItemsSource, optional)
- `title` (string, optional)

### AssetSearchResult

A search result containing an asset (file, folder, or version stack)

- `matches` (list of SearchMatch, required) — Matches explaining why this result was returned
- `result` (AssetSearchResultResult, required) — The file, folder, or version stack matching the search query
- `type` (enum, required)
  - Allowed values: `file_result`, `folder_result`, `version_stack_result`

### ProjectSearchResult

A search result containing a project

- `matches` (list of SearchMatch, required) — Matches explaining why this result was returned
- `result` (ProjectWithDescription, required) — Frame.io Project
- `type` (enum, required)
  - Allowed values: `project_result`

### BadRequestErrorsItemsSource

- `pointer` (string, optional)

### UnauthorizedErrorsItemsSource

- `pointer` (string, optional)

### ForbiddenErrorsItemsSource

- `pointer` (string, optional)

### NotFoundErrorsItemsSource

- `pointer` (string, optional)

### ConflictErrorsItemsSource

- `pointer` (string, optional)

### UnprocessableContentErrorsItemsSource

- `pointer` (string, optional)

### TooManyRequestsErrorsItemsSource

- `pointer` (string, optional)

### SearchMatch

A match explaining why a result was returned

- NameMatch: NameMatch
- SourceFilenameMatch: SourceFilenameMatch
- ProjectMatch: ProjectMatch
- CreatorMatch: CreatorMatch
- AssigneeMatch: AssigneeMatch
- FormatMatch: FormatMatch
- KeywordsMatch: KeywordsMatch
- StatusMatch: StatusMatch
- VisualMatch: VisualMatch
- TranscriptionMatch: TranscriptionMatch
- CommentMatch: CommentMatch
- RatingMatch: RatingMatch
- CommentCountMatch: CommentCountMatch
- PageCountMatch: PageCountMatch
- DurationMatch: DurationMatch
- FilesizeMatch: FilesizeMatch
- AudioSampleRateMatch: AudioSampleRateMatch
- NotesMatch: NotesMatch
- UploadedAtMatch: UploadedAtMatch
- UpdatedAtMatch: UpdatedAtMatch
- DeletedAtMatch: DeletedAtMatch
- InsertedAtMatch: InsertedAtMatch
- FileTypeMatch: FileTypeMatch
- BitDepthMatch: BitDepthMatch
- BitRateMatch: BitRateMatch
- CodecMatch: CodecMatch
- ChannelsMatch: ChannelsMatch
- FrameRateMatch: FrameRateMatch
- HasAlphaChannelMatch: HasAlphaChannelMatch
- ColorSpaceMatch: ColorSpaceMatch
- ResolutionWidthMatch: ResolutionWidthMatch
- ResolutionHeightMatch: ResolutionHeightMatch
- DynamicRangeMatch: DynamicRangeMatch

### AssetSearchResultResult

The file, folder, or version stack matching the search query

- File: File
- Folder: Folder
- VersionStack: VersionStack

### ProjectWithDescription

Frame.io Project

- `created_at` (string, required) — Created Timestamp
- `id` (string, required) — Project ID
- `name` (string, required) — Project Name
- `root_folder_id` (string, required) — Root Folder ID
- `status` (enum, required) — Project Status
  - Allowed values: `active`, `inactive`
- `storage` (integer, required, default: 0) — Storage Usage
- `updated_at` (string, required) — Updated Timestamp
- `view_url` (string, required) — URL to view the project in the Frame.io web application
- `workspace_id` (string, required) — Workspace ID
- `description` (string, required, nullable) — Project Description
- `adobe_id` (string, optional, nullable) — Adobe cloud storage directory ID associated with the project, when available.
- `image` (string, optional, nullable) — URL of the project image (icon). Null when no image has been uploaded.
- `restricted` (boolean, optional) — Whether the project is restricted or not

### NameMatch

The result's name is a match for the search query

- `name` (string, required) — The name of the result
- `terms` (list of string, required) — The terms in the search query that matched the result's name
- `type` (enum, required)
  - Allowed values: `name_match`

### SourceFilenameMatch

The result's original file name is a match for the search query

- `source_filename` (string, required) — The original file name of the result
- `terms` (list of string, required) — The terms in the search query that matched the result's original file name
- `type` (enum, required)
  - Allowed values: `source_filename_match`

### ProjectMatch

The asset's project name is a match for the search query

- `project` (ProjectMatchInfo, required) — Project information for a project match
- `terms` (list of string, required) — The terms in the search query that matched the project name
- `type` (enum, required)
  - Allowed values: `project_match`

### CreatorMatch

The result's creator is a match for the search query

- `creator_id` (string, required) — The ID of the user who created the result
- `type` (enum, required)
  - Allowed values: `creator_match`

### AssigneeMatch

The result's assignee is a match for the search query

- `assignee_id` (string, required) — The ID of the user who the result is assigned to
- `type` (enum, required)
  - Allowed values: `assignee_match`

### FormatMatch

The result's format is a match for the search query

- `format` (string, required) — The format of the result
- `type` (enum, required)
  - Allowed values: `format_match`

### KeywordsMatch

The result's keywords are a match for the search query

- `keywords` (list of string, required) — The keywords of the result that are relevant to the search
- `type` (enum, required)
  - Allowed values: `keywords_match`

### StatusMatch

The result's status is a match for the search query

- `status` (string, required) — The status of the result
- `type` (enum, required)
  - Allowed values: `status_match`

### VisualMatch

The result's content vector embedding is a match for the search query

- `clips` (list of VisualMatchClip, required) — The list of subclips matching the query
- `type` (enum, required)
  - Allowed values: `visual_match`

### TranscriptionMatch

The result's transcription is a match for the search query

- `matches` (list of TranscriptionMatchSegment, required) — The transcriptions that match
- `type` (enum, required)
  - Allowed values: `transcription_match`

### CommentMatch

The result's comment is a match for the search query

- `comment_id` (string, required) — The ID of the comment that matched the query
- `snippet` (string, required) — The small portion of the comment that matched the search query
- `terms` (list of string, required) — The terms in the search query that matched the result's comment
- `type` (enum, required)
  - Allowed values: `comment_match`

### RatingMatch

The result's rating is a match for the search query

- `rating` (integer, required) — The rating of the result
- `type` (enum, required)
  - Allowed values: `rating_match`
- `color` (string, optional) — The color of the rating field
- `max_value` (integer, optional) — The maximum rating of the rating field for the result
- `style` (string, optional) — The style of the rating field

### CommentCountMatch

The result's comment count is a match for the search query

- `comment_count` (integer, required) — The comment count of the result
- `type` (enum, required)
  - Allowed values: `comment_count_match`

### PageCountMatch

The result's page count is a match for the search query

- `page_count` (integer, required) — The page count of the result
- `type` (enum, required)
  - Allowed values: `page_count_match`

### DurationMatch

The result's duration is a match for the search query

- `duration` (float, required) — The duration of the result in seconds
- `type` (enum, required)
  - Allowed values: `duration_match`

### FilesizeMatch

The result's file size is a match for the search query

- `filesize` (integer, required) — The file size of the result in bytes
- `type` (enum, required)
  - Allowed values: `filesize_match`

### AudioSampleRateMatch

The result's audio sample rate is a match for the search query

- `audio_sample_rate` (float, required) — The audio sample rate of the result in Hz
- `type` (enum, required)
  - Allowed values: `audio_sample_rate_match`

### NotesMatch

The result's notes is a match for the search query

- `notes` (string, required) — The notes of the result
- `type` (enum, required)
  - Allowed values: `notes_match`

### UploadedAtMatch

The result's uploaded at timestamp is a match for the search query

- `type` (enum, required)
  - Allowed values: `uploaded_at_match`
- `uploaded_at` (string, required) — The uploaded at timestamp of the result

### UpdatedAtMatch

The result's updated at timestamp is a match for the search query

- `type` (enum, required)
  - Allowed values: `updated_at_match`
- `updated_at` (string, required) — The updated at timestamp of the result

### DeletedAtMatch

The result's deleted at timestamp is a match for the search query

- `deleted_at` (string, required) — The deleted at timestamp of the result
- `type` (enum, required)
  - Allowed values: `deleted_at_match`

### InsertedAtMatch

The result's inserted at timestamp is a match for the search query

- `inserted_at` (string, required) — The inserted at timestamp of the result
- `type` (enum, required)
  - Allowed values: `inserted_at_match`

### FileTypeMatch

The result's file type is a match for the search query

- `file_type` (string, required) — The file type of the result
- `type` (enum, required)
  - Allowed values: `file_type_match`

### BitDepthMatch

The result's bit depth is a match for the search query

- `bit_depth` (float, required) — The bit depth of the result
- `type` (enum, required)
  - Allowed values: `bit_depth_match`

### BitRateMatch

The result's bit rate is a match for the search query

- `bit_rate` (float, required) — The bit rate of the result in bps
- `type` (enum, required)
  - Allowed values: `bit_rate_match`

### CodecMatch

The result's codec is a match for the search query

- `codec` (string, required) — The codec of the result
- `type` (enum, required)
  - Allowed values: `codec_match`

### ChannelsMatch

The result's channels is a match for the search query

- `channels` (float, required) — The number of audio channels of the result
- `type` (enum, required)
  - Allowed values: `channels_match`

### FrameRateMatch

The result's frame rate is a match for the search query

- `frame_rate` (float, required) — The frame rate of the result in fps
- `type` (enum, required)
  - Allowed values: `frame_rate_match`

### HasAlphaChannelMatch

The result's alpha channel presence is a match for the search query

- `has_alpha_channel` (boolean, required) — Whether the result has an alpha channel
- `type` (enum, required)
  - Allowed values: `has_alpha_channel_match`

### ColorSpaceMatch

The result's color space is a match for the search query

- `color_space` (string, required) — The color space of the result
- `type` (enum, required)
  - Allowed values: `color_space_match`

### ResolutionWidthMatch

The result's resolution width is a match for the search query

- `resolution_width` (float, required) — The resolution width of the result in pixels
- `type` (enum, required)
  - Allowed values: `resolution_width_match`

### ResolutionHeightMatch

The result's resolution height is a match for the search query

- `resolution_height` (float, required) — The resolution height of the result in pixels
- `type` (enum, required)
  - Allowed values: `resolution_height_match`

### DynamicRangeMatch

The result's dynamic range is a match for the search query

- `dynamic_range` (string, required) — The dynamic range of the result
- `type` (enum, required)
  - Allowed values: `dynamic_range_match`

### File

- `id` (string, required) — File, Folder, or Version Stack ID
- `name` (string, required) — File or folder Name
- `created_at` (string, required) — Creation timestamp
- `parent_id` (string, required, nullable) — Parent Folder or Version Stack ID
- `project_id` (string, required) — Project ID
- `type` (enum, required)
  - Allowed values: `file`, `folder`, `version_stack`
- `updated_at` (string, required) — Update timestamp
- `view_url` (string, required) — URL to view the asset in the Frame.io web application
- `file_size` (integer, required) — File size in bytes
- `media_type` (string, required, nullable) — File media type. Null until the file has finished uploading and its type is determined.
- `status` (enum, required)
  - Allowed values: `created`, `transcoded`, `uploaded`
- `adobe_id` (string, optional, nullable) — Adobe cloud storage asset identifier, when available.
- `adobe_version_id` (string, optional, nullable) — Version identifier of the Adobe cloud storage asset associated with this file, when available. A version identifier is a string that often resembles an integer but should be treated as an opaque string.

### Folder

- `created_at` (string, required) — Creation timestamp
- `id` (string, required) — File, Folder, or Version Stack ID
- `name` (string, required) — File or folder Name
- `parent_id` (string, required, nullable) — Parent Folder or Version Stack ID
- `project_id` (string, required) — Project ID
- `type` (enum, required)
  - Allowed values: `file`, `folder`, `version_stack`
- `updated_at` (string, required) — Update timestamp
- `view_url` (string, required) — URL to view the asset in the Frame.io web application
- `cover_file_id` (string, required, nullable) — Cover asset ID
- `restricted` (boolean, required) — Folder is restricted or not
- `adobe_id` (string, optional, nullable) — Adobe cloud storage asset identifier, when available.

### VersionStack

- `head_version` (File, required)
- `id` (string, required) — File, Folder, or Version Stack ID
- `name` (string, required) — File or folder Name
- `parent_id` (string, required, nullable) — Parent Folder or Version Stack ID
- `created_at` (string, required) — Creation timestamp
- `project_id` (string, required) — Project ID
- `type` (enum, required)
  - Allowed values: `file`, `folder`, `version_stack`
- `updated_at` (string, required) — Update timestamp
- `view_url` (string, required) — URL to view the asset in the Frame.io web application
- `adobe_id` (string, optional, nullable) — Adobe cloud storage asset identifier, when available.

### ProjectMatchInfo

Project information for a project match

- `id` (string, required) — The project ID
- `name` (string, required) — The project name

### VisualMatchClip

A subclip within a video that is a match for the search query

- `best_frame_time` (integer, required) — Best matching frame time in milliseconds
- `end_time` (integer, required) — End time in milliseconds
- `index` (integer, required) — Chronological index of this clip
- `relevancy_index` (integer, required) — Index ordered by relevancy score
- `start_time` (integer, required) — Start time in milliseconds

### TranscriptionMatchSegment

A transcription segment that is a match for the search query

- `id` (string, required) — Transcription segment ID
- `snippets` (list of string, required) — The small portion of the transcription that is a match for the search query
- `terms` (list of string, required) — The terms in the search query that are a match for the result's transcription

## Examples

**Request**

```json
{
  "engine": "nlp",
  "query": "red car driving on highway",
  "filters": {
    "files_and_version_stacks": true,
    "folders": false,
    "projects": false
  }
}
```

**Response**

```json
{
  "data": [
    {
      "matches": [
        {
          "name": "red_car.png",
          "terms": [
            "red",
            "car"
          ],
          "type": "name_match"
        }
      ],
      "result": {
        "adobe_id": "urn:aaid:sc:US:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "adobe_version_id": "2",
        "created_at": "2023-09-25T19:18:29.614189Z",
        "file_size": 1137444,
        "id": "21373c77-c690-4a77-9a1f-e859d67d6b4e",
        "media_type": "image/png",
        "name": "asset.png",
        "parent_id": "82a29dd4-1068-44a8-8448-aafe0ddb58a8",
        "project_id": "d826c6f8-50a6-44d3-a1af-5e9d4baaa8d6",
        "status": "created",
        "type": "file",
        "updated_at": "2024-02-07T16:44:41.986478Z",
        "view_url": "https://next.frame.io/project/d5e6011c-2bc9-4596-be05-77d562627112/view/5a89a9fb-0900-4b23-826b-127b90e4db4c"
      },
      "type": "file_result"
    }
  ],
  "links": {
    "next": "/v4/accounts/1234/search?after=abc123"
  },
  "total_count": 15
}
```

**SDK Code**

```python
import requests

url = "https://api.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search"

querystring = {"after":"<opaque_cursor>","include_total_count":"false","page_size":"10"}

payload = {
    "engine": "nlp",
    "query": "red car driving on highway",
    "filters": {
        "files_and_version_stacks": True,
        "folders": False,
        "projects": False
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"engine":"nlp","query":"red car driving on highway","filters":{"files_and_version_stacks":true,"folders":false,"projects":false}}'
};

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.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10"

	payload := strings.NewReader("{\n  \"engine\": \"nlp\",\n  \"query\": \"red car driving on highway\",\n  \"filters\": {\n    \"files_and_version_stacks\": true,\n    \"folders\": false,\n    \"projects\": false\n  }\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.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10")

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  \"engine\": \"nlp\",\n  \"query\": \"red car driving on highway\",\n  \"filters\": {\n    \"files_and_version_stacks\": true,\n    \"folders\": false,\n    \"projects\": false\n  }\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.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"engine\": \"nlp\",\n  \"query\": \"red car driving on highway\",\n  \"filters\": {\n    \"files_and_version_stacks\": true,\n    \"folders\": false,\n    \"projects\": false\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10', [
  'body' => '{
  "engine": "nlp",
  "query": "red car driving on highway",
  "filters": {
    "files_and_version_stacks": true,
    "folders": false,
    "projects": false
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"engine\": \"nlp\",\n  \"query\": \"red car driving on highway\",\n  \"filters\": {\n    \"files_and_version_stacks\": true,\n    \"folders\": false,\n    \"projects\": false\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "engine": "nlp",
  "query": "red car driving on highway",
  "filters": [
    "files_and_version_stacks": true,
    "folders": false,
    "projects": false
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/40b9fb79-54de-426a-846d-0132cf506f2a/search?after=%3Copaque_cursor%3E&include_total_count=false&page_size=10")! 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()
```