# Create a direct employee

POST https://api.letsdeel.com/rest/v2/people
Content-Type: application/json

Create employee hired under your own entity to Deel's HRIS. Manage your employee through Deel and export a payroll report to your own providers.
 **Token scopes**: `people:write`

Reference: https://developer.deel.com/api/reference/endpoints/people/create-a-direct-employee

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /people:
    post:
      operationId: create-a-direct-employee
      summary: Create a direct employee
      description: >-
        Create employee hired under your own entity to Deel's HRIS. Manage your
        employee through Deel and export a payroll report to your own providers.
         **Token scopes**: `people:write`
      tags:
        - subpackage_people
      parameters:
        - 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:
        '201':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/People_createADirectEmployee_Response_201'
        '400':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateADirectEmployeeRequestBadRequestError
        '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/CreateADirectEmployeeRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  $ref: >-
                    #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaData
              required:
                - data
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    PeoplePostRequestBodyContentApplicationJsonSchemaDataClientTeam:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The team that the employee is part of
        direct_manager_id:
          type: string
          format: uuid
          description: The direct manager of the employee
      required:
        - id
      description: The team information for the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataClientTeam
    PeoplePostRequestBodyContentApplicationJsonSchemaDataClientDepartment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The department that the employee is part of
      required:
        - id
      description: The department information for the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataClientDepartment
    PeoplePostRequestBodyContentApplicationJsonSchemaDataClientLegalEntity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The legal entity that the employee is part of
      required:
        - id
      description: The legal entity information for the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataClientLegalEntity
    PeoplePostRequestBodyContentApplicationJsonSchemaDataClient:
      type: object
      properties:
        team:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataClientTeam
          description: The team information for the employee
        department:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataClientDepartment
          description: The department information for the employee
        legal_entity:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataClientLegalEntity
          description: The legal entity information for the employee
      required:
        - team
        - legal_entity
      description: The entity that is hiring the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataClient
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployee:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The personal email of the person being hired
        state:
          type: string
          description: The state of the person being hired
        country:
          type: string
          description: The country of the person being hired
        last_name:
          type: string
          description: The last name of the person being hired
        first_name:
          type: string
          description: The first name of the person being hired
        work_email:
          type: string
          format: email
          description: The work email of the person being hired
        external_id:
          type: string
          description: An external identifier for the person being hired
        nationality:
          type: string
          description: The nationality of the person being hired
      required:
        - email
        - country
        - last_name
        - first_name
        - nationality
      description: The person that is being hired
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployee
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf0Type:
      type: string
      enum:
        - PART_TIME
      description: The type of employment
      title: >-
        PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf0Type
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment0:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf0Type
          description: The type of employment
        end_date:
          type: string
          format: date
          description: The end date of the employment
        job_title:
          type: string
          description: The job title of the employment
        seniority:
          type: string
          description: The seniority of the employment
        start_date:
          type: string
          format: date
          description: The start date of the employment
        document_template_id:
          type: string
          format: uuid
          description: The document template ID for the employment contract
        part_time_percentage:
          type: number
          format: double
          description: The percentage of PART_TIME employment
      required:
        - type
        - job_title
        - seniority
        - start_date
        - part_time_percentage
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment0
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf1Type:
      type: string
      enum:
        - FULL_TIME
      description: The type of employment
      title: >-
        PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf1Type
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment1:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmploymentOneOf1Type
          description: The type of employment
        end_date:
          type: string
          format: date
          description: The end date of the employment
        job_title:
          type: string
          description: The job title of the employment
        seniority:
          type: string
          description: The seniority of the employment
        start_date:
          type: string
          format: date
          description: The start date of the employment
        document_template_id:
          type: string
          format: uuid
          description: The document template ID for the employment contract
      required:
        - type
        - job_title
        - seniority
        - start_date
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment1
    PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment:
      oneOf:
        - $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment0
        - $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment1
      description: The employment details of the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment
    PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetailsScale:
      type: string
      enum:
        - ANNUAL
        - MONTHLY
        - SEMIMONTHLY
        - BIWEEKLY
        - WEEKLY
        - DAILY
        - HOURLY
      default: ANNUAL
      description: The scale at which the salary is paid
      title: >-
        PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetailsScale
    PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetails:
      type: object
      properties:
        scale:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetailsScale
          description: The scale at which the salary is paid
        salary:
          type: number
          format: double
          description: The salary of the employee
        currency:
          type: string
          description: The currency of the salary
      required:
        - salary
        - currency
      description: The compensation details of the employee
      title: PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetails
    PeoplePostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        client:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataClient
          description: The entity that is hiring the employee
        employee:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployee
          description: The person that is being hired
        employment:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataEmployment
          description: The employment details of the employee
        compensation_details:
          $ref: >-
            #/components/schemas/PeoplePostRequestBodyContentApplicationJsonSchemaDataCompensationDetails
          description: The compensation details of the employee
      required:
        - client
        - employee
        - employment
        - compensation_details
      title: PeoplePostRequestBodyContentApplicationJsonSchemaData
    PeoplePostResponsesContentApplicationJsonSchemaDataEmployee:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The personal email of the person being hired
        last_name:
          type: string
          description: The last name of the person being hired
        first_name:
          type: string
          description: The first name of the person being hired
        work_email:
          type: string
          format: email
          description: The work email of the person being hired
        external_id:
          type: string
          description: An external identifier for the person being hired
        nationality:
          type: string
          description: The nationality of the person being hired
      required:
        - email
        - last_name
        - first_name
        - nationality
      description: The person that is being hired
      title: PeoplePostResponsesContentApplicationJsonSchemaDataEmployee
    PeoplePostResponsesContentApplicationJsonSchemaDataEmploymentType:
      type: string
      enum:
        - FULL_TIME
        - PART_TIME
      description: The type of employment
      title: PeoplePostResponsesContentApplicationJsonSchemaDataEmploymentType
    PeoplePostResponsesContentApplicationJsonSchemaDataEmployment:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaDataEmploymentType
          description: The type of employment
        country:
          type: string
          description: The country of the employment
        end_date:
          type: string
          format: date
          description: The end date of the employment
        job_title:
          type: string
          description: The job title of the employment
        seniority:
          type: string
          description: The seniority of the employment
        start_date:
          type: string
          format: date
          description: The start date of the employment
        contract_id:
          type: string
          description: The unique identifier of the worker contract
        part_time_percentage:
          type: number
          format: double
          description: The percentage of PART_TIME employment
      required:
        - type
        - country
        - end_date
        - job_title
        - seniority
        - start_date
        - contract_id
      description: The employment details of the employee
      title: PeoplePostResponsesContentApplicationJsonSchemaDataEmployment
    PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetailsScale:
      type: string
      enum:
        - ANNUAL
        - MONTHLY
        - SEMIMONTHLY
        - BIWEEKLY
        - WEEKLY
        - DAILY
        - HOURLY
      default: ANNUAL
      description: The scale at which the salary is paid
      title: >-
        PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetailsScale
    PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetails:
      type: object
      properties:
        scale:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetailsScale
          description: The scale at which the salary is paid
        salary:
          type: number
          format: double
          description: The salary of the employee
        currency:
          type: string
          description: The currency of the salary
      required:
        - salary
        - currency
      description: The compensation details of the employee
      title: PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetails
    PeoplePostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the created employee record
        employee:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaDataEmployee
          description: The person that is being hired
        employment:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaDataEmployment
          description: The employment details of the employee
        compensation_details:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaDataCompensationDetails
          description: The compensation details of the employee
      required:
        - id
        - employee
        - employment
        - compensation_details
      title: PeoplePostResponsesContentApplicationJsonSchemaData
    People_createADirectEmployee_Response_201:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaData
      required:
        - data
      title: People_createADirectEmployee_Response_201
    PeoplePostResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: string
          description: Error code identifying the type of error
        message:
          type: string
          description: Human readable error message
      required:
        - code
        - message
      title: PeoplePostResponsesContentApplicationJsonSchemaError
    CreateADirectEmployeeRequestBadRequestError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: CreateADirectEmployeeRequestBadRequestError
    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
    CreateADirectEmployeeRequestInternalServerError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/PeoplePostResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: CreateADirectEmployeeRequestInternalServerError
  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/people"

payload = { "data": {
        "client": {
            "team": { "id": "cbb25647-31e0-485d-9d5f-bdd48296aa1e" },
            "legal_entity": { "id": "cfebc769-abe9-4646-83b9-28cf79f23a0d" }
        },
        "employee": {
            "email": "email@email.com",
            "country": "US",
            "last_name": "Doe",
            "first_name": "John",
            "nationality": "BR"
        },
        "employment": {
            "type": "FULL_TIME",
            "job_title": "Software Engineer",
            "seniority": "Senior",
            "start_date": "2020-01-01"
        },
        "compensation_details": {
            "salary": 10000,
            "currency": "USD"
        }
    } }
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/v2/people';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"data":{"client":{"team":{"id":"cbb25647-31e0-485d-9d5f-bdd48296aa1e"},"legal_entity":{"id":"cfebc769-abe9-4646-83b9-28cf79f23a0d"}},"employee":{"email":"email@email.com","country":"US","last_name":"Doe","first_name":"John","nationality":"BR"},"employment":{"type":"FULL_TIME","job_title":"Software Engineer","seniority":"Senior","start_date":"2020-01-01"},"compensation_details":{"salary":10000,"currency":"USD"}}}'
};

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/v2/people"

	payload := strings.NewReader("{\n  \"data\": {\n    \"client\": {\n      \"team\": {\n        \"id\": \"cbb25647-31e0-485d-9d5f-bdd48296aa1e\"\n      },\n      \"legal_entity\": {\n        \"id\": \"cfebc769-abe9-4646-83b9-28cf79f23a0d\"\n      }\n    },\n    \"employee\": {\n      \"email\": \"email@email.com\",\n      \"country\": \"US\",\n      \"last_name\": \"Doe\",\n      \"first_name\": \"John\",\n      \"nationality\": \"BR\"\n    },\n    \"employment\": {\n      \"type\": \"FULL_TIME\",\n      \"job_title\": \"Software Engineer\",\n      \"seniority\": \"Senior\",\n      \"start_date\": \"2020-01-01\"\n    },\n    \"compensation_details\": {\n      \"salary\": 10000,\n      \"currency\": \"USD\"\n    }\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.letsdeel.com/rest/v2/people")

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  \"data\": {\n    \"client\": {\n      \"team\": {\n        \"id\": \"cbb25647-31e0-485d-9d5f-bdd48296aa1e\"\n      },\n      \"legal_entity\": {\n        \"id\": \"cfebc769-abe9-4646-83b9-28cf79f23a0d\"\n      }\n    },\n    \"employee\": {\n      \"email\": \"email@email.com\",\n      \"country\": \"US\",\n      \"last_name\": \"Doe\",\n      \"first_name\": \"John\",\n      \"nationality\": \"BR\"\n    },\n    \"employment\": {\n      \"type\": \"FULL_TIME\",\n      \"job_title\": \"Software Engineer\",\n      \"seniority\": \"Senior\",\n      \"start_date\": \"2020-01-01\"\n    },\n    \"compensation_details\": {\n      \"salary\": 10000,\n      \"currency\": \"USD\"\n    }\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.letsdeel.com/rest/v2/people")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"client\": {\n      \"team\": {\n        \"id\": \"cbb25647-31e0-485d-9d5f-bdd48296aa1e\"\n      },\n      \"legal_entity\": {\n        \"id\": \"cfebc769-abe9-4646-83b9-28cf79f23a0d\"\n      }\n    },\n    \"employee\": {\n      \"email\": \"email@email.com\",\n      \"country\": \"US\",\n      \"last_name\": \"Doe\",\n      \"first_name\": \"John\",\n      \"nationality\": \"BR\"\n    },\n    \"employment\": {\n      \"type\": \"FULL_TIME\",\n      \"job_title\": \"Software Engineer\",\n      \"seniority\": \"Senior\",\n      \"start_date\": \"2020-01-01\"\n    },\n    \"compensation_details\": {\n      \"salary\": 10000,\n      \"currency\": \"USD\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/v2/people', [
  'body' => '{
  "data": {
    "client": {
      "team": {
        "id": "cbb25647-31e0-485d-9d5f-bdd48296aa1e"
      },
      "legal_entity": {
        "id": "cfebc769-abe9-4646-83b9-28cf79f23a0d"
      }
    },
    "employee": {
      "email": "email@email.com",
      "country": "US",
      "last_name": "Doe",
      "first_name": "John",
      "nationality": "BR"
    },
    "employment": {
      "type": "FULL_TIME",
      "job_title": "Software Engineer",
      "seniority": "Senior",
      "start_date": "2020-01-01"
    },
    "compensation_details": {
      "salary": 10000,
      "currency": "USD"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/people");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"client\": {\n      \"team\": {\n        \"id\": \"cbb25647-31e0-485d-9d5f-bdd48296aa1e\"\n      },\n      \"legal_entity\": {\n        \"id\": \"cfebc769-abe9-4646-83b9-28cf79f23a0d\"\n      }\n    },\n    \"employee\": {\n      \"email\": \"email@email.com\",\n      \"country\": \"US\",\n      \"last_name\": \"Doe\",\n      \"first_name\": \"John\",\n      \"nationality\": \"BR\"\n    },\n    \"employment\": {\n      \"type\": \"FULL_TIME\",\n      \"job_title\": \"Software Engineer\",\n      \"seniority\": \"Senior\",\n      \"start_date\": \"2020-01-01\"\n    },\n    \"compensation_details\": {\n      \"salary\": 10000,\n      \"currency\": \"USD\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["data": [
    "client": [
      "team": ["id": "cbb25647-31e0-485d-9d5f-bdd48296aa1e"],
      "legal_entity": ["id": "cfebc769-abe9-4646-83b9-28cf79f23a0d"]
    ],
    "employee": [
      "email": "email@email.com",
      "country": "US",
      "last_name": "Doe",
      "first_name": "John",
      "nationality": "BR"
    ],
    "employment": [
      "type": "FULL_TIME",
      "job_title": "Software Engineer",
      "seniority": "Senior",
      "start_date": "2020-01-01"
    ],
    "compensation_details": [
      "salary": 10000,
      "currency": "USD"
    ]
  ]] as [String : Any]

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

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