/v2.
Base URL
10256. Behind a reverse proxy, it is your https:// address.
Authentication
Send a credential as a bearer token:Managing keys
A managing key is the credential for your own scripts. Make one in the dashboard at Settings > API keys. The key is shown once. A managing key:- Acts as you. It reaches the vaults you can use and stops working when you leave the organization.
- Belongs to one organization. You do not send an organization header with it.
- Carries one or both of two permissions.
managecovers every call a signed-in person can make except answering an approval.approvecovers answering an approval and nothing else. A new key hasmanageunless you choose otherwise. - Expires after 90 days unless you set another expiry.
- Cannot make another key. Making a key takes a signed-in session.
oc_ and has none of the three prefixes above, still works as a managing key.
Agent credentials
An agent credential belongs to one agent on one vault. The agent uses it to reach the gateway. On this API it opens the Agent self-service endpoints and nothing else. On an endpoint for a person, an agent credential answers403 with the detail person_required. The credential is valid, so signing in again does not help. Use a managing key or a session for that call.
401: an agent self-service endpoint answers unauthenticated to a managing key, a connect token or a session.
Session-only endpoints
Some endpoints take a signed-in session and refuse every key. Examples are making a key, renaming or deleting the organization, reading the audit log, approving an agent sign-up, and the organization’s shared items. A managing key there answers403 with the detail session_required. Each of these says so on its page.
Roles
A person has one role in an organization: owner, admin or member. An endpoint that needs more than member says so in its description. A caller below the role it needs gets403.
Paging
Every list takeslimit (1 to 100, default 50) and cursor, and answers in one shape:
nextCursor back as ?cursor= for the next page. It is null on the last page. A cursor is opaque and works only with the same list and the same filters. Anything else answers 400.
Idempotency
APOST takes an optional Idempotency-Key header of 1 to 255 visible characters. A retry with the same key, path and body returns the first answer for 24 hours, with the header Idempotent-Replayed: true.
- The same key with another path or body answers
422withidempotency_conflict. - The same key while the first call is still running answers
409. - An endpoint whose answer shows a secret once does not take the header and answers
400if you send it. Its page says so.
Errors
Every error has one shape:error.code, and on details[].issue where a code has more than one cause. See Errors for every code.
Errors on an agent’s calls through the gateway are a separate surface. See Gateway errors and Multiple accounts.
Editions
Endpoints with a Cloud pill exist on OneCLI Cloud only. Every other endpoint exists on OneCLI Cloud and on a self-hosted deployment. See Editions.Next steps
- Vaults: list and make vaults
- Items: add a key to a vault
- Agents: connect an agent and get its credential
- Permissions: set what agents may do with an item