> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Onboard a workspace with the API

> Set up a new Paradime workspace with API calls only: create it, connect git and warehouses, add environments and variables, deploy schedules and invite users.

Create a Paradime workspace and make it ready for the Code IDE, Bolt and DinoAI agents from a script, with the [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index). Each step shows the Python SDK, the `paradime admin` CLI where it has a command, and the GraphQL operation.

> [!NOTE]
>
> **Prerequisites**
>
> * The [Enterprise plan](https://www.paradime.io/pricing). Creating a workspace and setting up its git, connections, environments, and variables need it.
> * A company API key (`prdm_cmp_...`) and its API endpoint. Create the key in **Settings** > **API Keys** with these capability groups: **Workspace admin**, **Git repository admin**, **Warehouse connections admin**, **Environment admin**, **Environment variables admin**, **Bolt admin**, **Bolt schedules admin**, **Notifications admin** and **User access admin**. See [API keys](https://docs.paradime.io/developers/api-keys.md).
> * Python 3.11 or later and the latest `paradime-io` package (`pip install --upgrade paradime-io`).&#x20;
> * Admin access to the git repository, to add a deploy key.
> * Warehouse credentials for the service users that Bolt and DinoAI agents run as. The examples use Snowflake with key pair authentication.
>
> Estimated time: 20 minutes.

For GraphQL, send every request to your API endpoint with `Authorization: Bearer <company API key>`. From step 2 on, also send `X-Paradime-Workspace: <workspace uid>` so that the request acts on the new workspace. In the CLI, set `PARADIME_API_ENDPOINT`, `PARADIME_API_SECRET` and, from step 2 on, `PARADIME_WORKSPACE_UID`.

## Steps

**1. Create the workspace**

Create the workspace with the company API key. The key can reach the new workspace at once. Sending the same name again returns the same workspace, so the step is safe to retry.

```python Python theme={"system"}
import os

from paradime import Paradime

API_ENDPOINT = os.environ["PARADIME_API_ENDPOINT"]
API_SECRET = os.environ["PARADIME_API_SECRET"]  # a company API key

company = Paradime(api_endpoint=API_ENDPOINT, api_secret=API_SECRET)
workspace = company.admin.workspaces.create("analytics")

# A client for everything that happens inside the new workspace
paradime = Paradime(api_endpoint=API_ENDPOINT, api_secret=API_SECRET, workspace_uid=workspace.uid)
print(workspace.uid)
```

```bash CLI theme={"system"}
paradime admin workspaces create analytics --json
export PARADIME_WORKSPACE_UID="<the uid it prints>"
```

```graphql GraphQL theme={"system"}
mutation {
  createWorkspace(input: { name: "analytics" }) {
    workspace { uid name dbtVersion }
  }
}
```

> [!NOTE]
>
> The new workspace has no members, and it comes with two environments: a default Bolt environment named Production and a default agent environment named Agent. Step 5 reads their slugs.

**2. Add the deploy key to your repository**

Read the workspace's deploy key, then add it to your git repository as a deploy key **with write access**. With write access, your team can commit and push from the Code IDE. The key with **Git repository admin** creates the workspace's first deploy key when it reads it.

```python Python theme={"system"}
repository = paradime.admin.git.get_repository()
print(repository.deploy_key.public_key)
```

```bash CLI theme={"system"}
paradime admin git show
```

```graphql GraphQL theme={"system"}
query {
  workspace { gitRepository { state deployKey { publicKey } } }
}
```

Add the key on your git host. For GitHub, open the repository's **Settings** > **Deploy keys**, or call the GitHub REST API from your script.

**3. Connect the repository**

Connect the repository through the deploy key. Paradime clones it, checks that it has a `dbt_project.yml`, and syncs production in a job. Wait for the job, then check that the repository is `CONNECTED`. If the job fails, check that the deploy key has write access.

```python Python theme={"system"}
from paradime.apis.admin.git.types import DeployKeyConnectionInput, GitProvider

result = paradime.admin.git.connect(
    DeployKeyConnectionInput(provider=GitProvider.GITHUB, uri="git@github.com:acme/analytics.git")
)
if result.job is not None:
    paradime.admin.jobs.wait(result.job.id)
print(paradime.admin.git.get_repository().state)  # CONNECTED
```

```bash CLI theme={"system"}
paradime admin git connect-deploy-key --provider github \
  --uri git@github.com:acme/analytics.git --wait
```

```graphql GraphQL theme={"system"}
mutation {
  connectGitRepository(input: {
    connection: { deployKey: { provider: GITHUB, uri: "git@github.com:acme/analytics.git" } }
  }) {
    gitRepository { state }
    job { id status }
  }
}
# Then poll the job until it is SUCCEEDED or FAILED:
# query { adminJob(jobId: "JOB_ID") { status failure { code reason } } }
```

> [!NOTE]
>
> If your dbt™ project is in a folder of the repository, pass `dbt_project_dir`. To use the Paradime GitHub App or a GitLab connection instead, see [Connect a repository](https://docs.paradime.io/developers/python-sdk/modules/admin/git.md#connect-a-repository).

**4. Set the branches**

Set the branch that Paradime treats as the default, and the branch that Bolt schedules deploy from. Leave out a setting to keep its value.

```python Python theme={"system"}
paradime.admin.workspaces.update(
    workspace.uid, default_branch="main", schedule_deployment_branch="main"
)
```

```bash CLI theme={"system"}
paradime admin workspaces update "$PARADIME_WORKSPACE_UID" \
  --default-branch main --schedule-deployment-branch main
```

```graphql GraphQL theme={"system"}
mutation {
  updateWorkspace(input: {
    workspaceUid: "WORKSPACE_UID", defaultBranch: "main", scheduleDeploymentBranch: "main"
  }) {
    workspace { defaultBranch scheduleDeploymentBranch dbtVersion }
  }
}
```

**5. Find the environments and add a staging environment**

Read the slugs of the default Bolt and agent environments. In a workspace created through the API, these slugs are generated, so don't assume `production`. Then add any other Bolt environment you need. With a `slug`, the create is safe to retry.

```python Python theme={"system"}
from paradime.apis.admin.environments.types import EnvironmentType

environments = list(paradime.admin.environments.list())
production_slug = next(
    e.slug for e in environments if e.type == EnvironmentType.SCHEDULER and e.is_default
)
agent_slug = next(e.slug for e in environments if e.type == EnvironmentType.AGENT and e.is_default)

staging = paradime.admin.environments.create(
    EnvironmentType.SCHEDULER, "Staging", slug="staging", branch="main"
)
```

```bash CLI theme={"system"}
paradime admin environments list
paradime admin environments create --type scheduler --name Staging --slug staging --branch main
```

```graphql GraphQL theme={"system"}
query {
  workspace { environments { edges { node { slug type name isDefault } } } }
}
# Then:
# mutation { createEnvironment(input: { type: SCHEDULER, name: "Staging", slug: "staging", branch: "main" }) { environment { slug } } }
```

**6. Set the shared Code IDE connection**

Set the part of the development connection that every user shares, such as the Snowflake account and the authentication method. Each user adds their own credentials and schema when they first open the Code IDE. The API refuses per-user fields such as `username` or `role`.

```python Python theme={"system"}
from paradime.apis.admin.connections.types import ConnectionScope, SnowflakeConnectionInput

paradime.admin.connections.create(
    SnowflakeConnectionInput(account="acme-xy12345", use_key_pair_auth=True),
    scope=ConnectionScope.DEVELOPMENT_SHARED,
    name="Snowflake development",
    target_name="dev",
)
```

```bash CLI theme={"system"}
# dev.yml holds:  snowflake: {account: acme-xy12345, useKeyPairAuth: true}
paradime admin connections create --scope development_shared --config dev.yml \
  --name "Snowflake development" --target dev
```

```graphql GraphQL theme={"system"}
mutation {
  createWarehouseConnection(input: {
    scope: DEVELOPMENT_SHARED
    name: "Snowflake development"
    targetName: "dev"
    adapter: { snowflake: { account: "acme-xy12345", useKeyPairAuth: true } }
  }) {
    warehouseConnection { scope connectionId type name }
  }
}
```

**7. Add a warehouse connection to each Bolt environment**

Add the connection that Bolt runs use, once for each Bolt environment. Paradime tests each connection before it saves it. A connection the warehouse refuses raises a `CONNECTION_TEST_FAILED` error, and nothing is saved.

```python Python theme={"system"}
def bolt_connection(schema: str) -> SnowflakeConnectionInput:
    return SnowflakeConnectionInput(
        account="acme-xy12345",
        role="TRANSFORMER",
        database="ANALYTICS",
        warehouse="TRANSFORMING",
        schema_name=schema,
        username="PARADIME_BOLT",
        use_key_pair_auth=True,
        private_key=os.environ["SNOWFLAKE_PRIVATE_KEY"],
    )

for slug, schema, target in [(production_slug, "DBT_PROD", "prod"), ("staging", "DBT_STAGING", "staging")]:
    paradime.admin.connections.create(
        bolt_connection(schema),
        scope=ConnectionScope.SCHEDULER,
        environment_slug=slug,
        name=f"Snowflake {target}",
        target_name=target,
        threads=8,
    )
```

```bash CLI theme={"system"}
# prod.yml holds one snowflake: block with the account, role, database,
# warehouse, schema, username, useKeyPairAuth and privateKey
paradime admin connections create --scope scheduler --environment PRODUCTION_SLUG \
  --config prod.yml --name "Snowflake prod" --target prod --threads 8
```

```graphql GraphQL theme={"system"}
mutation {
  createWarehouseConnection(input: {
    scope: SCHEDULER
    environmentSlug: "PRODUCTION_SLUG"
    name: "Snowflake prod"
    targetName: "prod"
    threads: 8
    adapter: { snowflake: {
      account: "acme-xy12345", role: "TRANSFORMER", database: "ANALYTICS"
      warehouse: "TRANSFORMING", schema: "DBT_PROD", username: "PARADIME_BOLT"
      useKeyPairAuth: true, privateKey: "-----BEGIN PRIVATE KEY-----..."
    } }
  }) {
    warehouseConnection { connectionId type settings { ... on SnowflakeConnectionSettings { hasPrivateKey } } }
  }
}
```

**8. Set environment variables**

Set the workspace's variables, and the variables of each environment. Each call sets the variables in one write. Values are write-only: reads return only names.

```python Python theme={"system"}
paradime.admin.environment_variables.set({"COMPANY": "acme"})
paradime.admin.environment_variables.set(
    {"DBT_TARGET_SCHEMA": "analytics_staging"}, environment_slug="staging"
)
```

```bash CLI theme={"system"}
printf 'COMPANY=acme\n' > workspace.env
paradime admin env-vars set --file workspace.env
printf 'DBT_TARGET_SCHEMA=analytics_staging\n' > staging.env
paradime admin env-vars set --file staging.env --environment staging
```

```graphql GraphQL theme={"system"}
mutation {
  setEnvironmentVariables(input: {
    scope: ENVIRONMENT
    environmentSlug: "staging"
    variables: [{ name: "DBT_TARGET_SCHEMA", value: "analytics_staging" }]
  }) {
    changedNames
  }
}
```

**9. Connect the agent environment (optional)**

DinoAI agents query the warehouse through the default agent environment's connection. It defers to the default Bolt environment.

```python Python theme={"system"}
paradime.admin.connections.create(
    SnowflakeConnectionInput(
        account="acme-xy12345",
        role="DINOAI_AGENT",
        database="ANALYTICS",
        warehouse="AGENT_WH",
        schema_name="DBT_AGENT",
        username="PARADIME_AGENT",
        use_key_pair_auth=True,
        private_key=os.environ["SNOWFLAKE_PRIVATE_KEY"],
    ),
    scope=ConnectionScope.AGENT,
    environment_slug=agent_slug,
    name="Snowflake agent",
    target_name="agent",
    threads=4,
)
```

```bash CLI theme={"system"}
paradime admin connections create --scope agent --environment AGENT_SLUG \
  --config agent.yml --name "Snowflake agent" --target agent --threads 4
```

```graphql GraphQL theme={"system"}
mutation {
  createWarehouseConnection(input: {
    scope: AGENT, environmentSlug: "AGENT_SLUG", name: "Snowflake agent", targetName: "agent", threads: 4
    adapter: { snowflake: { account: "acme-xy12345", role: "DINOAI_AGENT", database: "ANALYTICS",
      warehouse: "AGENT_WH", schema: "DBT_AGENT", username: "PARADIME_AGENT",
      useKeyPairAuth: true, privateKey: "-----BEGIN PRIVATE KEY-----..." } }
  }) {
    warehouseConnection { connectionId }
  }
}
```

**10. Deploy or create Bolt schedules**

If your repository defines schedules in YAML, deploy them from the deploy branch. The deploy runs as a job, and its result says why each schedule that was not deployed failed. If the repository has no YAML schedules, create a schedule through the API instead. The CLI can create schedules, but it can't deploy YAML schedules.

```python Python theme={"system"}
job = paradime.admin.bolt.deploy_schedules(branch="main")
job = paradime.admin.jobs.wait(job.id)
for schedule in paradime.admin.jobs.deployed_schedules(job.id):
    if schedule.failure_reason:
        print(f"{schedule.slug} was not deployed: {schedule.failure_reason}")

# Or create a schedule through the API
nightly = paradime.admin.bolt.create_schedule(
    slug="nightly",
    name="Nightly build",
    schedule="0 2 * * *",
    environment=production_slug,
    commands=["dbt build"],
)
```

```bash CLI theme={"system"}
paradime admin bolt schedules create --slug nightly --name "Nightly build" \
  --schedule "0 2 * * *" --environment PRODUCTION_SLUG --command "dbt build"
```

```graphql GraphQL theme={"system"}
mutation {
  deployBoltSchedules(input: { branch: "main" }) { job { id status } }
}
# Then poll adminJob until it is SUCCEEDED, and read
# result { ... on DeployBoltSchedulesResult { schedules { edges { node { slug failureReason } } } } }
```

**11. Route alerts**

Turn on alert emails to the workspace's admins. Slack is connected once for the company, by a company admin in a browser: when it isn't connected, the API returns the page where they connect it.

```python Python theme={"system"}
from paradime.apis.admin.notifications.types import SlackInstallationStatus

paradime.admin.notifications.set_alert_notifications(email_enabled=True)

slack = paradime.admin.notifications.get_slack()
if slack.status != SlackInstallationStatus.CONNECTED:
    print(f"Ask a company admin to connect Slack at {slack.install_url}")
```

```graphql GraphQL theme={"system"}
mutation {
  setAlertNotifications(input: { category: BOLT_SYSTEM, email: { isEnabled: true } }) {
    alertNotifications { email { isEnabled } }
  }
}
# query { slack { status installUrl } }
```

Once Slack is connected, route alerts to channels with `slack_channel_ids`. See [Notifications](https://docs.paradime.io/developers/python-sdk/modules/admin/notifications.md).

**12. Invite your team**

Invite the workspace's first admin, then the rest of the team. Each person gets an invitation email. Inviting an email that is already a user or already invited raises a `CONFLICT` error.

```python Python theme={"system"}
from paradime.apis.admin.users.types import UserAccountType

paradime.admin.users.create("data-lead@example.com", UserAccountType.ADMIN)
paradime.admin.users.create("analytics-engineer@example.com", UserAccountType.DEVELOPER)
```

```bash CLI theme={"system"}
paradime admin users create data-lead@example.com --account-type admin
```

```graphql GraphQL theme={"system"}
mutation {
  createUser(input: { email: "data-lead@example.com", accountType: ADMIN }) {
    user { email status inviteStatus }
  }
}
```

**13. Start the first Bolt run**

Run a schedule once and wait for it to finish. A successful run also leaves the production artifacts that deferral uses.

```python Python theme={"system"}
import time

from paradime.apis.bolt.types import BoltRunState

run_id = paradime.bolt.trigger_run(slug="nightly", reason="Workspace onboarding")
state = paradime.bolt.get_run_status(run_id)
while state in (BoltRunState.STARTING, BoltRunState.RUNNING):
    time.sleep(10)
    state = paradime.bolt.get_run_status(run_id)
print(run_id, state)
```

```bash CLI theme={"system"}
paradime bolt run nightly --wait
```

```graphql GraphQL theme={"system"}
mutation {
  triggerBoltRun(slug: "nightly", reason: "Workspace onboarding") { runId }
}
# query { boltRunStatus(runId: RUN_ID) { state } }
```

**14. Check the setup status**

Read the workspace's onboarding checklist. Every required step should be `DONE`. A `PENDING_USER_ACTION` step waits for a person in a browser, such as connecting Slack, and comes with the page where they finish it.

```python Python theme={"system"}
from paradime.apis.admin.setup_status.types import SetupStepStatus

status = paradime.admin.setup_status.get()
for step in status.steps or []:
    if step.status != SetupStepStatus.DONE:
        print(step.step.value, step.environment_slug or "", step.status.value, step.install_url or step.detail or "")
print("Setup complete" if status.is_complete else "Setup not complete")
```

```bash CLI theme={"system"}
paradime admin setup-status
```

```graphql GraphQL theme={"system"}
query {
  workspace {
    setupStatus {
      isComplete
      steps { step status isRequired environmentSlug installUrl detail }
      products { codeIde { status missing } bolt { status missing } agent { status missing } }
    }
  }
}
```

> [!TIP]
>
> The setup status reads `isComplete: true`, and the Bolt run from step 13 ends in `SUCCESS`. Rows that stay `PENDING_USER_ACTION` are browser steps for a person, such as connecting Slack or the Paradime GitHub App. If a `SCHEDULER_CONNECTION` row is `MISSING`, check step 7 for that environment. If `GIT_REPOSITORY` is missing, check that the deploy key from step 2 has write access.

Every step is safe to run again: a create with the same input returns the stored object. A create that finds an object with other settings returns a `CONFLICT` error. Change that object with the matching update call.

## Next steps

> [card] [Invite and manage users](https://docs.paradime.io/guides/paradime-101/getting-started-with-your-paradime-workspace/managing-users-in-the-workspace.md)
>
> Assign roles and manage your team after the invitations go out.

> [card] [Admin client reference](https://docs.paradime.io/developers/python-sdk/modules/admin/index)
>
> Every method of `paradime.admin`, with errors, pagination and jobs.

> [card] [Admin CLI reference](https://docs.paradime.io/developers/paradime-cli/admin-cli.md)
>
> Every `paradime admin` command and option.

> [card] [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index)
>
> The GraphQL operations, capability groups and error codes.


## Related topics

- [Administration API: Workspaces](https://docs.paradime.io/developers/graphql-api/admin-api/workspaces.md)
- [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index.md)
- [Administration API: set up and run workspaces from code](https://docs.paradime.io/changelog/2026-11-26/administration-api.md)
- [Administration API: Setup status](https://docs.paradime.io/developers/graphql-api/admin-api/setup-status.md)
- [Admin client](https://docs.paradime.io/developers/python-sdk/modules/admin/index.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.