Habits
List habits for an agent
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Query Parameters
Optional user ID to scope habits
Optional instance ID for scoping
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/agents/string/habits"{
"$schema": "/api/v1/schemas/HabitsResponse.json",
"habits": [
{
"$schema": "/api/v1/schemas/Habit.json",
"agent_id": "string",
"category": "string",
"created_at": "2019-08-24T14:15:22Z",
"daily_reinforced": 0.1,
"description": "string",
"display_name": "string",
"formed": true,
"formed_at": "2019-08-24T14:15:22Z",
"id": "string",
"last_reinforced_at": "2019-08-24T14:15:22Z",
"name": "string",
"observation_count": 0,
"strength": 0.1,
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Create a habit for an agent
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Query Parameters
Optional instance ID for scoping
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/habits" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"$schema": "/api/v1/schemas/Habit.json",
"agent_id": "string",
"category": "string",
"created_at": "2019-08-24T14:15:22Z",
"daily_reinforced": 0.1,
"description": "string",
"display_name": "string",
"formed": true,
"formed_at": "2019-08-24T14:15:22Z",
"id": "string",
"last_reinforced_at": "2019-08-24T14:15:22Z",
"name": "string",
"observation_count": 0,
"strength": 0.1,
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Delete a habit
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Habit name
Query Parameters
Optional user ID for per-user habits
Optional instance ID for scoping
Response Body
application/problem+json
curl -X DELETE "https://loading/api/v1/agents/string/habits/string"{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Update a habit
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Habit name
Query Parameters
Optional instance ID for scoping
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X PUT "https://loading/api/v1/agents/string/habits/string" \ -H "Content-Type: application/json" \ -d '{}'{
"$schema": "/api/v1/schemas/Habit.json",
"agent_id": "string",
"category": "string",
"created_at": "2019-08-24T14:15:22Z",
"daily_reinforced": 0.1,
"description": "string",
"display_name": "string",
"formed": true,
"formed_at": "2019-08-24T14:15:22Z",
"id": "string",
"last_reinforced_at": "2019-08-24T14:15:22Z",
"name": "string",
"observation_count": 0,
"strength": 0.1,
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}