Authentication and permissions
Every call to the API needs a personal API key. A key acts as the person who created it, so the API allows exactly what that person may do in the app.
The REST API and the MCP server need an Enterprise plan on at least one product of the workspace. See Plans.
API keys
- Header. Send the key in
X-API-Keyon every request. MCP connectors such as ChatGPT and Claude.ai sign in with OAuth instead. - Format.
pk_live_followed by 64 hexadecimal characters. - Create and revoke keys in the app: sidebar MCP, then Create API key. The same page lists your keys with their last use and revokes them. Revoking takes effect on the next request. Creating a key needs an Enterprise plan; listing and revoking work on every plan.
- Stored hashed. The server keeps only a SHA-256 hash, so a lost key cannot be shown again: create a new one.
- No expiry. Keys stay valid until you revoke them, your account is deactivated, or you lose access to the workspace.
A request without a valid key answers 401 with {"error":"unauthorized"}.
Use a service account for integrations
Because a key acts as its creator, an integration stops working when that person leaves. For long-running integrations, invite a dedicated member (for example [email protected]), give it only the roles it needs, and create the key while signed in as that member.
OAuth for MCP connectors
ChatGPT, Claude.ai and other MCP clients that follow the MCP authorization spec sign in with OAuth 2.1 instead of an API key. You never configure these endpoints by hand: the client discovers them from the 401 answer of /api/mcp. They are listed here for client developers and security reviews.
| What | Address |
|---|---|
| Protected resource metadata (RFC 9728) | https://app.aio.opexcg.com/.well-known/oauth-protected-resource/api/mcp |
| Authorization server metadata (RFC 8414) | https://app.aio.opexcg.com/.well-known/oauth-authorization-server/api/auth |
| Issuer | https://app.aio.opexcg.com/api/auth |
| Dynamic Client Registration (RFC 7591) | POST /api/auth/oauth2/register |
| Authorization | GET /api/auth/oauth2/authorize |
| Token | POST /api/auth/oauth2/token |
| Revocation (RFC 7009) | POST /api/auth/oauth2/revoke |
- Flow. Authorization code with PKCE (
S256, required). Clients that register themselves are public clients (token_endpoint_auth_method: none); redirect URIs must match the registered ones exactly. The authorization response carriesiss(RFC 9207). - Resource.
resource(RFC 8707), when sent, must behttps://app.aio.opexcg.com/api/mcporhttps://app.aio.opexcg.com; anything else answersinvalid_target. - Scopes.
workspace: act as you in one workspace. Addoffline_accessto get a refresh token. - Consent. You sign in to OpexAIO, pick one workspace and approve. Every token of that approval works only in that workspace, with your roles and permissions there, like an API key created in it. Only workspaces with an Enterprise plan can be picked.
- Tokens. Opaque access tokens valid for 1 hour, sent as
Authorization: Bearer <token>. Refresh tokens last 30 days and rotate on every use; reusing an old one cancels the whole chain. Authorization codes are single use and expire after 5 minutes. OpexAIO stores only hashes of tokens. - Where tokens work. On
/api/mcpand on every v1 REST endpoint, under the same plan rules as API keys. - Errors. A missing, expired or revoked token answers
401withWWW-Authenticate: Bearer resource_metadata="…", error="invalid_token". The token and registration endpoints are rate limited per IP (429 too_many_requests). - Revoke. Disconnect the app in the app under sidebar MCP, tab Connected apps, or have the client call the revocation endpoint.
Workspaces
A key belongs to the workspace you were in when you created it, and every call works in that workspace. The X-Tenant-Id header and tenantId query parameter the web app uses to switch workspaces are ignored for API keys. To reach another workspace, switch to it in the app and create a key there.
GET /api/me returns the workspace of the key as tenantId and tenantName.
Roles and permission codes
What you may do depends on your roles in the workspace (for example admin, consultant_lead, consultant, client_admin, client_requester). Roles grant permission codes such as crm:record:read, timesheets:entry:create or pmo:task:update. Workspace admins can change which role holds which code under Roles and Permissions in the app.
GET /api/melists the codes you hold inpermissions.- Each endpoint in the API reference names the codes it needs. “Any of” means one of them is enough, for example your own entries with
timesheets:entry:update_ownor anyone’s withtimesheets:entry:update_others. - A missing permission answers
403with{"error":"forbidden"}, usually with the code that was missing:{"error":"forbidden","permission":"crm:company:create"}.
Some rules depend on the record, not only the code: client users see only their own company’s tickets and projects, consultants see only the projects they are assigned to unless they ask for scope=all, and edits of finalised time entries are locked. Those cases also answer 403 or 409; the reference describes them per endpoint.
A consultant who works in a customer’s workspace through a consultant grant never holds that customer’s CRM codes (crm:record:*): a customer’s sales data stays private to the customer’s own members.
Products
A workspace subscribes to products: timesheets, helpdesk, pmo (Project), crm, expenses and leave. GET /api/me lists the ones you can use in entitlements.
| Situation | Answer |
|---|---|
| The workspace does not have the product, or your admin limited your access to it | 402 {"error":"product_not_entitled","product":"crm"} |
| The product’s trial ended | Reads still work; writes answer 402 {"error":"product_read_only","product":"crm"} |
Products whose trial ended are listed in readOnlyProducts.
Plans
Each product has a plan: free, pro or enterprise. Programmatic access is an Enterprise feature, and a few features need a plan on a specific product:
| Feature | Needs |
|---|---|
REST API with an API key (every /api/... call) |
enterprise on at least one product of the workspace |
MCP server (/api/mcp) |
enterprise on at least one product that offers MCP tools |
Receipt capture (POST /api/expenses/capture) |
Expenses pro |
A missing plan answers 402 with tier_required. Below Enterprise, every REST call with an API key answers {"error":"tier_required","product":"pmo","feature":"api","required":"enterprise"} (product names the first product the workspace has), and /api/mcp answers the same with "feature":"mcp". A product whose trial ended still counts: its Enterprise plan keeps reads working.
The Enterprise plan of any one product unlocks the API for the whole workspace. It does not lift the other rows: receipt capture still needs Expenses pro.