# List time-off requests for Organization

GET https://api.letsdeel.com/rest/v2/time_offs

List time-off requests for Organization
 **Token scopes**: `time-off:read`

Reference: https://developer.deel.com/api/reference/endpoints/time-off/list-time-off-requests-for-organization

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /time_offs:
    get:
      operationId: list-time-off-requests-for-organization
      summary: List time-off requests for Organization
      description: |-
        List time-off requests for Organization
         **Token scopes**: `time-off:read`
      tags:
        - subpackage_timeOff
      parameters:
        - name: status
          in: query
          description: Time off status
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TimeOffsGetParametersStatusSchemaItems'
        - name: time_off_ids
          in: query
          description: Time off ids
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: start_date
          in: query
          description: Start date of time off
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: End date of time off
          required: false
          schema:
            type: string
            format: date-time
        - name: approval_start_date
          in: query
          description: Approval start date
          required: false
          schema:
            type: string
            format: date-time
        - name: approval_end_date
          in: query
          description: Approval end date
          required: false
          schema:
            type: string
            format: date-time
        - name: updated_start_date
          in: query
          description: Updated start date
          required: false
          schema:
            type: string
            format: date-time
        - name: updated_end_date
          in: query
          description: Updated end date
          required: false
          schema:
            type: string
            format: date-time
        - name: page_size
          in: query
          description: Page size
          required: false
          schema:
            type: integer
        - name: policy_types
          in: query
          description: Policy types
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: next
          in: query
          description: Next page
          required: false
          schema:
            type: string
        - 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 operation time offs returned
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Time
                  Off_listTimeOffRequestsForOrganization_Response_200
        '400':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '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:
    TimeOffsGetParametersStatusSchemaItems:
      type: string
      enum:
        - REQUESTED
        - APPROVED
        - REJECTED
        - USED
        - CANCELED
      title: TimeOffsGetParametersStatusSchemaItems
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsStatus:
      type: string
      enum:
        - REQUESTED
        - APPROVED
        - REJECTED
        - USED
        - CANCELED
      description: Status of time off
      title: TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsStatus
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicyPolicyType:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Policy type id
        name:
          type: string
          description: Depicts the type of policy, like VACATION, SICK etc
      required:
        - id
        - name
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicyPolicyType
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicy:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Policy id
        name:
          type: string
          description: The custom name given to policy during policy creation.
        policy_type:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicyPolicyType
      required:
        - id
        - name
        - policy_type
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicy
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffType:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Time off type id.
        name:
          type: string
          description: >-
            Time off type name. Basically the reason or category of time-off
            taken. For SICK leave, it can be doctor appointment, surgery etc.
        policy:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffTypePolicy
      required:
        - id
        - name
      title: TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffType
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsEntitlementUnit:
      type: string
      enum:
        - HOUR
        - BUSINESS_DAY
        - CALENDAR_DAY
        - WEEK
        - MONTH
        - YEAR
      description: The unit in which the time off usage and entitlement are calculated.
      title: TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsEntitlementUnit
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItemsType:
      type: string
      enum:
        - WORKING_DAY
        - NON_WORKING_DAY
        - HOLIDAY
      description: Time off daily type
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItemsType
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Time off daily id
        date:
          type: string
          format: date
          description: Time off daily date
        type:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItemsType
          description: Time off daily type
        amount:
          type: number
          format: double
          description: Time off daily amount
        created_at:
          type: string
          format: date-time
          description: Time off daily creation date
        updated_at:
          type: string
          format: date-time
          description: Time off daily update date
        description:
          type:
            - string
            - 'null'
          description: Time off daily description
        time_off_id:
          type: string
          format: uuid
          description: Time off id
      required:
        - id
        - date
        - type
        - amount
        - created_at
        - updated_at
        - time_off_id
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItems
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRecipientProfile:
      type: object
      properties:
        hris_profile_id:
          type: string
          format: uuid
          description: Recipient hris profile id
        organization_id:
          type: string
          format: uuid
          description: Recipient organization id
        client_profile_id:
          type: string
          format: uuid
          description: Recipient client profile id
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRecipientProfile
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRequesterProfile:
      type: object
      properties:
        hris_profile_id:
          type: string
          format: uuid
          description: Request hris profile id
        organization_id:
          type: string
          format: uuid
          description: Request organization id
        client_profile_id:
          type: string
          format: uuid
          description: Request client profile id
      title: >-
        TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRequesterProfile
    TimeOffsGetResponsesContentApplicationJsonSchemaDataItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Time off id
        amount:
          type: number
          format: double
          description: Amount of time off
        reason:
          type: string
          description: Reason for time off
        status:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsStatus
          description: Status of time off
        is_paid:
          type: boolean
          description: Is time off paid
        end_date:
          type: string
          format: date
          description: End date of time off
        created_at:
          type: string
          format: date-time
          description: Time off creation date
        start_date:
          type: string
          format: date
          description: Start date of time off
        updated_at:
          type: string
          format: date-time
          description: Time off update date
        approved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Time off approval date
        description:
          type:
            - string
            - 'null'
          description: Time off description
        contract_oid:
          type: string
          description: Contract id
        requested_at:
          type: string
          format: date
          description: Time off request date
        half_end_date:
          type: boolean
          description: Is half end date
        time_off_type:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffType
        half_start_date:
          type: boolean
          description: Is half start date
        deduction_amount:
          type:
            - number
            - 'null'
          format: double
          description: Deduction amount
        entitlement_unit:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsEntitlementUnit
          description: The unit in which the time off usage and entitlement are calculated.
        time_off_dailies:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsTimeOffDailiesItems
        time_off_type_id:
          type: string
          description: Time off type id
        recipient_profile:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRecipientProfile
        requester_profile:
          $ref: >-
            #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItemsRequesterProfile
        time_off_percentage:
          type:
            - number
            - 'null'
          format: double
          description: Time off percentage
        is_end_date_estimated:
          type: boolean
          description: Is end date estimated
        other_type_description:
          type:
            - string
            - 'null'
          description: Other type description
      required:
        - id
        - amount
        - is_paid
        - end_date
        - created_at
        - start_date
        - updated_at
        - requested_at
        - half_end_date
        - half_start_date
        - entitlement_unit
        - time_off_type_id
      title: TimeOffsGetResponsesContentApplicationJsonSchemaDataItems
    Time Off_listTimeOffRequestsForOrganization_Response_200:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeOffsGetResponsesContentApplicationJsonSchemaDataItems
        next:
          type: string
        page_size:
          type: integer
          description: Page size
        has_next_page:
          type: boolean
          description: Has next page
      required:
        - data
        - page_size
        - has_next_page
      description: Time offs associated to the query
      title: Time Off_listTimeOffRequestsForOrganization_Response_200
    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/time_offs"

querystring = {"status":"[\"REQUESTED\"]","time_off_ids":"[\"d290f1ee-6c54-4b01-90e6-d701748f0851\"]","start_date":"2022-01-01T00:00:00Z","end_date":"2022-01-01T00:00:00Z","approval_start_date":"2022-01-01T00:00:00Z","approval_end_date":"2022-01-01T00:00:00Z","updated_start_date":"2022-01-01T00:00:00Z","updated_end_date":"2022-01-01T00:00:00Z","page_size":"10","policy_types":"[\"d290f1ee-6c54-4b01-90e6-d701748f0851\"]","next":"d290f1ee-6c54-4b01-90e6-d701748f0851"}

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

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

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851';
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/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851"

	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/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851")

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/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851")
  .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/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851");
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/time_offs?status=%5B%22REQUESTED%22%5D&time_off_ids=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&start_date=2022-01-01T00%3A00%3A00Z&end_date=2022-01-01T00%3A00%3A00Z&approval_start_date=2022-01-01T00%3A00%3A00Z&approval_end_date=2022-01-01T00%3A00%3A00Z&updated_start_date=2022-01-01T00%3A00%3A00Z&updated_end_date=2022-01-01T00%3A00%3A00Z&page_size=10&policy_types=%5B%22d290f1ee-6c54-4b01-90e6-d701748f0851%22%5D&next=d290f1ee-6c54-4b01-90e6-d701748f0851")! 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()
```