> This page is optimized for agents. Use the linked Markdown pages and llms.txt indexes for related API content.

# Get accommodation length of stay options.

- Product: Planning
- Section: Planning
- Snapshot: Current
- Method: `GET`
- Path: `/api/planning/length_of_stay`

## Query parameters

### `organization`

Type: `number`  
Required: yes  

### `accommodation`

Type: `number`  
Required: yes  

### `dateFrom`

Type: `string`  
Format: `date-time`  
Required: yes  

### `dateTo`

Type: `string`  
Format: `date-time`  
Required: yes  

## Execute with TypeScript

Package: `@recranet/sdk`  

```ts
import { RecranetApiClient } from "@recranet/sdk";

const client = new RecranetApiClient({ apiKey: process.env.RECRANET_API_KEY! });

const result = await client.planning.lengthOfStay({
  organization: 0,
  accommodation: 0,
  dateFrom: new Date("2026-06-01"),
  dateTo: new Date("2026-06-01"),
});
```

## Execute with curl

```bash
curl "https://app.recranet.com/api/planning/length_of_stay" \
    -H "X-Api-Key: $RECRANET_API_KEY" \
    --url-query "organization=$ORGANIZATION" \
    --url-query "accommodation=$ACCOMMODATION" \
    --url-query "dateFrom=$DATEFROM" \
    --url-query "dateTo=$DATETO"
```

## Responses

### Response `200`

Category: success  

Successful response

#### `application/json`

##### Generated example

```json
[
  {
    "date": "2024-09-25T00:00:00Z",
    "numOfDays": 7
  }
]
```

##### Schema

###### object[]

Type: `object[]`  

###### object

Type: `object`  

###### `date`

Type: `string`  
Required: no  

###### `numOfDays`

Type: `number`  
Required: no  

### Response `400`

Category: client-error  

Bad request

#### `application/json`

##### Example

```json
{
  "statusCode": 400,
  "description": "Bad request",
  "errors": [
    "Bad request"
  ]
}
```

##### Schema

###### object

Type: `object`  

## Related representations

- [Human documentation](/planning/methods/length-of-stay/)
- [TypeScript Markdown](/planning/methods/length-of-stay.md?lang=typescript)
- [curl Markdown](/planning/methods/length-of-stay.md?lang=curl)
- [site llms.txt](/llms.txt)
- [product llms.txt](/planning/llms.txt)
- [snapshot llms.txt](/planning/llms.txt)
