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

# Set availability rules

PUT https://api.slotflow.dev/v1/humans/{humanId}/availability
Content-Type: application/json

Set or replace availability rules for a human. This is a full replace — send all fields every time.

Availability rules define the human's base weekly schedule:
- **working_days** — which days of the week (1=Monday through 7=Sunday)
- **work_start / work_end** — working hours in HH:MM format (in the human's timezone)
- **meeting_durations** — allowed meeting lengths in minutes

For one-off changes (vacations, overtime, recurring meetings), use Schedule Overrides instead.


Reference: https://docs.slotflow.dev/api-reference/slotflow-api/availability/set-availability

## Authentication

- `Authorization` header (bearer token, required) — API key authentication. Pass your key as a Bearer token: ``` Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx ``` Get your API key from the [Slotflow Dashboard](https://app.slotflow.dev).

## Request

### Path parameters

- `humanId` (string, required) — The ID of the human

### Body (application/json)

This endpoint expects a SetAvailabilityRequest.

- `working_days` (list of integer, required) — Days of the week. 1=Monday through 7=Sunday.
- `work_start` (string, required) — Start of working hours in HH:MM format (in human's timezone)
- `work_end` (string, required) — End of working hours in HH:MM format (in human's timezone)
- `meeting_durations` (list of integer, required) — Allowed meeting durations in minutes

## Response

### 200

Human with updated availability rules

- `active` (boolean, required) — Whether the human is active and bookable
- `created_at` (datetime, required) — ISO 8601 creation timestamp
- `id` (string, required) — Unique identifier for the human
- `name` (string, required) — Full name of the human
- `timezone` (string, required) — IANA timezone identifier (e.g. "America/New_York")
- `availability_rules` (AvailabilityRules, optional) — The human's base weekly schedule. Null if not yet configured.
- `email` (string, optional, nullable) — Email address (optional)
- `role` (string, optional, nullable) — Role or title (e.g. "sales_rep", "interviewer")

## Errors

### 404 Not Found Error

Resource not found

- `error` (ApiErrorError, optional)

### 422 Unprocessable Entity Error

Validation error

- `error` (ApiErrorError, optional)

## Types

### AvailabilityRules

The human's base weekly schedule. Null if not yet configured.

- `working_days` (list of integer, required) — Days of the week the human works. 1=Monday, 2=Tuesday, ..., 7=Sunday.
- `work_start` (string, required) — Start of working hours in HH:MM format (in human's timezone)
- `work_end` (string, required) — End of working hours in HH:MM format (in human's timezone)
- `meeting_durations` (list of integer, required) — Allowed meeting durations in minutes

### ApiErrorError

- `code` (enum, optional) — Machine-readable error code
  - Allowed values: `UNAUTHORIZED`, `NOT_FOUND`, `SLOT_UNAVAILABLE`, `INVALID_DURATION`, `OUTSIDE_WORKING_HOURS`, `SCHEDULE_BLOCKED`, `LIMIT_REACHED`, `VALIDATION_ERROR`
- `message` (string, optional) — Human-readable error description
- `status` (integer, optional) — HTTP status code

## Examples

**Request**

```json
{
  "working_days": [
    1,
    2,
    3,
    4,
    5
  ],
  "work_start": "09:00",
  "work_end": "17:00",
  "meeting_durations": [
    30,
    60
  ]
}
```

**Response**

```json
{
  "active": true,
  "created_at": "2026-03-10T10:00:00.000Z",
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "name": "Sarah Chen",
  "timezone": "America/New_York",
  "availability_rules": {
    "working_days": [
      1,
      2,
      3,
      4,
      5
    ],
    "work_start": "09:00",
    "work_end": "17:00",
    "meeting_durations": [
      30,
      60
    ]
  },
  "email": "sarah@acme.com",
  "role": "sales_rep"
}
```

**SDK Code**

```python Availability_setAvailability_example
import requests

url = "https://api.slotflow.dev/v1/humans/humanId/availability"

payload = {
    "working_days": [1, 2, 3, 4, 5],
    "work_start": "09:00",
    "work_end": "17:00",
    "meeting_durations": [30, 60]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Availability_setAvailability_example
const url = 'https://api.slotflow.dev/v1/humans/humanId/availability';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"working_days":[1,2,3,4,5],"work_start":"09:00","work_end":"17:00","meeting_durations":[30,60]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Availability_setAvailability_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.slotflow.dev/v1/humans/humanId/availability"

	payload := strings.NewReader("{\n  \"working_days\": [\n    1,\n    2,\n    3,\n    4,\n    5\n  ],\n  \"work_start\": \"09:00\",\n  \"work_end\": \"17:00\",\n  \"meeting_durations\": [\n    30,\n    60\n  ]\n}")

	req, _ := http.NewRequest("PUT", 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 Availability_setAvailability_example
require 'uri'
require 'net/http'

url = URI("https://api.slotflow.dev/v1/humans/humanId/availability")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"working_days\": [\n    1,\n    2,\n    3,\n    4,\n    5\n  ],\n  \"work_start\": \"09:00\",\n  \"work_end\": \"17:00\",\n  \"meeting_durations\": [\n    30,\n    60\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Availability_setAvailability_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.slotflow.dev/v1/humans/humanId/availability")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"working_days\": [\n    1,\n    2,\n    3,\n    4,\n    5\n  ],\n  \"work_start\": \"09:00\",\n  \"work_end\": \"17:00\",\n  \"meeting_durations\": [\n    30,\n    60\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.slotflow.dev/v1/humans/humanId/availability', [
  'body' => '{
  "working_days": [
    1,
    2,
    3,
    4,
    5
  ],
  "work_start": "09:00",
  "work_end": "17:00",
  "meeting_durations": [
    30,
    60
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Availability_setAvailability_example
using RestSharp;

var client = new RestClient("https://api.slotflow.dev/v1/humans/humanId/availability");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"working_days\": [\n    1,\n    2,\n    3,\n    4,\n    5\n  ],\n  \"work_start\": \"09:00\",\n  \"work_end\": \"17:00\",\n  \"meeting_durations\": [\n    30,\n    60\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Availability_setAvailability_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "working_days": [1, 2, 3, 4, 5],
  "work_start": "09:00",
  "work_end": "17:00",
  "meeting_durations": [30, 60]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.slotflow.dev/v1/humans/humanId/availability")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```