# Fetch EOR Contract form

GET https://api.letsdeel.com/rest/v2/forms/eor/create-contract/{country_code}

Returns a formulary for creating EOR Contracts
 **Token scopes**: `forms:read`

Reference: https://developer.deel.com/api/eor-endpoints/eor-hiring/get-create-contract-form

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /forms/eor/create-contract/{country_code}:
    get:
      operationId: get-create-contract-form
      summary: Fetch EOR Contract form
      description: |-
        Returns a formulary for creating EOR Contracts
         **Token scopes**: `forms:read`
      tags:
        - subpackage_eorHiring
      parameters:
        - name: country_code
          in: path
          description: Two-letter country code in ISO 3166-1 alpha-2 format
          required: true
          schema:
            type: string
        - name: state
          in: query
          description: >-
            The selected state code of the contract. This is only required for
            countries that specify it.
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          description: >-
            The selected start date of the contract in ISO 8601 formatted date
            string.
          required: false
          schema:
            type: string
        - name: work_hours_per_week
          in: query
          description: The selected number of work hours per week.
          required: false
          schema:
            type: integer
        - name: contract_duration_in_days
          in: query
          description: The contract duration in days for definite contracts.
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          description: >
            ## 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)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing form configuration data.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/eor-hiring_getCreateContractForm_Response_200
        '400':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/FetchEorContractFormRequestBadRequestError
        '401':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '403':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '404':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '500':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsType:
      type: string
      enum:
        - FreeText
        - Paragraph
        - SingleSelection
        - MultiSelection
        - Address
        - PhoneNumber
        - DocumentUpload
        - Number
        - Dropdown
        - DatePicker
        - Email
        - CustomDropdown
        - PresetDropdown
        - Nested
      description: Type of the question.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsType
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsSource:
      type: object
      properties:
        url:
          type: string
          description: API endpoint providing dynamic options.
        definition:
          type: string
          description: Reference URL for API documentation.
        description:
          type: string
          description: Description of the data source.
      description: Defines dynamic data source for the question.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsSource
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsOptionsItems:
      type: object
      properties:
        title:
          type: string
          description: Display text for the option.
        value:
          type:
            - string
            - 'null'
          description: Value associated with the option.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsOptionsItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItemsValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      description: Expected value for the condition.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItemsValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItems:
      type: object
      properties:
        key:
          type: string
          description: Key of the dependent field.
        value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItemsValue
          description: Expected value for the condition.
        operator:
          type:
            - string
            - 'null'
          description: Comparison operator (e.g., 'eq', 'ne').
        compare_key:
          type:
            - string
            - 'null'
          description: Key of the field to compare against.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMaxValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: Maximum value allowed.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMaxValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMinValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: Minimum value allowed.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMinValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsDefaultValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      description: Default value to pre-fill in the form.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsDefaultValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItems:
      type: object
      properties:
        title:
          type: string
          description: Title of the question.
        source:
          oneOf:
            - $ref: >-
                #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsSource
            - type: 'null'
          description: Defines dynamic data source for the question.
        options:
          type:
            - array
            - 'null'
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsOptionsItems
          description: >-
            List of selectable options for selection-type questions. Value may
            be of any type.
        is_range:
          type: boolean
          description: Specifies whether a date picker allows range selection.
        requires:
          type: array
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsRequiresItems
          description: List of conditions that must be met for this rule to apply.
        max_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMaxValue
          description: Maximum value allowed.
        min_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsMinValue
          description: Minimum value allowed.
        max_length:
          type:
            - integer
            - 'null'
          description: Maximum character length for text responses.
        min_length:
          type:
            - integer
            - 'null'
          description: Minimum character length for text responses.
        helper_text:
          type:
            - string
            - 'null'
          description: Additional information to assist the user.
        is_disabled:
          type: boolean
          description: If true, the field is disabled and cannot be edited.
        is_required:
          type: boolean
          description: Indicates if the question is required.
        number_type:
          type: string
          description: Used for number fields to define the unit or representation.
        default_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItemsDefaultValue
          description: Default value to pre-fill in the form.
        is_only_digits:
          type: boolean
          description: Restricts input to numeric characters only, for FreeText questions.
        date_limitation:
          type:
            - string
            - 'null'
          description: >-
            Limits date selection (e.g., blocking past dates). Will always be
            'BLOCK_PAST' for now.
        is_multiple_selection:
          type: boolean
          description: Indicates if the user can select multiple values.
        must_request_validation:
          type: boolean
          description: Whether additional validation should be triggered for this field.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsSource:
      type: object
      properties:
        url:
          type: string
          description: API endpoint providing dynamic options.
        definition:
          type: string
          description: Reference URL for API documentation.
        description:
          type: string
          description: Description of the data source.
      description: Defines dynamic data source for the question.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsSource
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsOptionsItems:
      type: object
      properties:
        title:
          type: string
          description: Display text for the option.
        value:
          type:
            - string
            - 'null'
          description: Value associated with the option.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsOptionsItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMaxValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: Maximum value allowed.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMaxValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMinValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: Minimum value allowed.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMinValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsDefaultValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      description: Default value to pre-fill in the form.
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsDefaultValue
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItems:
      type: object
      properties:
        key:
          type: string
          description: Unique key identifier for the question.
        type:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsType
          description: Type of the question.
        rules:
          type:
            - array
            - 'null'
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsRulesItems
          description: Validation rules for the question.
        title:
          type: string
          description: Title of the question.
        source:
          oneOf:
            - $ref: >-
                #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsSource
            - type: 'null'
          description: Defines dynamic data source for the question.
        options:
          type:
            - array
            - 'null'
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsOptionsItems
          description: >-
            List of selectable options for selection-type questions. Value may
            be of any type.
        is_range:
          type: boolean
          description: Specifies whether a date picker allows range selection.
        max_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMaxValue
          description: Maximum value allowed.
        min_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsMinValue
          description: Minimum value allowed.
        max_length:
          type:
            - integer
            - 'null'
          description: Maximum character length for text responses.
        min_length:
          type:
            - integer
            - 'null'
          description: Minimum character length for text responses.
        helper_text:
          type:
            - string
            - 'null'
          description: Additional information to assist the user.
        is_disabled:
          type: boolean
          description: If true, the field is disabled and cannot be edited.
        is_required:
          type: boolean
          description: Indicates if the question is required.
        number_type:
          type: string
          description: Used for number fields to define the unit or representation.
        default_value:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItemsDefaultValue
          description: Default value to pre-fill in the form.
        is_only_digits:
          type: boolean
          description: Restricts input to numeric characters only, for FreeText questions.
        date_limitation:
          type:
            - string
            - 'null'
          description: >-
            Limits date selection (e.g., blocking past dates). Will always be
            'BLOCK_PAST' for now.
        is_multiple_selection:
          type: boolean
          description: Indicates if the user can select multiple values.
        must_request_validation:
          type: boolean
          description: Whether additional validation should be triggered for this field.
      required:
        - key
        - type
        - title
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItems:
      type: object
      properties:
        title:
          type: string
          description: Title of the section.
        subtitle:
          type: string
          description: Additional information shown at the top of the section.
        questions:
          type: array
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItemsQuestionsItems
          description: List of questions within the section.
      required:
        - title
        - questions
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItems:
      type: object
      properties:
        title:
          type: string
          description: Title of the form page.
        sections:
          type: array
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItemsSectionsItems
          description: Sections within the page.
      required:
        - title
        - sections
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        pages:
          type: array
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaDataPagesItems
          description: List of pages in the form.
      required:
        - pages
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaData
    eor-hiring_getCreateContractForm_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaData
      required:
        - data
      title: eor-hiring_getCreateContractForm_Response_200
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        path:
          type: string
          description: The JSON path where input validation failed
        message:
          type: string
          description: A description of the returned error
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaErrorsItems
    FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaRequest:
      type: object
      properties:
        url:
          type: string
          description: The relative URL of the failed request
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        method:
          type: string
          description: The HTTP method of the failed request
        source:
          type: string
          description: The source handler which produced the returned error
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
      title: >-
        FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaRequest
    FetchEorContractFormRequestBadRequestError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaErrorsItems
        request:
          $ref: >-
            #/components/schemas/FormsEorCreateContractCountryCodeGetResponsesContentApplicationJsonSchemaRequest
      title: FetchEorContractFormRequestBadRequestError
    ApiErrorRequest:
      type: object
      properties:
        method:
          type: string
          description: The HTTP method of the failed request
        url:
          type: string
          description: The relative URL of the failed request
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        source:
          type: string
          description: The source handler which produced the returned error
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
      title: ApiErrorRequest
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: A description of the returned error
        path:
          type: string
          description: The JSON path where input validation failed
      title: ApiError
    ApiErrorContainer:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/ApiErrorRequest'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      title: ApiErrorContainer
  securitySchemes:
    deelToken:
      type: http
      scheme: bearer
      description: >
        ## 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)
    oauth2:
      type: http
      scheme: bearer
      description: >-
        Standard OAuth2 security scheme based on
        https://swagger.io/docs/specification/authentication/

```

## SDK Code Examples

```python
import requests

url = "https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR"

querystring = {"state":"SP","start_date":"2025-09-03","work_hours_per_week":"40","contract_duration_in_days":"360"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/forms/eor/create-contract/BR?state=SP&start_date=2025-09-03&work_hours_per_week=40&contract_duration_in_days=360")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```