> This page is for API, version 2026-01-01 (Stable) (default).
> For other versions, use one of these documentation indexes:
> - 2026-01-01 (Stable) (default): https://developer.deel.com/api/stable/llms.txt

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

# Validate time-off request

POST https://api.letsdeel.com/rest/time_offs/validate
Content-Type: application/json

Validates a time-off request against policy compliance, available balance, blackout dates, and other rules before the request is created. Call this ahead of submitting the actual time-off request to catch validation errors early and avoid a failed creation attempt.

 **Token scopes**: `time-off:read`

Reference: https://developer.deel.com/api/reference/endpoints/time-off/validate-time-off

## Authentication

- `Authorization` header (bearer token, required) — ## Authentication The Deel API uses bearer tokens to authenticate requests. All API calls must be made over HTTPS — calls over plain HTTP or without authentication will fail. ```curl curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \ -H 'Authorization: Bearer YOUR-TOKEN-HERE' ``` [Learn more about authentication](/api/authentication)
- `Authorization` header (bearer token, required) — Standard OAuth2 security scheme based on https://swagger.io/docs/specification/authentication/

## Servers

- `https://api.letsdeel.com/rest` (Production, default)
- `https://api-staging.letsdeel.com/rest` (Demo)

## Request

### Body (application/json)

This endpoint expects an object.

- `data` (TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaData, optional) — Time off request data

## Response

### 200

Time off request validation result

- `data` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaData, required) — Time off request validation result

## Errors

### 400 Bad Request Error

Operation failed.

- `errors` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaErrorsItems, optional)
- `request` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaRequest, optional)

### 401 Unauthorized Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

### 403 Forbidden Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

### 404 Not Found Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

### 500 Internal Server Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

## Types

### TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaData

Time off request data

- `end_date` (string, required) — The end date of the time off request.
- `start_date` (string, required) — The start date of the time off request.
- `recipient_profile_id` (string, required) — The hris profile id of the recipient
- `id` (string, optional) — The time off id. Required when validating a time off update request
- `dates` (list of TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataDatesItems, optional) — The dates breakdown for the time off request.
- `is_paid` (boolean, optional) — Indicates if the time off request is paid or not. By default it follows the policy configuration.
- `policy_id` (string, optional) — The time off policy id. Can be used in place of time_off_type_id
- `description` (string, optional, nullable) — The description of the time off request
- `event_details` (TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataEventDetails, optional) — Event details regarding the leave. Required for event based policies such as parental leave.
- `deduction_amount` (float, optional) — The amount to be deducted from the time off balance. Only valid for policies used by independent contractors
- `time_off_type_id` (string, optional) — The time off type id. Required when policy_id is not provided
- `time_off_event_id` (string, optional) — The time off event id that this request is associated with. Only present for event-based policies such as parental leave.
- `custom_field_values` (list of TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataCustomFieldValuesItems, optional, nullable) — Answers to the custom fields the request policy declares, addressed by custom field id.
- `time_off_percentage` (float, optional, nullable) — The percentage of time off requested. For example, if the request is for a full day, the percentage will be 1. If it's for half a day, the percentage will be 0.5.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaData

Time off request validation result

- `is_valid` (boolean, required) — Indicates if the time off request is valid or not. When false, the response will contain an error message.
- `dates` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataDatesItems, optional) — The dates breakdown for the time off request.
- `amount` (float, optional) — The amount of time off requested.
- `new_end_date` (string, optional) — The new end date for the time off request. It could be different from the original end date depending on the policy configuration. For example, for forfait-jour policies
- `custom_fields` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItems, optional) — The custom fields the request policy declares. Omitted when the policy declares none.
- `is_event_based` (boolean, optional) — Indicates if the time off request is event-based, such as parental leave
- `new_start_date` (string, optional) — The new start date for the time off request. It could be different from the original start date depending on the policy configuration. For example, for forfait-jour policies
- `remaining_balance` (float, optional) — The remaining policy balance for the tracking period
- `require_attachment` (boolean, optional) — Indicates if an attachment is required for the time off request
- `require_description` (boolean, optional) — Indicates if a description is required for the time off request
- `event_details_fields` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFields, optional) — Fields required for specific time off requests, such as parental leave.
- `max_time_off_percentage` (float, optional) — The maximum time off percentage allowed for the request
- `validation_error_message` (string, optional) — Error message when the time off request is invalid
- `amount_next_tracking_period` (float, optional) — The amount of time off requested to be applicable in the next tracking period.
- `custom_field_validation_results` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldValidationResultsItems, optional) — Every rejected custom field answer. Omitted when all answers are valid.
- `country_specific_validation_results` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItems, optional) — Results of country-specific validation rules
- `remaining_balance_next_tracking_period` (float, optional) — The remaining policy balance for the next tracking period
- `country_specific_validation_results_next_tracking_period` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItems, optional) — Results of country-specific validation rules

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaErrorsItems

- `path` (string, optional) — The JSON path where input validation failed
- `message` (string, optional) — A description of the returned error

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaRequest

- `url` (string, optional) — The relative URL of the failed request
- `code` (double, optional) — The code of the source handler which produced the returned error
- `docs` (string, optional) — A link to the official documentation for the requested endpoint resource
- `method` (string, optional) — The HTTP method of the failed request
- `source` (string, optional) — The source handler which produced the returned error
- `status` (double, optional) — The status code of the response
- `api_req_id` (string, optional) — The request ID of the failed request

### ApiErrorRequest

- `method` (string, optional) — The HTTP method of the failed request
- `url` (string, optional) — The relative URL of the failed request
- `status` (double, optional) — The status code of the response
- `api_req_id` (string, optional) — The request ID of the failed request
- `docs` (string, optional) — A link to the official documentation for the requested endpoint resource
- `source` (string, optional) — The source handler which produced the returned error
- `code` (double, optional) — The code of the source handler which produced the returned error

### ApiError

- `message` (string, optional) — A description of the returned error
- `path` (string, optional) — The JSON path where input validation failed

### TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataDatesItems

The dates breakdown for the time off request.

- `date` (string, required) — An specific date in the time-off request
- `hours` (float, optional) — The amount taken in hours during this specific date. It can not exceed the maximum allowed hours for the date.
- `amount` (float, optional) — The amount of time off requested for the date. It must be in the same time unit as in the total amount for the time off request.
- `day_type` (enum, optional) — The type of day for the time off request. All dates must follow the same type.
  - Allowed values: `HALF_DAY`, `FULL_DAY`, `PERCENTAGE`, `HOURLY`

### TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataEventDetails

Event details regarding the leave. Required for event based policies such as parental leave.

- `birth_date` (string, optional) — The birth-date of the child. Required for parental leave requests.
- `adoption_date` (string, optional) — The adoption-date of the child. Required depending on the type of the leave requests.
- `was_premature_birth` (boolean, optional) — Indicates if the child was born prematurely. Required for parental leave requests.
- `had_multiple_children` (boolean, optional) — Indicates if the request is for multiple children. Required for parental leave requests.

### TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataCustomFieldValuesItems

- `value` (TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataCustomFieldValuesItemsValue, required, nullable) — The submitted value for the custom field. Accepts a string, number, or boolean — always stored as text. `null` means "no answer for this field" and is rejected today, since no field supports a null answer yet.
- `field_id` (string, required) — The id of the custom field this value answers.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataDatesItems

- `date` (string, required) — An specific date in the time-off request
- `type` (enum, required) — The type of day for the time off request. All dates must follow the same type.
  - Allowed values: `WORKING_DAY`, `NON_WORKING_DAY`, `HOLIDAY`, `FORFAIT_HOUR_DAY`
- `hours` (list of float, optional) — The maximum allowed number of hours that can be take in this specific date. For example, if there is another leave taking 3 hours in the same date, the maximum allowed hours will be 5 (assuming a work schedule of 8 hours).
- `amount` (float, optional) — The amount of time off requested for the date. It uses the same time unit as in the total amount for the time off request.
- `day_types` (list of enum, optional) — The types of leave available for the date. Either FULL_DAY or HALF_DAY.
  - Allowed values: `FULL_DAY`, `HALF_DAY`, `PERCENTAGE`, `HOURLY`
- `holiday_name` (string, optional) — The name of the holiday for the date. Only applicable for holidays. Only present when date type is HOLIDAY.
- `time_off_percentage` (float, optional) — The percentage of time off requested for the date. For example, if the request is for a full day, the percentage will be 1. If it's for half a day, the percentage will be 0.5.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItems

- `id` (string, required) — The custom field id.
- `key` (string, required) — Machine key, unique within the policy.
- `name` (string, required) — Human-facing field name shown on the request form.
- `schema` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItemsSchema, required) — The value type plus shape/constraints of the field.
- `field_requirement` (enum, required) — Whether an answer is mandatory, and under which conditions.
  - Allowed values: `ALWAYS_REQUIRED`, `REQUIRED_CONDITIONALLY`, `OPTIONAL`
- `requirement_conditions` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItemsRequirementConditionsItems, optional, nullable) — Present only for a REQUIRED_CONDITIONALLY field: the conditions under which it becomes required.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFields

Fields required for specific time off requests, such as parental leave.

- `birth_date` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsBirthDate, optional) — The birth-date of the child. Required for parental leave requests.
- `adoption_date` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsAdoptionDate, optional) — The adoption-date of the child. Might be required depending on the type if leave requests.
- `was_premature_birth` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsWasPrematureBirth, optional) — Indicates if the child was born prematurely. Required for parental leave requests.
- `had_multiple_children` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsHadMultipleChildren, optional) — Indicates if the request is for multiple children. Required for parental leave requests.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldValidationResultsItems

- `reason` (string, required) — Why the answer was rejected.
- `message` (string, required) — Human-readable description of the rejection.
- `key` (string, optional) — Machine key of the rejected field, when it resolved.
- `field_id` (string, optional) — The id of the rejected custom field. Absent for payload-level errors.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItems

Result of a specific country validation rule

- `validation_type` (string, required) — The type of validation rule being applied
- `data` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItemsData, optional)
- `is_valid` (boolean, optional) — Indicates if this specific validation passed
- `description` (string, optional) — A human-readable description of the validation result

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItems

Result of a specific country validation rule

- `validation_type` (string, required) — The type of validation rule being applied
- `data` (TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItemsData, optional)
- `is_valid` (boolean, optional) — Indicates if this specific validation passed
- `description` (string, optional) — A human-readable description of the validation result

### TimeOffsValidatePostRequestBodyContentApplicationJsonSchemaDataCustomFieldValuesItemsValue

The submitted value for the custom field. Accepts a string, number, or boolean — always stored as text. `null` means "no answer for this field" and is rejected today, since no field supports a null answer yet.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItemsSchema

The value type plus shape/constraints of the field.

- `type` (enum, required) — The value type of the field.
  - Allowed values: `string`, `number`, `boolean`, `date`, `datetime`
- `is_nullable` (boolean, required) — Whether the field accepts a null answer. Always `false` today — nullable custom fields are not supported yet, but the flag is present from the start so support can be added later without a breaking change.
- `enum` (list of string, optional) — Allowed values, when the field is a closed list.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCustomFieldsItemsRequirementConditionsItems

- `operator` (enum, required) — How the left field's answer is compared against the right side.
  - Allowed values: `IS`, `IS_NOT`, `IS_ANY_OF`, `IS_AT_LEAST`, `IS_AT_MOST`, `IS_LESS_THAN`, `IS_MORE_THAN`
- `static_items` (list of string, optional, nullable) — Literal list to compare against, for IS_ANY_OF.
- `static_value` (string, optional, nullable) — Literal value to compare against, for a single-value operator (IS, IS_NOT, IS_AT_LEAST, IS_AT_MOST, IS_LESS_THAN, IS_MORE_THAN).
- `left_field_key` (string, optional) — Machine key of the field whose answer is being compared.
- `right_field_key` (string, optional) — Machine key of another field to compare against, when the right side is itself an answer rather than a static value.

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsBirthDate

The birth-date of the child. Required for parental leave requests.

- `type` (enum, required) — The type of the field, indicating it is a date-only field
  - Allowed values: `date-only`
- `required` (boolean, required) — Indicates if the field is required

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsAdoptionDate

The adoption-date of the child. Might be required depending on the type if leave requests.

- `type` (enum, required) — The type of the field, indicating it is a date-only field
  - Allowed values: `date-only`
- `required` (boolean, required) — Indicates if the field is required

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsWasPrematureBirth

Indicates if the child was born prematurely. Required for parental leave requests.

- `type` (enum, required) — The type of the field, indicating it is a boolean field
  - Allowed values: `boolean`
- `required` (boolean, required) — Indicates if the field is required

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataEventDetailsFieldsHadMultipleChildren

Indicates if the request is for multiple children. Required for parental leave requests.

- `type` (enum, required) — The type of the field, indicating it is a boolean field
  - Allowed values: `boolean`
- `required` (boolean, required) — Indicates if the field is required

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItemsData

- `ranges` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItemsDataRangesItems, optional) — Date ranges that were validated
- `max_requests` (double, optional) — Maximum number of requests allowed by this validation rule
- `remaining_balance` (double, optional) — Remaining balance at the time of applying this rule

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItemsData

- `ranges` (list of TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItemsDataRangesItems, optional) — Date ranges that were validated
- `max_requests` (double, optional) — Maximum number of requests allowed by this validation rule
- `remaining_balance` (double, optional) — Remaining balance at the time of applying this rule

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsItemsDataRangesItems

- `start_day` (double, required) — The start day in the range
- `end_day` (double, optional) — The end day in the range

### TimeOffsValidatePostResponsesContentApplicationJsonSchemaDataCountrySpecificValidationResultsNextTrackingPeriodItemsDataRangesItems

- `start_day` (double, required) — The start day in the range
- `end_day` (double, optional) — The end day in the range

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "is_valid": true,
    "dates": [
      {
        "date": "2025-05-13",
        "type": "WORKING_DAY",
        "hours": [
          4,
          8
        ],
        "amount": 8,
        "time_off_percentage": 1
      },
      {
        "date": "2025-05-14",
        "type": "WORKING_DAY",
        "hours": [
          4,
          8
        ],
        "amount": 8,
        "time_off_percentage": 1
      },
      {
        "date": "2025-05-15",
        "type": "WORKING_DAY",
        "hours": [
          4,
          8
        ],
        "amount": 8,
        "time_off_percentage": 1
      }
    ],
    "amount": 1.5,
    "new_end_date": "2025-05-15",
    "custom_fields": [
      {
        "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "key": "reason",
        "name": "Reason",
        "schema": {
          "type": "string",
          "is_nullable": false,
          "enum": [
            "Family emergency",
            "Medical"
          ]
        },
        "field_requirement": "ALWAYS_REQUIRED",
        "requirement_conditions": [
          {
            "operator": "IS",
            "static_items": [
              "Engineering",
              "Product"
            ],
            "static_value": "Engineering",
            "left_field_key": "department",
            "right_field_key": "team"
          }
        ]
      }
    ],
    "is_event_based": false,
    "new_start_date": "2025-05-13",
    "remaining_balance": 10,
    "require_attachment": false,
    "require_description": false,
    "event_details_fields": {
      "birth_date": {
        "type": "date-only",
        "required": true
      },
      "adoption_date": {
        "type": "date-only",
        "required": false
      },
      "was_premature_birth": {
        "type": "boolean",
        "required": true
      },
      "had_multiple_children": {
        "type": "boolean",
        "required": true
      }
    },
    "max_time_off_percentage": 0.5,
    "validation_error_message": "Time off request is invalid. Please check the dates and time off type.",
    "amount_next_tracking_period": 1.5,
    "custom_field_validation_results": [
      {
        "reason": "REQUIRED",
        "message": "This field is required.",
        "key": "reason",
        "field_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
      }
    ],
    "country_specific_validation_results": [
      {
        "validation_type": "BRAZIL_MAX_REQUESTS",
        "data": {
          "ranges": [
            {
              "start_day": 1,
              "end_day": 3
            }
          ],
          "max_requests": 3
        },
        "is_valid": true,
        "description": "This policy doesn’t allow more than 3 requests to be submitted in a single period"
      }
    ],
    "remaining_balance_next_tracking_period": 10,
    "country_specific_validation_results_next_tracking_period": [
      {
        "validation_type": "BRAZIL_MAX_REQUESTS",
        "data": {
          "ranges": [
            {
              "start_day": 1,
              "end_day": 3
            }
          ],
          "max_requests": 3
        },
        "is_valid": true,
        "description": "This policy doesn’t allow more than 3 requests to be submitted in a single period"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.letsdeel.com/rest/time_offs/validate"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/time_offs/validate';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.letsdeel.com/rest/time_offs/validate"

	payload := strings.NewReader("{}")

	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.letsdeel.com/rest/time_offs/validate")

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 = "{}"

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.letsdeel.com/rest/time_offs/validate")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/time_offs/validate', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/time_offs/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/time_offs/validate")! 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()
```