Casama AI Routines API
The routines API from Casama AI, for routines.
The routines API from Casama AI, for routines.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/casama-ai:casama-ai-routines-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Casama Routines API
version: 0.1.0
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://api.casama.ai
tags:
- name: Routines
paths:
/v1/bots/{id}/routines:
get:
operationId: listRoutines
tags:
- Routines
security:
- bearerAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
enum:
- 'true'
- 'false'
description: 'true: include browser trigger events (site_opened, download_done, bookmark_added) in `device`; app builds before D-323 can''t read them'
required: false
description: 'true: include browser trigger events (site_opened, download_done, bookmark_added) in `device`; app builds before D-323 can''t read them'
name: all_events
in: query
responses:
'200':
description: Routines
content:
application/json:
schema:
$ref: '#/components/schemas/RoutineList'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
summary: List routines
x-summary-source: derived
/v1/routines:
post:
operationId: createRoutine
tags:
- Routines
security:
- bearerAuth: []
summary: Schedule a routine (cron in a timezone) or create a GitHub/custom webhook…
parameters:
- schema:
type: string
maxLength: 255
description: Retries with the same key return the first result
required: false
description: Retries with the same key return the first result
name: idempotency-key
in: header
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRoutineRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/CreatedRoutine'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/routines/{id}:
patch:
operationId: updateRoutine
tags:
- Routines
security:
- bearerAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
enum:
- 'true'
- 'false'
description: 'true: include browser trigger events (site_opened, download_done, bookmark_added) in `device`; app builds before D-323 can''t read them'
required: false
description: 'true: include browser trigger events (site_opened, download_done, bookmark_added) in `device`; app builds before D-323 can''t read them'
name: all_events
in: query
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateRoutineRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/Routine'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
summary: Update routine
x-summary-source: derived
delete:
operationId: deleteRoutine
tags:
- Routines
security:
- bearerAuth: []
summary: Delete a routine (its past runs and conversation are kept)
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
responses:
'200':
description: Deleted
content:
application/json:
schema:
$ref: '#/components/schemas/DeletedRoutine'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/routines/{id}/run:
post:
operationId: runRoutine
tags:
- Routines
security:
- bearerAuth: []
summary: Run a routine now
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
responses:
'202':
description: Started
content:
application/json:
schema:
$ref: '#/components/schemas/RunStarted'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/routine-ideas:
get:
operationId: listRoutineIdeas
tags:
- Routines
security:
- bearerAuth: []
summary: Routine ideas from the gallery, to fill in a new routine
responses:
'200':
description: Routine ideas
content:
application/json:
schema:
$ref: '#/components/schemas/RoutineIdeaList'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
components:
schemas:
DeviceTriggerConfig:
type:
- object
- 'null'
properties:
event:
type: string
enum:
- wake
- arrive
- leave
- leave_now
- workout_ended
- notification
- focus_on
- focus_off
- file_added
- site_opened
- download_done
- bookmark_added
site:
type: string
minLength: 1
maxLength: 253
description: 'site_opened: a site the person names (wiki.example.com); its subdomains count. Banking, health, password manager and government ID sites are refused'
place:
type: string
minLength: 1
maxLength: 60
description: 'arrive and leave: a named place (Home, Work, Gym)'
app:
type: string
minLength: 1
maxLength: 200
description: 'notification: the watched app (its name or package id)'
minutes_before:
type: integer
minimum: 0
maximum: 120
description: 'leave_now: extra minutes on top of the travel time (default 5)'
folder:
type: string
minLength: 1
maxLength: 200
description: 'file_added: a folder the desktop app watches (Downloads)'
pattern:
type: string
minLength: 1
maxLength: 100
description: 'file_added and download_done: a file name pattern like *.pdf'
required:
- event
UpdateRoutineRequest:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 120
instructions:
type: string
minLength: 1
maxLength: 20000
schedule_cron:
type: string
maxLength: 100
description: A once routine given a cron becomes a repeating one
run_at:
type: string
format: date-time
description: A repeating routine given run_at becomes a once one
timezone:
type: string
maxLength: 64
notify:
type: boolean
enabled:
type: boolean
ends_at:
type:
- string
- 'null'
format: date-time
description: When it switches itself off; null removes the end time
max_runs:
type:
- integer
- 'null'
minimum: 1
maximum: 10000
description: Runs left before it switches itself off, counted from now; null removes it
browser:
type: string
enum:
- computer
- mine
- mine_or_computer
description: 'Where its browser work happens (D-323 C13): "computer" (the bot''s own), "mine" (your Chrome; waits until it''s online) or "mine_or_computer"'
computer:
type: string
enum:
- bot_computer
- my_computer
description: 'Where its computer work happens (computer places): "bot_computer" (the bot''s own, the default) or "my_computer" (your own computer, when it is on and lets the bot in)'
uses_computer:
type: boolean
description: 'Whether its runs may use a computer at all (D-627). Off: no files, shell or computer browser, and no computer is started. Defaults to off for briefs and check-ins, on otherwise'
RoutineIdea:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
category:
type: string
enum:
- work
- research
- build
- create
- life
icon:
type: string
description: Lucide icon name, kebab-case
instructions_md:
type: string
schedule_cron:
type: string
featured:
type: boolean
author:
$ref: '#/components/schemas/ContentAuthor'
added:
type: string
description: YYYY-MM-DD the item was added
updated:
type: string
changelog:
type: array
items:
$ref: '#/components/schemas/GalleryChange'
pick:
type: string
description: Why a featured item is a pick
examples:
type: array
items:
type: string
access:
$ref: '#/components/schemas/GalleryAccess'
needs:
$ref: '#/components/schemas/GalleryNeeds'
inputs:
type: array
items:
$ref: '#/components/schemas/GalleryInput'
remix_of:
$ref: '#/components/schemas/GalleryRef'
replaced_by:
$ref: '#/components/schemas/GalleryRef'
min_app:
type: string
min_server:
type: string
season:
type: object
properties:
from:
type: string
to:
type: string
required:
- from
- to
tested:
type: object
properties:
version:
type: integer
date:
type: string
required:
- version
- date
source:
type: string
description: The extra catalog it came from (GALLERY_SOURCES); ids are source:id
stats:
$ref: '#/components/schemas/GalleryStats'
cover:
type: string
description: Absolute URL of the item's painted cover picture (cover.webp), when it has one
template:
type: object
additionalProperties: {}
description: 'Routines and bots with install questions: the raw fields with {{key}} placeholders (document has the defaults filled)'
version:
type: integer
tags:
type: array
items:
type: string
required:
- id
- name
- description
- category
- icon
- instructions_md
- schedule_cron
- featured
- author
RoutineList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Routine'
required:
- items
CreateRoutineRequest:
type: object
properties:
bot_id:
type: string
format: uuid
name:
type: string
minLength: 1
maxLength: 120
instructions:
type: string
minLength: 1
maxLength: 20000
trigger:
$ref: '#/components/schemas/RoutineTrigger'
schedule_cron:
type: string
maxLength: 100
description: 5-field cron, required for schedule triggers
run_at:
type: string
format: date-time
description: When a once routine runs (it switches itself off afterwards)
timezone:
type: string
maxLength: 64
description: IANA timezone; defaults to your profile's
notify:
type: boolean
events:
type: array
items:
type: string
maxLength: 64
maxItems: 20
description: GitHub event names to accept
calendar:
allOf:
- $ref: '#/components/schemas/CalendarTriggerConfig'
- description: Required for calendar_event triggers
message:
allOf:
- $ref: '#/components/schemas/MessageTriggerConfig'
- description: 'Filters for message triggers: an email or chat message that matches starts the routine'
device:
allOf:
- $ref: '#/components/schemas/DeviceTriggerConfig'
- description: 'Required for device triggers: the event on your own phone or computer'
ends_at:
type: string
format: date-time
description: 'Repeating and event routines: switch off for good at this time'
max_runs:
type: integer
minimum: 1
maximum: 10000
description: 'Repeating and event routines: switch off for good after this many runs'
gallery_id:
type: string
minLength: 1
maxLength: 100
description: The gallery routine idea this came from, so the workspace sees its updates (D-315)
browser:
type: string
enum:
- computer
- mine
- mine_or_computer
description: 'Where its browser work happens (D-323 C13): "computer" (the bot''s own), "mine" (your Chrome; waits until it''s online) or "mine_or_computer"'
computer:
type: string
enum:
- bot_computer
- my_computer
description: 'Where its computer work happens (computer places): "bot_computer" (the bot''s own, the default) or "my_computer" (your own computer, when it is on and lets the bot in)'
uses_computer:
type: boolean
description: 'Whether its runs may use a computer at all (D-627). Off: no files, shell or computer browser, and no computer is started. Defaults to off for briefs and check-ins, on otherwise'
required:
- bot_id
- name
- instructions
GalleryNeeds:
type: object
properties:
apps:
type: array
items:
type: string
skills:
type: array
items:
type: string
Routine:
type: object
properties:
id:
type: string
format: uuid
bot_id:
type: string
format: uuid
name:
type: string
instructions_md:
type: string
schedule_cron:
type:
- string
- 'null'
timezone:
type: string
trigger:
$ref: '#/components/schemas/RoutineTrigger'
calendar:
$ref: '#/components/schemas/CalendarTriggerConfig'
message:
$ref: '#/components/schemas/MessageTriggerConfig'
device:
$ref: '#/components/schemas/DeviceTriggerConfig'
notify:
type: boolean
enabled:
type: boolean
next_run_at:
type:
- string
- 'null'
format: date-time
last_run_at:
type:
- string
- 'null'
format: date-time
ends_at:
type:
- string
- 'null'
format: date-time
description: When it switches itself off for good (D-262)
max_runs:
type:
- integer
- 'null'
description: How many runs before it switches itself off (D-262)
run_count:
type: integer
description: Runs that count toward max_runs (manual runs don't)
browser:
type: string
enum:
- computer
- mine
- mine_or_computer
description: 'Where its browser work happens (D-323 C13): "computer" (the bot''s own), "mine" (your Chrome; waits until it''s online) or "mine_or_computer"'
computer:
type: string
enum:
- bot_computer
- my_computer
description: 'Where its computer work happens (computer places): "bot_computer" (the bot''s own, the default) or "my_computer" (your own computer, when it is on and lets the bot in)'
uses_computer:
type: boolean
description: 'Whether its runs may use a computer at all (D-627). Off: no files, shell or computer browser, and no computer is started. Defaults to off for briefs and check-ins, on otherwise'
waiting_for_model:
type: boolean
description: True when a scheduled run was skipped because Casama's models are off for this plan and no own provider is connected (docs/OWN-KEYS-PLAN.md §3.4)
conversation_id:
type:
- string
- 'null'
format: uuid
created_at:
type: string
format: date-time
required:
- id
- bot_id
- name
- instructions_md
- schedule_cron
- timezone
- trigger
- notify
- enabled
- next_run_at
- last_run_at
- conversation_id
- created_at
RunStarted:
type: object
properties:
run_id:
type: string
format: uuid
required:
- run_id
DeletedRoutine:
type: object
properties:
deleted:
type: string
format: uuid
required:
- deleted
Problem:
type: object
properties:
type:
type: string
example: https://casama.ai/problems/not_found
title:
type: string
status:
type: integer
code:
type: string
description: Stable error code
example: not_found
detail:
type: string
instance:
type: string
errors:
type: array
items:
type: object
properties:
path:
type: string
message:
type: string
required:
- path
- message
description: Field errors for validation_failed
required:
- type
- title
- status
- code
CalendarTriggerConfig:
type:
- object
- 'null'
properties:
integration_id:
type: string
format: uuid
description: A connected Google or Outlook calendar
offset_minutes:
type: integer
minimum: -1440
maximum: 1440
description: Relative to the event's start (or end, with anchor end); -15 is 15 minutes before
anchor:
type: string
enum:
- start
- end
description: What the offset counts from; end is for after a meeting (D-287)
calendar:
type: string
maxLength: 200
outside_guests:
type: boolean
title_match:
type: string
maxLength: 200
has_video_link:
type: boolean
required:
- integration_id
- offset_minutes
GalleryRef:
type: object
properties:
type:
type: string
id:
type: string
required:
- type
- id
description: Another gallery item
RoutineTrigger:
type: string
enum:
- schedule
- once
- github
- webhook
- calendar_event
- message
- device
description: schedule repeats on a cron; once runs a single time at run_at
GalleryAccess:
type: object
properties:
reads:
type: array
items:
type: string
writes:
type: array
items:
type: string
runs_code:
type: boolean
computer:
type: boolean
credits:
type: string
enum:
- none
- low
- medium
- high
description: What an item can touch, in plain words
ContentAuthor:
type: object
properties:
name:
type: string
url:
type: string
handle:
type: string
required:
- name
MessageTriggerConfig:
type:
- object
- 'null'
properties:
channel_id:
type: string
format: uuid
channel_kind:
type: string
enum:
- telegram
- email
- sms
- slack
- whatsapp
- messenger
- feishu
- imessage
- teams
- discord
- linear
- jira
sender:
type: string
maxLength: 300
description: An address or id; *@domain for email
subject_match:
type: string
maxLength: 200
text_match:
type: string
maxLength: 200
to_tag:
type: string
maxLength: 100
description: 'Hosted mail only: the plus tag it arrived on (ada+shop@)'
allow_unconfirmed:
type: boolean
description: 'Hosted mail: also hear senders whose domain didn''t confirm them'
include_automatic:
type: boolean
description: Also hear automatic mail (bounces, out-of-office, lists)
GalleryStats:
type: object
properties:
installers:
type: integer
trending:
type: integer
description: New installers this week
active:
type: integer
description: People who used it in 14 days
success:
type: number
description: Share of runs that finished, 0 to 1 (last 30 days)
description: Aggregate use. Numbers are left out under 10 installers; success under 20 runs (D-315).
RoutineIdeaList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/RoutineIdea'
required:
- items
CreatedRoutine:
allOf:
- $ref: '#/components/schemas/Routine'
- type: object
properties:
webhook_url:
type: string
webhook_secret:
type: string
description: Shown once; sign requests with HMAC-SHA256
GalleryChange:
type: object
properties:
version:
type: integer
date:
type: string
note:
type: string
breaking:
type: boolean
required:
- version
- date
- note
GalleryInput:
type: object
properties:
key:
type: string
label:
type: string
type:
type: string
enum:
- text
- choice
- time
- timezone
default:
type: string
options:
type: array
items:
type: string
help:
type: string
required:
- key
- label
- type
description: A question asked when a routine or bot is added
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Supabase access token