Prerequisites:
- Some areas of the Administration API are part of the Enterprise plan: creating, updating, and deleting workspaces, git repositories, warehouse connections, environments, environment variables, integrations, notifications, and usage. On other plans, those operations fail with
PLAN_UPGRADE_REQUIRED. Every other operation works on every plan. See Plans. - An API key that holds the capability groups of the operations you call.
Authentication
Send every request as aPOST to your API endpoint, with the Content-Type: application/json header and your API key. The Administration API uses the same endpoint as every other Paradime GraphQL operation. Use the endpoint that Paradime shows when you generate the key. It has the form https://<host>/api/v1/<company_token>/graphql, and the host depends on your region.
The schema calls an account API key a company API key, for example in
CompanyApiKey and createCompanyApiKey. The keys that createApiKey and createCompanyApiKey return are bearer tokens.
uid, name, and createdAt of its workspace, so this request is a quick check of the key and the header:
Target a workspace
- Workspace API key. The key always acts on its own workspace. It can’t reach another workspace, and it needs no
X-Paradime-Workspaceheader. - Account API key. The key reaches the workspaces you selected when you created it. For an operation on one workspace, send
X-Paradime-Workspacewith the workspace UID:- Without the header, the operation fails with
WORKSPACE_REQUIRED. - With the UID of a workspace that the key was not granted, the request fails with
MISSING_CAPABILITY.
- Without the header, the operation fails with
workspace(workspaceUid: "...") reads one workspace, and workspaces lists every workspace the key reaches. The fields under a workspace read that workspace, so one query can read several workspaces without the header.
The account-level operations need an account API key and no header: createWorkspace, updateWorkspace, deleteWorkspace, companyApiKeys, createCompanyApiKey, revokeCompanyApiKey, and disconnectSlack. A workspace API key that calls one of them gets MISSING_CAPABILITY.
The workspace UID is the value that the Company & Workspace token page calls workspace_token. You can also read it from workspaces.
Capability groups
You choose what a key can do when you create it: in Settings > API Keys, under Capabilities, or in thecapabilityGroups input of createApiKey and createCompanyApiKey. Each capability group grants a set of capabilities, such as environments:read. The reference pages name the capability that each field needs.
The Administration API adds these groups. The key creation screen shows the groups that your plan includes. Groups for Enterprise areas show only on the Enterprise plan.
Git repository admin also covers the older
gitRepository query and setGitRepository mutation. These older groups also unlock some Administration API operations:
To see the capabilities a key holds, read
apiKeyIdentity { capabilities }.
Errors
Errors come back in the top-levelerrors array, as in any GraphQL API. Every Administration API error has a code in extensions.code. An error about the input also has extensions.field: the path to the input field, as a list. Make your scripts branch on the code, not on the message: the message text can change.
["input", "variables", "0", "name"].
Errors that occur while an operation runs come back with HTTP status
200. Two checks run before the operation and use other statuses: the rate limit (429) and the query limits (400).
An error in one field does not stop the other fields. A field that the key can’t read returns null with its own error, and the rest of the query returns data. Check errors even when data holds values.
Rate limits
Each API key has two budgets over a sliding window of 60 seconds:
The limits apply to every request that the key sends to the endpoint, the older operations included. When a key is over a budget, Paradime does not run the request. The response has HTTP status
429, a Retry-After header in seconds, and a RATE_LIMITED error with the budget and retryAfter:
Query limits
Paradime checks the size of a query before it runs any part of it:
A query over a limit fails with HTTP status
400, no data, and one VALIDATION_FAILED error for each limit it exceeds, for example The query uses 31 aliases; the limit is 30. A fragment that you spread twice counts twice.
Introspection
The endpoint does not answer introspection queries:__schema and __type fail with Introspection disabled. __typename works, so you can tell the members of a union apart. To browse the schema, use the API reference, for example the Workspace type.
Pagination
Lists are connections, in the shape that the Discovery API uses:edgesholds one page. Each edge has acursorand anode, in the order that the connection’s description gives.pageInfotells you if there is another page (hasNextPage) and where it starts (endCursor).totalCountcounts the items on all pages.
first: how many items to return. The default is 100 and the maximum is 500. A larger value returns 500 items.first: 0returns onlytotalCount.after: theendCursorof the previous page. A cursor that the API did not return fails withVALIDATION_FAILEDonafter.
after set to the endCursor you received. Stop when hasNextPage is false.
Async jobs
Some mutations start work that takes longer than one request. They return anAdminJob at once, and the work continues in the background:
Poll
adminJob with the job id until status is SUCCEEDED or FAILED:
Treat
QUEUED and RUNNING the same: the job is not finished. result is a union, one type for each kind, so select its fields with an inline fragment:
Example response
Example response
- A job that is still running when its time limit ends reads as
FAILED, with the codeINTERNALand the reasonThe job did not finish within its time limit. - If Paradime finds an error before the work starts, such as an input that is not valid, the mutation itself fails. The job reports only what happens after the work starts.
- Only the API key that started a job can read it, and only in the workspace where it runs. With an account API key, send that workspace’s UID in
X-Paradime-Workspace. Another key, or another workspace, getsNOT_FOUND. - Reading a job needs no capability group of its own.
- Poll every few seconds. Each poll counts against the key’s read budget.
Secrets
Secrets go in, and they never come out. No query returns a password, a private key, a token, or a variable value.- Reads tell you that a secret is set, and sometimes when it changed or a short hint. Look for
has…fields such ashasPasswordon warehouse connection settings,isSetandupdatedAton environment variables,secretUpdatedAton Trigger URLs, and…Hintfields such asaccessKeyIdHinton secret managers. - An update can leave a secret out, and the stored value stays. If a warehouse connection update changes the warehouse type or where the connection points, such as the Snowflake account, send every required secret again. Otherwise the update fails with
VALIDATION_FAILED. - To read a value, use the operation made for it, with its own capability group. Paradime writes every read to the audit log. The one such operation is
revealEnvironmentVariable, which needs Environment variable values viewer. - Some values show once, in the response that creates them: the
tokenof a new API key (createApiKey,createCompanyApiKey), and thesecretof a Trigger URL (createTriggerUrl,rotateTriggerUrlSecret). Store them at once. No query returns them again. - Many secret inputs take a reference to a secret in AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager in place of the value. To set up the secret manager, see Integrations.
Pending user action
Some steps need a person in a browser: for example, to install the Paradime GitHub App, to connect Slack, or to connect an account through OAuth. The API does not fail on these steps. It reports the statusPENDING_USER_ACTION and, if one exists, a URL for that person to open:
An API call can’t finish these steps. Send the URL to the person, then read the object again until its status changes. The setup status checklist lists every step that waits for a person.
Audit log
Every write through the Administration API adds an entry to the audit log of the workspace it changes, with the API key as the actor. The entry’s metadata names the key inactor_api_key: its key_type (company or workspace), its id, and its name. Read the entries in the app, or with the Audit Logs API.
A write that changes nothing, such as the same input sent twice, adds no entry. revealEnvironmentVariable adds an entry for every value it reads.
Idempotency and natural keys
Operations name objects by natural keys, not by internal IDs: a workspace by itsuid, an environment, a schedule, or an agent by its slug, a variable by its name, and a warehouse connection by its scope, environment slug, and connectionId. A slug never changes after you create it.
You can send every write again safely. The verb tells you what a second call does:
A write that changes nothing also starts no redeploy and adds no audit entry. Some operations work differently:
createUseranswers an email that already belongs to a user or to a pending invitation withCONFLICT.createApiKeyandcreateCompanyApiKeyanswer a name that a working key already has withCONFLICT. A retry can’t create a second key whose token nobody saw.- A
create…that can make a slug for you, such ascreateEnvironment, creates a new object on every call when you leave out the slug. Send your own slug to make the call safe to retry. rotateGitDeployKeyandrotateTriggerUrlSecretmake a new key or secret on every call.
Versioning and deprecation
The Paradime GraphQL API has one schema, with no versions. It changes by addition: new types, fields, and operations can appear at any time. A client gets only the fields it selects, so an addition does not break it. Paradime removes a field only after a deprecation. The deprecation reason gives the removal date in the formRemoval: YYYY-MM-DD, at least three months after the deprecation ships. The API reference shows deprecated fields with their reason.
Related
- Administration API overview: the areas and how they differ from the older operations.
- API keys: create account and workspace API keys in the app.
- Python SDK: Administration API: typed errors, pages as iterators, job waits, and rate limit retries.
- Paradime CLI:
paradime admin: the same operations from the terminal.