roark config apply.
This is how you run Config as Code at scale: one git repo, reviewed by PR, that provisions projects, onboards people, and configures each project, for the entire organization.
The two scopes
There is one apply surface (/v1/config, roark config apply); the credential decides what you may declare:
A project key cannot declare
kind: project; an organization key declares only kind: project (project-scoped resources go under a project’s resources:).
Prerequisites
- An Organization API key. An org Owner or Admin creates one under Settings → Organization → API keys (“New Key”). The full key is shown once, so store it in your secret manager. It carries
org-config:applyand the project/member/api-key management permissions. - A git repository to hold your config.
- The Roark CLI (recommended):
npm install -g @roarkanalytics/cli.
An organization key is an admin credential: it can create projects, manage members, and mint per-project keys across your whole organization. Treat it like one, and prefer a read-only key (below) for CI dry-runs.
The kind: project resource
One file per project. A project declares its identity, its members, and (optionally) its own resources.
roark/projects/payments-prod.yaml
nameis the stable identity (configKey = project/<name>) and the seed for the project slug.displayNameis the human name in the UI (defaults toname).membersare reconciled by email: a new email is invited, an existing member’s role is updated, and (with prune on) a config-managed member you remove is removed. An existing UI or SSO member you declare is adopted rather than duplicated. Roles are the project roles:OWNER,ADMIN,MEMBER,VIEWER.resourcesis the project’s own resource set, exactly the shapes documented on the other Config as Code pages (agents, personas, flows, metrics, collectors, simulation plans, alerts). They are applied into this project through the same reconcile, so one organization key manages an entire org’s config in one tree.
Prefer SCIM + SAML SSO for day-to-day user lifecycle at scale (automatic provisioning/deprovisioning and project auto-join from your IdP). Use
members: here for the projects and roles you want declared in git; the two compose. See Okta SSO.Deploying
Same commands as project config; the organization key is what puts them in org mode.1
Authenticate with the organization key
2
Preview
3
Apply
--no-prune) removes config-managed projects and members you deleted from git.Raw HTTP
The bundle and endpoints are the same as project config; you just send it with the organization key.status (applied / skipped / failed) and, for a project, its id. Member and nested-resource changes carry the owning project:
Apply semantics
- Identity is by name (
project/<name>). Re-applying an unchanged project is a no-op, not a rewrite. Members reconcile by email. - Prune removes what you deleted. With prune on (the default), a project or member you remove from git is removed from Roark. Submit the full desired set every time, or use
--no-prune/"prune": falsefor additive-only applies.
Imperative provisioning (REST)
For one-off or scripted provisioning outside the declarative flow, the organization key also drives a small REST surface. Config-as-code is the recommended path for GitOps; these are handy for automation that isn’t file-based.
Generating a per-project key is how you hand each team or environment its own project-scoped credential from your provisioning pipeline.
Recommended workflow
- Keep a
roark/projects/directory in git, one file per project, reviewed via pull requests. - In CI, run
roark config diff ./roark/projectson every PR (a read-only organization key is enough for diff) and post the output for review. - On merge, run
roark config apply ./roark/projects --yeswith a read+write organization key stored as a secret.