> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/platform-api/workspaces/scheduling-rule-sets.md).

# Scheduling Rule Sets

Scheduling rule sets define workspace-scoped configuration for the deterministic scheduling rules engine. Each rule set binds an agent kind and rule kind to a typed parameter block that controls how the engine filters appointment slots.

Rule sets are scoped to a workspace. The combination of agent kind and rule kind is unique per workspace - each workspace can have at most one rule set per (agent kind, rule kind) pair.

## Endpoints

All endpoints are scoped to a workspace: `/v1/{workspace_id}/scheduling-rule-sets`

### List Scheduling Rule Sets

Returns a paginated list of scheduling rule sets for the workspace.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/scheduling-rule-sets" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

**Permissions:** `Workspace.view`

### Get One Scheduling Rule Set

Returns a single scheduling rule set by ID.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/scheduling-rule-sets/{rule\_set\_id}" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

**Permissions:** `Workspace.view`

### Create a Scheduling Rule Set

Creates a new scheduling rule set. The `rule_kind` is determined by the discriminator field inside `params`.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/scheduling-rule-sets" method="post" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

**Permissions:** `Workspace.update`

**Errors:**

* `409` - A rule set already exists for this (agent kind, rule kind). Update the existing row or delete it first.
* `422` - Invalid request body or rule kind discriminator

### Update a Scheduling Rule Set

Partially updates an existing rule set. Only `params` and `is_active` can be changed. `agent_kind` and `rule_kind` are immutable - to change either, create a new rule set and delete the old one.

When updating `params`, send the complete params object for the rule kind. Partial updates within params are not supported. At least one field must be provided.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/scheduling-rule-sets/{rule\_set\_id}" method="patch" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

**Permissions:** `Workspace.update`

**Errors:**

* `404` - Rule set not found in this workspace
* `422` - Empty update body, or the params discriminator does not match the existing rule's kind

### Delete a Scheduling Rule Set

Permanently deletes a scheduling rule set. The deletion is recorded in the audit log.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/scheduling-rule-sets/{rule\_set\_id}" method="delete" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

**Permissions:** `Workspace.update`

**Errors:**

* `404` - Rule set not found in this workspace

## Example

**Create a clinic open hours rule:**

```json
POST /v1/{workspace_id}/scheduling-rule-sets

{
  "agent_kind": "tms",
  "params": {
    "rule_kind": "clinic_open_hours",
    "timezone": "America/New_York",
    "monday": {"start": "08:00", "end": "17:00"},
    "tuesday": {"start": "08:00", "end": "17:00"},
    "wednesday": {"start": "08:00", "end": "17:00"},
    "thursday": {"start": "08:00", "end": "17:00"},
    "friday": {"start": "08:00", "end": "12:00"}
  },
  "is_active": true
}
```

**Update params on an existing rule:**

```json
PATCH /v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}

{
  "params": {
    "rule_kind": "clinic_open_hours",
    "timezone": "America/Chicago",
    "monday": {"start": "09:00", "end": "18:00"},
    "tuesday": {"start": "09:00", "end": "18:00"},
    "wednesday": {"start": "09:00", "end": "18:00"},
    "thursday": {"start": "09:00", "end": "18:00"},
    "friday": {"start": "09:00", "end": "14:00"}
  }
}
```

**Disable a rule without deleting it:**

```json
PATCH /v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}

{
  "is_active": false
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/platform-api/workspaces/scheduling-rule-sets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
