Skip to content

Set up a service account

A service account is a named machine identity for a CI pipeline or an integration that works with your organization’s models without a person signing in. It belongs to the organization rather than to a member, so it keeps working as people come and go, and an organization admin manages it from org settings.

The account is the identity; its credentials are separate and replaceable. Rotating a credential therefore never changes who the account is: its name, its access, and everything it has ever changed in a model stay attached to the account.

  • You are an Admin of the organization. Only admins see the Service accounts tab.
  • Your organization’s subscription includes API access. Service accounts are part of the Trial and Pro plans; Basic does not include them.

A service account does not use one of your organization’s seats.

  1. Select Organizations in the left navigation and open your organization.

  2. Open the Service accounts tab.

  3. Select New service account.

  4. Enter a Name (for example ci-pipeline) and, optionally, a Description of what the account is for. The name is what appears in a model’s history for every change the account makes, so choose something you will recognize there.

  5. Choose an Access level. See Access levels below.

  6. Leave Allow this account to delete models switched off unless the account genuinely has to destroy models.

  7. Select Create.

The account appears in the list with its access, its status, and a Credentials button. It cannot authenticate yet: an account starts without credentials, and you add one in the next section.

An account holds exactly one level, and the levels are cumulative, so an account raised to Write already holds everything Read covers; there is never a reason to grant two levels.

Level What the account can reach
Content The current published state of the organization’s shared models: the model itself, its content bundles and media, and reference data. No history, no collaboration state.
Read Everything Content covers, plus every read view: elements, diagrams, versions, commits, validation, exports.
Write Everything Read covers, plus creating and editing shared models: elements, diagrams, imports, mappings, saving changes to a draft and committing it, and creating and merging branches.

To change either later, select Update access on the account’s row. A change applies to the account’s next request, so narrowing an account stops an integration that relied on the wider level straight away. Its identity, its credentials, and its history are unaffected.

Beside New service account the page shows what the organization holds against what its plan allows, for example 2 of 10 service accounts. On a plan without API access it reads 0 service accounts, none included in this plan.

Create one past the limit and the refusal names your plan and what it allows, for example “The PRO plan allows at most 10 service accounts. Delete one before creating another.” or “The BASIC plan does not include API service accounts.” Deleting an account frees its slot; disabling one does not.

Select Credentials on the account’s row. Two kinds sit side by side, under Secrets and Federation. An account may hold both, and either one produces the same token with the same access.

  • Use Federation when the integration runs in GitHub Actions. Nothing is stored as a secret on either side, which makes it the better choice for anything that writes or deletes.
  • Use a secret when it runs anywhere else, for example a scheduler or a server script, where a plain HTTP request has to be enough.
  1. On the Secrets tab, note the Client ID. It is the account’s own identifier, it never changes, and Copy client ID puts it on your clipboard.

  2. Select Issue secret.

  3. Optionally enter a Label (for example ci-runner-2026) so you can tell your secrets apart later.

  4. Choose how long it is Valid for: 30, 60, 90, 180 (the default), or 365 days (the maximum). The dialog shows the exact date it will expire on.

  5. Select Issue secret.

Treat it as a server-side secret: keep it out of browser code, mobile apps, and anything else a user can read.

The list then shows each secret by its label and its fingerprint (the short public prefix that identifies it), with when it was issued, when it expires, and when it was last used. A secret nearing its expiry is flagged in advance, for example Expires in 12 days, so a pipeline does not fail unannounced.

An account can hold up to 5 active secrets at once, which is what makes rotation seamless: issue the new secret, deploy it, then revoke the old one. The account keeps its identity, its access, and its history throughout.

Instead of storing a secret, you can trust the workflow itself. GitHub signs a short-lived token stating which repository, branch, and environment a workflow is running in. ModelDesk checks that signature against the account’s trust rules and issues its own token in return, so no secret is stored on either side and there is nothing to leak or rotate.

  1. Open the Federation tab and select Add trust rule.

  2. Leave Provider on GitHub Actions.

  3. Enter the Repository as owner/repo, for example acme/models. A rule is always about one repository.

  4. Pin a Branch or tag, an Environment, or both. Use the full form GitHub emits, refs/heads/main, not a bare main, which matches nothing.

  5. Leave Allow pull-request runs switched off unless the pipeline genuinely needs it. Pull-request runs include runs from forks.

  6. Select Add trust rule.

Then wire the workflow: expand Wiring this into a GitHub Actions workflow below the list and copy the steps. They already carry the details that are easy to get wrong, including requesting the token for this platform, keeping the minted token out of the build log, and failing the step when the exchange fails instead of carrying an empty value forward.

The first successful run pins the repository’s immutable id onto the rule, after which the list shows id pinned beside it. Renaming the repository then keeps the rule working, and a different repository registered under the old name cannot use it.

An account can hold up to 10 active trust rules.

Whichever credential it holds, an integration always does two things: exchange the credential for a token, then call the API with that token.

With a secret, the exchange is a single request to the sign-in service:

Terminal window
curl -s https://auth.modeldesk.io/oauth2/token \
-d grant_type=client_credentials \
-d client_id=47b9fd65-a27d-45ec-9eb0-5b8bab0bf2dd \
-d client_secret=mdsk_...
{
"access_token": "eyJraWQiOiJt...",
"token_type": "Bearer",
"expires_in": 300
}

The access_token then goes on every API call as a Bearer token:

Terminal window
curl -s -H "Authorization: Bearer eyJraWQiOiJt..." \
https://api.modeldesk.io/models/<model-id>

The workflow snippet on the Federation tab does the same two steps, with the workflow’s own signed token in place of the client ID and secret.

What the account can reach. Only your organization’s Shared models, and only in the standards your subscription covers, within the account’s access level. An Individual model is never visible to a service account, whoever created it, and a model the account creates is always Shared. Anything outside its reach is reported as not found rather than as refused.

Changes are attributed. A change made by a service account appears in the model’s History, and under Recent activity on its Overview page, like any other change: with the account’s name and a small robot icon beside it. That stays true after the account is deleted.

Action What it does
Update access Changes the access level or the delete permission. Applies to the account’s next request.
Disable Switches the account off at once, and reversibly. Even a token minted seconds earlier stops working on its next request. Enable switches it back on.
Delete Permanent. Every integration using the account stops working straight away, the slot against your plan’s limit is freed, and the name becomes available for a new account. Changes the account made keep its name in the history.
Revoke a secret Cannot be undone. New tokens are refused immediately; a token already minted stops working within 5 minutes.
Revoke a trust rule The same: workflows matching that rule can no longer authenticate, and tokens already minted stop within 5 minutes.

Revoked and expired credentials stay in the list, greyed out, as a record of what was once in use. Before revoking one, check Last used on it to see whether anything still depends on it. Read that as a rough signal rather than as a request log: it is updated at most once every few minutes.

  • The token request answers 401 invalid_client. The client ID or the secret is wrong, the secret was revoked, or the account is disabled or deleted. These all answer identically on purpose. Check the account’s status in org settings first, then check that the pipeline holds the current secret.
  • The token request says the secret has expired, naming the secret and the date. This is the one failure that explains itself. Issue a new secret, deploy it, then revoke the old one.
  • A GitHub Actions run cannot exchange its token. The response names a category. issuer usually means the workflow is not requesting a signed token at all, because the job is missing id-token: write in its permissions block. binding usually means a bare main was entered where the rule needs refs/heads/main. repository means no rule covers that repository, or the run is a pull request and no rule allows those.
  • The API answers 403 with insufficient_scope. The account’s access level is too low for that call. Reading and changing a model differ only in the method used, so a Read account can fetch a model it cannot edit. Raise the level with Update access, or grant deletion separately if the call deletes something.
  • The API answers 401 although the token was just minted. The account was disabled or deleted after the token was minted. ModelDesk re-checks the account on every request, so a live token stops with it.
  • A model the account should see is not found. It is an Individual model, which no service account can see, or your subscription is not active or does not include that model’s standard.