For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scheduling Rules

List scheduling rule sets

get

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Query parameters
sort_bystring[]OptionalDefault: []
limitinteger · max: 200OptionalDefault: 50
continuation_tokenanyOptional
agent_kindstring · enum · nullableOptionalPossible values:
is_activeboolean · nullableOptional
Responses
200

Successful Response

application/json
has_morebooleanRequired
continuation_tokenanyOptional
get/v1/{workspace_id}/scheduling-rule-sets
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 a scheduling rule set

post

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Body
agent_kindstring · enumRequiredPossible values:
paramsone ofRequired

Per-rule-kind typed parameters. The rule_kind discriminator field selects the params shape; one row per (agent_kind, rule_kind) per workspace.

or
or
or
or
or
is_activebooleanOptionalDefault: true
Responses
201

Successful Response

application/json

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.

idstring · uuidRequired
workspace_idstring · uuidRequired
agent_kindstring · enumRequiredPossible values:
rule_kindstring · enumRequiredPossible values:
is_activebooleanRequired
created_bystring · uuid · nullableRequired
created_atstring · date-time · nullableRequired
updated_atstring · date-time · nullableRequired
post/v1/{workspace_id}/scheduling-rule-sets
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"
}

Get one scheduling rule set

get

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
rule_set_idstring · uuidRequired
Responses
200

Successful Response

application/json

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.

idstring · uuidRequired
workspace_idstring · uuidRequired
agent_kindstring · enumRequiredPossible values:
rule_kindstring · enumRequiredPossible values:
is_activebooleanRequired
created_bystring · uuid · nullableRequired
created_atstring · date-time · nullableRequired
updated_atstring · date-time · nullableRequired
get/v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}
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"
}

Delete a scheduling rule set

delete

Hard-delete. The audit log retains the deletion record.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
rule_set_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}
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

Partially update a scheduling rule set

patch

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
rule_set_idstring · uuidRequired
Body

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.

paramsone of · nullableOptional
or
or
or
or
or
is_activeboolean · nullableOptional
Responses
200

Successful Response

application/json

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.

idstring · uuidRequired
workspace_idstring · uuidRequired
agent_kindstring · enumRequiredPossible values:
rule_kindstring · enumRequiredPossible values:
is_activebooleanRequired
created_bystring · uuid · nullableRequired
created_atstring · date-time · nullableRequired
updated_atstring · date-time · nullableRequired
patch/v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}
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?