Documentation
MyOpsAgent Overview API Reference Architecture Overview Customer Setup & Onboarding Guide Deployment & Environment Setup Guide Documentation Placement & Access Guide Error Codes & Operational Guarantees

Technical Documentation · Version 1.0

MyOpsAgent Error Codes & Operational Guarantees

This document defines the complete error handling model for the MyOpsAgent platform. It explains how errors are structured, what each error code means, and what operational guarantees customers can rely on when integrating with the MyOpsAgent API.

Clear, predictable error handling is essential for building reliable integrations. Whether you are a small business connecting a simple workflow or a large enterprise integrating MyOpsAgent into mission‑critical systems, this document ensures you understand exactly how the platform behaves under all conditions.

Error Response Structure

All errors returned by the MyOpsAgent API follow a consistent, structured JSON format. This ensures that client systems can reliably parse, log, and react to errors.

Standard Error Format

JSON
{
  "status": "error",
  "error_code": "INVALID_INPUT",
  "message": "Description of the error",
  "correlation_id": "abc123",
  "duration_ms": 0.7
}

Field Descriptions

Field Description
status Always "error" for failed requests.
error_code A machine‑readable code describing the error category.
message A human‑readable explanation of what went wrong.
correlation_id A unique identifier for tracing the request through logs.
duration_ms Time taken to process the request before failure.

The correlation_id is especially important for debugging and audit purposes. Customers should log it for every error.

Error Codes

Below is the complete list of error codes returned by the MyOpsAgent platform. Each code includes a detailed explanation and examples of when it may occur.

1. INVALID_INPUT

Description: The request body was malformed, missing required fields, or contained invalid data types.

Typical Causes:

  • Missing work_item or resources
  • Invalid JSON
  • Incorrect field types
  • Empty arrays where data is required
"message": "Invalid JSON payload"

2. UNAUTHORIZED

Description: The request did not include a valid API key or used a revoked key.

Typical Causes:

  • Missing X-API-Key header
  • Using a revoked API key
  • Using an API key belonging to another organisation
  • Using an admin key on a customer endpoint
"message": "Unauthorized: invalid or inactive API key"

3. RATE_LIMITED

Description: The organisation exceeded the allowed number of requests per minute.

Typical Causes:

  • High‑volume bursts
  • Misconfigured client retry logic
  • Batch processing without throttling
"message": "Rate limit exceeded"

4. HARD_USAGE_LIMIT_EXCEEDED

Description: The organisation exceeded its daily or monthly usage cap.

This is a hard stop to protect system stability and enforce billing limits.

Typical Causes:

  • Exceeding daily request quota
  • Exceeding monthly request quota
  • Running large batch jobs without monitoring usage
"message": "Hard usage limit exceeded"

5. NOT_FOUND

Description: The requested resource does not exist.

Typical Causes:

  • Attempting to revoke a non‑existent API key
  • Using an unknown route
  • Requesting a decision that does not exist
"message": "Route not found"

6. INTERNAL_ERROR

Description: An unexpected server error occurred.

This error indicates that the request was valid, but something failed internally.

Typical Causes:

  • Database connectivity issues
  • Unexpected exceptions
  • Unhandled edge cases
"message": "Internal server error"

Operational Guarantees

MyOpsAgent is designed to provide predictable, stable, and auditable behaviour under all conditions. The following guarantees apply to every request.

1. Every Request Has a Correlation ID

Every API response — success or failure — includes a correlation_id.

This allows:

  • End‑to‑end tracing
  • Debugging
  • Audit compliance
  • Cross‑system log correlation

2. All Decisions Are Logged

Every call to /decide is recorded in the audit log, including:

  • Request payload
  • Chosen resource
  • Confidence score
  • Reasoning factors
  • Timestamps
  • Correlation ID
  • Organisation ID

3. Deterministic Decisioning

Given the same inputs, the engine will always produce the same output. There is no randomness in the decision engine.

This is essential for:

  • Auditability
  • Regulatory compliance
  • Reproducibility
  • Debugging

4. Multi‑Tenant Isolation

Each organisation is fully isolated:

  • API keys
  • Usage limits
  • Audit logs
  • Decisions
  • Data access

No customer can ever access another customer’s data.

5. Graceful Failure

Even when errors occur, MyOpsAgent guarantees:

  • Valid JSON responses
  • Structured error codes
  • No HTML error pages
  • No stack traces
  • No ambiguous failures

6. Usage Enforcement

MyOpsAgent enforces:

  • Per‑minute rate limits
  • Daily usage caps
  • Monthly usage caps

7. High Availability Health Checks

The /health endpoint provides:

  • Service status
  • Timestamp
  • Correlation ID
  • Response time

Conclusion

This document defines the complete error handling and operational behaviour of the MyOpsAgent platform. By following these standards, customers can build robust, reliable integrations that behave predictably under all conditions.

The combination of structured error codes, deterministic decisioning, multi‑tenant isolation, and audit logging ensures that MyOpsAgent meets the needs of both small businesses and enterprise‑scale operations.