Docs menu

Secure your workspace API

Goal: Choose who can call your workspace API at /ox-api: your team, the people and jobs of an App Identity you trust, or both. Then say which access rights an App Identity caller needs, endpoint by endpoint.

This is the Manage this API section of APIs -> API Manager, opened with the Manage button on the bar: "Choose who can call your workspace API at /ox-api: your team, the App Identities you trust, or both."

Who can change it

Only the workspace owner, or someone with the Workspace.API.Manage right, can change these settings. Only they see the Manage button. The server checks the same rule on every save, and refuses anyone else with OXAPI_CHANGE_NOT_ALLOWED. Workspace.Access.Manage on its own does not change them.

Anyone else who sees one of these sections reads the note: "Only the workspace owner, or someone with the Workspace.API.Manage right, can change this."

Thinky and agents cannot propose a change to the API access settings on this page. The automated jobs an agent may propose are accepted in the App Identity window, not here.

The three modes

The section shows the saved mode (Saved as:) and a Mode choice:

ModeWhat the window says
Team"Your team's OpenX sign-ins and API keys can call it. This is the default."
Hybrid"Your team can call it, and so can people and jobs with an access token from an App Identity you trust."
App Identity"Only people and jobs with an access token from an App Identity you trust can call it. Team sign-ins and team API keys are turned away."

A workspace that never chose a mode is in Team.

Hybrid and App Identity are left out of the choice, not greyed out, until one of your App Identities is ready: "Hybrid and App Identity appear here once one of your App Identities is ready for app calls. Open Cloud, then App Identity, and use Configure for app calls." Open App Identity set-up takes you there. A workspace already saved in one of those modes keeps it listed, so you always see the mode you are in.

In Hybrid and App Identity the window also says: "With App Identity, the access cards you assign decide what each caller can reach. Every call from a directory token is checked against the cards of the person or job making it." That sentence is older than the access rules. What an App Identity caller can reach is now decided by the rules in Who may call, for App Identity callers. The caller's access cards still matter: they give the rights those rules are checked against.

What each mode admits

CallerTeamHybridApp Identity
A team sign-in or team API keyYesYesNo (401)
A person with a token from a trusted App IdentityNo (401)YesYes
An automated job of a trusted App IdentityNo (401)YesYes
A hosted workbench address, with a team keyYesYesNo (401)
A hosted workbench address, with an App Identity tokenNo (401)YesYes

At a hosted workbench the API's own check turns those callers away first, with the same plain 401. The workbench's 403s (WORKBENCH_TEAM_MODE_OFF, WORKBENCH_APP_MODE_OFF) are a second check that a caller normally never sees.

Every refusal before the API knows the caller answers the same plain 401, so an outsider learns nothing about the workspace. What a person or job let in through an App Identity can then call is set by the access rules below, judged on the rights of their access cards in this workspace. How an app makes these calls is on Call the API from your app.

A team key's rights are not enforced route by route today. A call outside them is logged, not refused. The API Manager says the same in its key view: "An API key calling outside its rights is not yet refused, so treat the list as a guide."

Trusted App Identities

In Hybrid and App Identity, tick one or more Trusted App Identities: "Pick one or more App Identities that are ready for app calls." Tokens from any other directory are turned away. An App Identity that has stopped being ready is marked: "Not ready for app calls. Untick it, or run Configure for app calls again."

People can sign in through the directory's own sign-in app. To accept sign-ins through another app in the same directory, register it under Sign-in apps in the App Identity window, and Revoke it there to stop accepting them. Registering an app is trust only: "People signing in through one of them call as themselves, on their own access cards."

Default job token lifetime

Default job token lifetime (minutes) is optional: "Used for job tokens from OpenX's token swap when a job sets no lifetime of its own. Sign-in tokens keep the lifetime their directory gives them." Any whole number above zero; leave it blank for none. A swapped job token never outlives the directory token it was swapped for.

Save

Save access settings saves the mode, the trusted App Identities and the lifetime at once, and answers Saved. It saves only these settings, never the rest of the workspace, and it does not wait for Deploy. For an App Identity caller, the API reads the saved settings again on each call it lets in, so a revoke bites on the next call; a refusal may come from a copy up to 30 seconds old, so a caller you have just allowed can take that long to get in.

MessageWhen
Choose at least one App Identity to trust. Hybrid and App Identity modes need one or more.Hybrid or App Identity with none ticked
The job token lifetime must be a whole number of minutes, above zero.A lifetime that is not
The access settings were not saved. Check your connection, then try again.The save never reached the server
The access settings were not saved (HTTP ...).The server refused it without a reason of its own

A refusal from the server shows its own sentence; the save refusals are listed on API refusals.

Who may call, for App Identity callers

When the API takes App Identity tokens (Hybrid or App Identity), the Manage section also shows Who may call, for App Identity callers: "These rules decide what people and jobs signed in through a trusted App Identity may call. Rules stack: a call must pass the whole API, its tab and its endpoint, unless a level replaces the settings above it. Team sign-ins keep OpenX's own rights."

The rules name the access rights of your workspace. They never give a caller a right: a person or job holds rights through its access cards, and a rule only says which of them a call must carry. There is no per-app list of rights.

For these callers only these rules count. The rights an endpoint asks for in its own code are not checked.

The levels

Every level uses the same row: a state, then, when it is Open, the rights it asks for.

LevelStatesWhat it covers
The whole APIOpen or ClosedEvery endpoint that has no setting of its own
A tabInherit, Open, ClosedThe endpoints on that tab of the API Manager
An endpointInherit, Open, ClosedThat one endpoint
  • Open with no rights asks for nothing: any account of the App Identity gets in. Closed refuses every call at that level. Inherit leaves the level above in charge.
  • An Open level can ask for one or more access rights, picked from the workspace's own rights. Switch between All of these (the caller must carry every one) and Any of these (one is enough).
  • At a tab or an endpoint that is set, Replace the settings above is off by default, so the levels stack and a call must pass each of them in turn. Switch it on and that level alone decides.
  • The window shows what applies from above under Also applies.

While the whole API is Open with no rule, the window warns: "The whole API is open with no rule: every endpoint with no setting of its own can be called by every account of the App Identity, the access routes included." The warning never blocks a save.

One set, or one per App Identity

Choose One rule set for all App Identities or A rule set per App Identity. With one set per App Identity, each identity starts with a copy of the shared set (Set its rules, starting from the shared set). An App Identity with no set of its own reads "Closed until you set its rules.", and its callers are refused until you set them. Use one shared set goes back, and asks Which set becomes the shared one.

The tabs and endpoints you can set come from the API catalogue your workspace serves; a rule saved for one that is no longer served is listed as "Set here, but no longer served", with Clear.

Save the access rules

Save the access rules saves only what you changed and answers "Access rules saved." This is separate from Save access settings, and it does not wait for Deploy either. If it does not reach the server: "The access rules were not saved. Check your connection, then try again."

Until you save a set of rules, the window says: "Only people with access in this workspace can call it until you set rules." Until then a person with no access right in this workspace is turned away with the plain 401. Once you have saved rules, even an Open whole API with no rule admits a caller with no card, so the rules you set are the whole answer. An admitted job is not held to this wait.

What a refused call sees

For an endpoint in the API catalogue, a caller from an App Identity is judged on its own access cards:

StatusCodeWhen
403OXAPI_ENDPOINT_CLOSEDA level is Closed, or the caller's App Identity has no set. The message names which level
403OXAPI_REQUIRED_RIGHTS_MISSINGA rule fails. MissingRights lists the rights, and the message says every one or at least one is needed
503OXAPI_RIGHTS_UNREADABLEThe caller's rights could not be read; try again

The catalogue the caller reads at GET /ox-api/openapi follows the same rules, so it lists only the endpoints the caller's App Identity allows it. The owner, or a team caller with Workspace.API.Manage, still lists every endpoint, so you can set rules for all of them. A team sign-in or key is not judged by these rules: it keeps OpenX's own rights. The full list of refusals is on API refusals.

Split access by app

There is no split-access switch any more. A save that still carries one is accepted and the switch is dropped, and a switch stored from before is cleared on the next save.

Sign-in apps

The directory's own sign-in app is accepted as soon as you trust the App Identity. Other sign-in apps of the same directory are registered in the App Identity window, under Sign-in apps, with Register a sign-in app (a name and the app's client ids) and Revoke. A registered app is trust only: people signing in through it call as themselves, on their own access cards and the rules above. It carries no rights of its own. OpenX never creates the registration in your directory; you make it there.

Automated jobs are added and changed in the same window, and so are the access cards a job calls on.

The MCP server is apart

"The OpenX MCP server keeps its own team sign-in and is not affected by this setting." Open the OpenX MCP server takes you there. See MCP Server.

Next steps

On fathym.com: OpenX API Manager →

On this page