API
REST endpoints for managing agents and executions:
API views for the agency app.
- agency.api.views.serializer(cls)[source]
Get the default model serializer.
- Parameters:
cls – Model class to create serializer for
- Returns:
ModelSerializer class for the given model
- agency.api.views.provider_serializer()[source]
Provider row plus key/sync hints (never the secret itself).
- agency.api.views.model_serializer()[source]
Model row with temperature / num_ctx mirrored from
metadata.
- agency.api.views.agent_serializer()[source]
Agent serializer with nested model/tools for explorers and M2M write.
- agency.api.views.mission_serializer()[source]
Mission serializer with loop fields and read-only is_loop.
- agency.api.views.execution_serializer()[source]
List/detail serializers for Execution (Mission Control explorers).
- agency.api.views.task_view_set()[source]
List/retrieve Celery tasks (newest first for the UI monitor).
- agency.api.views.execution_view_set()[source]
List/retrieve Execution with nested Result payload on retrieve.
- class agency.api.views.SystemInfo(**kwargs)[source]
Bases:
APIViewHost versions plus inference (Ollama GPUs, ComfyUI) when deployed.
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
- schema
- options(request, *args, **kwargs)
Handler method for HTTP ‘OPTIONS’ request.
- class agency.api.views.Version(**kwargs)[source]
Bases:
APIViewReturns version and system information.
- schema
- class agency.api.views.MePrefs(**kwargs)[source]
Bases:
APIViewCurrent user’s Mission Control preferences (workspace + Desktop).
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
- schema
- class agency.api.views.MeMedia(**kwargs)[source]
Bases:
APIViewOperator Media now-playing for secretary tools (not a bus producer).
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
- schema
- agency.api.views.view_set(cls, edit=None, actions=None, serializer_class=None)[source]
Get the default model view set.
- Parameters:
cls – Model class to create viewset for
edit – If False, only list/retrieve. If True, full CRUD. If None, uses actions.
actions – List of action names to include (e.g., [‘list’, ‘create’])
serializer_class – Optional custom serializer class. If None, uses default serializer.
- Returns:
ViewSet class for the given model
- agency.api.views.agent_test(request, *args, **kwargs)[source]
Test an agent with a message.
- Parameters:
request – HTTP request object
agent_id – UUID of the agent to test
- Returns:
Response with agent test result or error message
- agency.api.views.mission_dispatch(request, *args, **kwargs)[source]
Dispatch a mission with an agent.
- Parameters:
request – HTTP request object with agent_id in body
mission_id – UUID of the mission to dispatch
- Returns:
Response with execution_id, thread_id, and task_id
- agency.api.views.tool_serializer()[source]
Tool serializer with optional uploaded icon (multipart).
- agency.api.views.photo_serializer()[source]
Photo serializer: multipart file + catalog card fields.
- agency.api.views.tool_sync(request, *args, **kwargs)[source]
Sync
Toolrows fromagency.toolscode exports.
- agency.api.views.provider_sync(request, *args, **kwargs)[source]
Sync models from a provider API into local
Modelrows.
- agency.api.views.document_reindex(request, *args, **kwargs)[source]
Queue Celery
index_documentfor an existing document.
- agency.api.views.document_extraction(request, *args, **kwargs)[source]
Latest extraction: pages + chunk previews (admin-parity).
- agency.api.views.workspace_search(request, *args, **kwargs)[source]
Similarity search against the workspace Chroma collection.
- agency.api.views.workspace_ask(request, *args, **kwargs)[source]
RAG ask: retrieve + LLM answer with source nodes.
- agency.api.views.user_serializer()[source]
User serializer for staff explorer (no password hash exposure).
- class agency.api.views.UserPrefsStaff(**kwargs)[source]
Bases:
APIViewStaff-only access to any user’s preferences.
- permission_classes = [<class 'rest_framework.permissions.IsAdminUser'>]
- schema
- options(request, *args, **kwargs)
Handler method for HTTP ‘OPTIONS’ request.
Agency API urls definition.
- agency.api.urls.router = <rest_framework.routers.SimpleRouter object>
DRF router for the API endpoints.