Playbook Management
Methods for searching, retrieving, adding, and deleting user playbooks and agent playbooks.
Playbook Management
search_user_playbooks
Search for user playbooks using semantic/text search and advanced filtering.
response = client.search_user_playbooks(
query="user satisfaction",
agent_version="v2.1.0",
tags=["support"],
top_k=10
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search_user_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"query": "user satisfaction",
"agent_version": "v2.1.0",
"tags": ["support"],
"top_k": 10
}
JSONProp
Type
search_agent_playbooks
Search for agent playbooks using semantic/text search and advanced filtering.
response = client.search_agent_playbooks(
query="concise responses",
agent_version="v2.1.0",
tags=["tone"],
playbook_status_filter="approved"
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search_agent_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"query": "concise responses",
"agent_version": "v2.1.0",
"tags": ["tone"],
"playbook_status_filter": "approved"
}
JSONProp
Type
get_user_playbooks
Retrieve user playbook rows containing agent guidance, including entries
extracted from interactions and optimizer-created successors or rollbacks such
as offline tuner rows with source="offline_optimizer".
response = client.get_user_playbooks(
limit=100,
tags=["support"]
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/get_user_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"limit": 100,
"tags": ["support"]
}
JSONProp
Type
add_user_playbook
Add user playbook entries directly to storage.
response = client.add_user_playbook(
user_playbooks=[
{
"agent_version": "v2.1.0",
"request_id": "req_123",
"content": "User expressed satisfaction with response"
}
]
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/add_user_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"user_playbooks": [
{
"agent_version": "v2.1.0",
"request_id": "req_123",
"content": "User expressed satisfaction with response"
}
]
}
JSONProp
Type
At least one of content or trigger must be provided.
add_agent_playbooks
Add agent playbook entries directly to storage.
response = client.add_agent_playbooks(
agent_playbooks=[
{
"agent_version": "v2.1.0",
"content": "Agent should provide more concise responses",
"playbook_status": "approved",
"playbook_metadata": "{}"
}
]
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/add_agent_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"agent_playbooks": [
{
"agent_version": "v2.1.0",
"content": "Agent should provide more concise responses",
"playbook_status": "approved",
"playbook_metadata": "{}"
}
]
}
JSONProp
Type
get_agent_playbooks
Retrieve agent playbook entries.
response = client.get_agent_playbooks(
limit=10,
tags=["tone"]
)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/get_agent_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"limit": 10,
"tags": ["tone"]
}
JSONProp
Type
Update Methods
update_user_playbook
Update editable fields of a user playbook in place. Pass only the fields you want to change.
response = client.update_user_playbook(
user_playbook_id=42,
content="Refined playbook content",
)curl -X PUT "${REFLEXIO_URL:-https://www.reflexio.ai}/api/update_user_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"user_playbook_id": 42,
"content": "Refined playbook content"
}
JSONProp
Type
Returns: UpdateUserPlaybookResponse with success and message.
update_agent_playbook
Update editable fields of an agent playbook in place. Pass only the fields you want to change.
response = client.update_agent_playbook(
agent_playbook_id=17,
content="Updated guidance"
)curl -X PUT "${REFLEXIO_URL:-https://www.reflexio.ai}/api/update_agent_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"agent_playbook_id": 17,
"content": "Updated guidance"
}
JSONProp
Type
Returns: UpdateAgentPlaybookResponse with success and message.
update_agent_playbook_status
Dedicated endpoint for the approval workflow (approve / pending / reject). Use this instead of update_agent_playbook when the only change is the playbook_status — the server enforces tighter validation and writes a smaller change log.
from reflexio import PlaybookStatus
response = client.update_agent_playbook_status(
agent_playbook_id=17,
playbook_status=PlaybookStatus.APPROVED,
)curl -X PUT "${REFLEXIO_URL:-https://www.reflexio.ai}/api/update_agent_playbook_status" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"agent_playbook_id": 17,
"playbook_status": "approved"
}
JSONProp
Type
Returns: UpdatePlaybookStatusResponse with success and message.
delete_agent_playbook
Delete an agent playbook by ID.
response = client.delete_agent_playbook(
agent_playbook_id=123,
wait_for_response=True
)curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_agent_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"agent_playbook_id": 123
}
JSONdelete_user_playbook
Delete a user playbook by ID.
response = client.delete_user_playbook(
user_playbook_id=456,
wait_for_response=True
)curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_user_playbook" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"user_playbook_id": 456
}
JSONBulk Delete Operations
delete_agent_playbooks_by_ids
Delete multiple agent playbooks by their IDs.
response = client.delete_agent_playbooks_by_ids(agent_playbook_ids=[1, 2, 3])curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_agent_playbooks_by_ids" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"agent_playbook_ids": [
1,
2,
3
]
}
JSONReturns: BulkDeleteResponse with success, deleted_count, and message
delete_user_playbooks_by_ids
Delete multiple user playbooks by their IDs.
response = client.delete_user_playbooks_by_ids(user_playbook_ids=[1, 2, 3])curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_user_playbooks_by_ids" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"user_playbook_ids": [
1,
2,
3
]
}
JSONReturns: BulkDeleteResponse with success, deleted_count, and message
delete_all_playbooks
Delete all playbooks (both user and agent). Cascading variant — wipes both stores.
response = client.delete_all_playbooks()curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_all_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY"Returns: BulkDeleteResponse with success, deleted_count, and message
delete_all_user_playbooks
Delete all user playbooks (user only, not agent).
response = client.delete_all_user_playbooks()curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_all_user_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY"Returns: BulkDeleteResponse with success, deleted_count, and message
delete_all_agent_playbooks
Delete all agent playbooks (agent only, not user).
response = client.delete_all_agent_playbooks()curl -X DELETE "${REFLEXIO_URL:-https://www.reflexio.ai}/api/delete_all_agent_playbooks" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY"Returns: BulkDeleteResponse with success, deleted_count, and message