AI Routines
Get a routine
Get a single routine, including its persisted condition query and the status of its most recent completed run. Verification results belong to the POST or PATCH operation that generated a condition and are not returned by GET.
get/api/v1/ai/routines/{id}
Path parameters
idstring uuid required
The UUID of the routine.
The UUID of the routine.
Query parameters
userIdstring uuid
Target user membership ID (for org-scoped API keys)
Target user membership ID (for org-scoped API keys)
Response
Routine details.
Example response
{
"condition": {
"conditionPrompt": "there are failed orders",
"conditionType": "RESULTS_PRESENT",
"query": {
"aiGenerated": true,
"calculations": [],
"column_totals": {},
"fields": [
"orders.id"
],
"fill_fields": [],
"filters": {
"orders.status": {
"case_insensitive": true,
"kind": "EQUALS",
"type": "string",
"values": [
"failed"
]
}
},
"limit": 1,
"modelId": "770e8400-e29b-41d4-a716-446655440002",
"pivots": [],
"row_totals": {},
"sorts": [],
"table": "orders",
"userEditedSQL": "SELECT ${orders.id}\nFROM ${orders}\nWHERE UPPER(${orders.status}) = UPPER('failed')\nLIMIT 1",
"version": 9
}
},
"destination": {
"recipientEmails": [
"alice@example.com",
"bob@example.com"
],
"type": "email",
"userGroupIds": [
"550e8400-e29b-41d4-a716-446655440000"
]
},
"lastRun": {
"label": "Delivered",
"state": "COMPLETE"
}
}