Scheduling Rules
List all scheduling rule sets for the workspace. Optional filters: agent_kind (tms / ketamine / general), is_active. Used by the agent-engine rules engine and by operators inspecting config.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
[]50Successful Response
Missing or invalid API key.
Insufficient permissions.
Validation Error
Rate limited.
GET /v1/{workspace_id}/scheduling-rule-sets HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_kind": "tms",
"rule_kind": "clinic_open_hours",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"is_active": true,
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}
],
"has_more": true,
"continuation_token": null
}Create one rule set for (agent_kind, rule_kind). Returns 409 if a row already exists for that key — use PATCH on the existing row or DELETE first.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Per-rule-kind typed parameters. The rule_kind discriminator field selects the params shape; one row per (agent_kind, rule_kind) per workspace.
trueSuccessful Response
Wire shape for a single rule set. params stays as dict
here (not the discriminated union) so add-a-new-kind doesn't break
older clients still on the previous SDK version — the SDK's typed
helpers can re-validate into RuleParams when needed.
Missing or invalid API key.
Insufficient permissions.
Rule set already exists for this (agent_kind, rule_kind).
Invalid request body or rule_kind discriminator.
Rate limited.
POST /v1/{workspace_id}/scheduling-rule-sets HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 379
{
"agent_kind": "tms",
"params": {
"rule_kind": "clinic_open_hours",
"timezone": "text",
"monday": {
"start": "text",
"end": "text"
},
"tuesday": {
"start": "text",
"end": "text"
},
"wednesday": {
"start": "text",
"end": "text"
},
"thursday": {
"start": "text",
"end": "text"
},
"friday": {
"start": "text",
"end": "text"
},
"saturday": {
"start": "text",
"end": "text"
},
"sunday": {
"start": "text",
"end": "text"
}
},
"is_active": true
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_kind": "tms",
"rule_kind": "clinic_open_hours",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"is_active": true,
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Fetch one rule set by id. Returns 404 when the row doesn't exist in this workspace (the RLS policy means cross-workspace lookups surface as 404, never as a row from the wrong workspace).
Permissions: Workspace.view.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
Wire shape for a single rule set. params stays as dict
here (not the discriminated union) so add-a-new-kind doesn't break
older clients still on the previous SDK version — the SDK's typed
helpers can re-validate into RuleParams when needed.
Missing or invalid API key.
Insufficient permissions.
Rule set not found in this workspace.
Validation Error
Rate limited.
GET /v1/{workspace_id}/scheduling-rule-sets/{rule_set_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_kind": "tms",
"rule_kind": "clinic_open_hours",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"is_active": true,
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Hard-delete. The audit log retains the deletion record.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
No content
Missing or invalid API key.
Insufficient permissions.
Rule set not found in this workspace.
Validation Error
Rate limited.
DELETE /v1/{workspace_id}/scheduling-rule-sets/{rule_set_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Update params and/or is_active on an existing rule set. agent_kind and rule_kind are immutable — to change either, create a new rule set and delete the old one.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Partial update — fields not provided are unchanged. params
must be the full per-kind shape (no patch within params); send the
whole RuleParams or omit.
Successful Response
Wire shape for a single rule set. params stays as dict
here (not the discriminated union) so add-a-new-kind doesn't break
older clients still on the previous SDK version — the SDK's typed
helpers can re-validate into RuleParams when needed.
Missing or invalid API key.
Insufficient permissions.
Rule set not found in this workspace.
Submitted params discriminator does not match the existing rule's rule_kind.
Rate limited.
PATCH /v1/{workspace_id}/scheduling-rule-sets/{rule_set_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 360
{
"params": {
"rule_kind": "clinic_open_hours",
"timezone": "text",
"monday": {
"start": "text",
"end": "text"
},
"tuesday": {
"start": "text",
"end": "text"
},
"wednesday": {
"start": "text",
"end": "text"
},
"thursday": {
"start": "text",
"end": "text"
},
"friday": {
"start": "text",
"end": "text"
},
"saturday": {
"start": "text",
"end": "text"
},
"sunday": {
"start": "text",
"end": "text"
}
},
"is_active": true
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_kind": "tms",
"rule_kind": "clinic_open_hours",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"is_active": true,
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Last updated
Was this helpful?

