Developer Documentation ยท Version 1.0
The MyOpsAgent API provides secure, multi-tenant access to the MyOpsAgent decision engine. It is designed to be simple enough for small organisations to integrate quickly, yet robust enough to support enterprise-scale operational workloads.
This reference describes all available endpoints, authentication requirements, request and response formats, error structures, and operational guarantees. It is the definitive contract between your systems and the MyOpsAgent platform.
All API interactions are performed over HTTPS and return JSON-encoded responses.
https://myopsagent.com/api.php
All requests use the route query parameter to specify the operation.
POST https://myopsagent.com/api.php?route=decide
MyOpsAgent uses API keys to authenticate requests. There are two types of keys:
These keys authenticate requests made by your organisation to the decide endpoint.
Include them in the request headers:
X-API-Key: <your_api_key>
This key is used to manage organisations and their API keys. It should be stored securely and never exposed to customer systems.
X-Admin-Key: <admin_key>
The admin key allows:
All POST requests must include the following header:
Content-Type: application/json
The MyOpsAgent API exposes four primary endpoints:
/?route=create_api_key/?route=revoke_api_key/?route=decide/?route=healthEach endpoint is documented in detail below.
/?route=create_api_keyCreates a new API key for an organisation.
X-Admin-Key: <admin_key>
Content-Type: application/json
{
"org_id": 1,
"label": "Production Key"
}
{
"status": "ok",
"api_key": "0783392d76aaefcc916d89586670f19a718c6ef2c4d475fa51fbc92dc18bfbe6",
"org_id": 1,
"label": "Production Key",
"correlation_id": "a6f2ae35d15b1c34283c7cbcb93859c5",
"duration_ms": 1.3
}
/?route=revoke_api_keyRevokes an existing API key. Once revoked, the key can no longer be used to authenticate requests.
X-Admin-Key: <admin_key>
Content-Type: application/json
{
"api_key": "0783392d76aaefcc916d89586670f19a718c6ef2c4d475fa51fbc92dc18bfbe6"
}
{
"status": "ok",
"api_key": "0783392d76aaefcc916d89586670f19a718c6ef2c4d475fa51fbc92dc18bfbe6",
"correlation_id": "f9303db0a443c520117e8d72dfac93a8",
"duration_ms": 0.9
}
/?route=decideThis is the core endpoint of the MyOpsAgent platform. It evaluates a work item, available resources, constraints, and context, and returns the optimal operational decision.
X-API-Key: <your_api_key>
Content-Type: application/json
The request body contains four main sections:
work_itemresourcesconstraintscontext{
"work_item": {
"id": "WI-123",
"required_capabilities": ["temperature", "pressure"],
"location": null,
"metadata": {}
},
"resources": [
{
"id": "engineer-001",
"capabilities": ["temperature", "pressure"],
"location": null,
"availability": null,
"metadata": {}
}
],
"constraints": [],
"context": {
"current_time": "2026-01-16T17:47:02Z",
"org_rules": {},
"environment": {}
}
}
The response includes:
{
"decision_id": "ccf1e43c-8b7f-4e1a-bf2a-9f4d8c1a2e7f",
"org_id": 1,
"work_item_id": "WI-123",
"chosen_resource_id": "engineer-001",
"alternatives": {},
"confidence": 0.5,
"reasoning_factors": [
{"factor": "capability_match", "weight": 0.5, "value": 1},
{"factor": "distance", "weight": 0.3, "value": 0.5},
{"factor": "availability", "weight": 0.2, "value": 0.5}
],
"engine_version": "v1.0.0",
"correlation_id": "d6b6ada7-3f2c-4b1e-8c5a-9e1f2b3c4d5e",
"duration_ms": 4.98
}
Each organisation has:
If limits are exceeded, the API returns:
429 Too Many Requests
With error code:
HARD_USAGE_LIMIT_EXCEEDED
/?route=healthA simple health check endpoint.
{
"status": "ok",
"service": "myopsagent",
"time": "2026-01-16T17:47:02Z",
"correlation_id": "f9303db0a443c520117e8d72dfac93a8",
"duration_ms": 0
}
All errors follow a consistent structure:
{
"status": "error",
"error_code": "INVALID_INPUT",
"message": "Description of the error",
"correlation_id": "abc123",
"duration_ms": 0.7
}
A full list of error codes is provided in the next document.