API Reference

The MyOpcs API is organized around REST with predictable resource-oriented URLs, JSON request bodies, and standard HTTP response codes.

Base URL

All API requests should be made to:

https://api.myopcs.com/api

APIs

Response Format

All API responses are returned in JSON format with a consistent structure:

Success Response

{}JSON
{
  "data": {
    "id": "prod_abc123",
    "name": "My Product"
  },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Paginated Response

{}JSON
{
  "data": [...],
  "pagination": {
    "cursor": "next_page_cursor",
    "hasMore": true
  }
}

Request Headers

The following headers are commonly used in API requests:

AttributeTypeDescription
AuthorizationstringBearer token for authentication (required)
Content-Typestringapplication/json for POST/PATCH requests
AcceptstringDefaults to application/json