# Admin resources

> Source: https://truto.one/docs/cli/admin-resources/

Admin commands manage Truto platform resources. All follow the same pattern:

```bash
truto <resource> <operation> [args] [options]
```

Operations: `list`, `get`, `create`, `update`, `delete` (where supported). See [Global options](/docs/cli/global-options) for shared flags.

## Integrated accounts (`accounts`)

Live tenant connections to integrations.

```bash
truto accounts list
truto accounts list --integration-name hubspot --status active
truto accounts get <id>
truto accounts create -b '{"environment_integration_id":"...","tenant_id":"...","context":{},"authentication_method":"oauth2"}'
truto accounts update <id> -b '{"status":"inactive"}'
truto accounts refresh-credentials <id>
truto accounts create-token <id>              # short-lived scoped token
truto accounts tools <id> --methods list,get
```

:::callout{type="warning"}
The command is **`accounts`**, not `integrated-accounts` (shorter alias for the `integrated-account` API path).
:::

**Filters:** `--tenant-id`, `--is-sandbox`, `--integration-name`, `--status`, `--features-super-query`, `--created-at`, `--updated-at`

**Status values:** `active`, `connecting`, `post_install_error`, `validation_error`, `needs_reauth`

## Environments

```bash
truto environments list
truto environments get <id>
truto environments update <id> -b '{"name":"Production"}'
```

:::callout{type="info"}
Creating and deleting environments requires the dashboard. The CLI supports list, get, and update only.
:::

## Environment integrations

```bash
truto environment-integrations list --integration_id <id>
truto environment-integrations create -b '{"integration_id":"...","override":{...}}'
truto environment-integrations update <id> -b '{"is_enabled":false}'
truto environment-integrations delete <id>
```

## API tokens

```bash
truto api-tokens list --name ci-token
truto api-tokens get <id>
```

Create and delete tokens require the dashboard.

## Sync jobs and runs

```bash
truto sync-jobs list --integration_name hubspot
truto sync-jobs create -b '{"label":"Sync Contacts","integration_name":"hubspot","resources":{...}}'

truto sync-job-runs list --sync_job_id <id>
truto sync-job-runs create -b '{"sync_job_id":"...","integrated_account_id":"..."}'

truto sync-job-triggers list --integrated_account_id <id>
truto sync-job-triggers create -b '{"sync_job_id":"...","cron_expression":"0 */6 * * *"}'
truto sync-job-triggers schedule <id>

truto sync-job-templates list
truto sync-job-templates create -b '{"label":"CRM Sync","resources":{...},"default_runtime_version":2}'
```

**Sync job run state** (key-value state for a run namespace):

```bash
truto sync-job-run-states list --namespace <id>
truto sync-job-run-states get --namespace <id> --key <key>
truto sync-job-run-states create --namespace <id> -b '{"key":"cursor","value":"..."}'
```

## Workflows

```bash
truto workflows list
truto workflows create -b '{"trigger_name":"on_new_contact","config":{...}}'

truto workflow-runs list --workflow_id <id> --status completed
```

Workflow runs cannot be created via CLI — they are triggered by the workflow.

## Webhooks and notifications

```bash
truto webhooks create -b '{"target_url":"https://example.com/hook"}'
truto webhooks test --id <id>

truto notification-destinations create -b '{"type":"slack","config":{...},"label":"Eng Alerts"}'
truto notification-destinations test --id <id>
```

## MCP tokens

Scoped to an integrated account. The **account ID is the first positional argument**:

```bash
truto mcp-tokens list <account-id>
truto mcp-tokens create <account-id> --name "my-mcp-token"
truto mcp-tokens delete <account-id> <token-id> -f
```

## Unified models and environment overrides

```bash
truto unified-models list
truto unified-models create -b '{"name":"crm","category":"crm","description":"CRM model","resources":{...}}'
truto unified-models update <id> -b '{"description":"Updated","version":1}'

truto unified-model-resource-methods list
truto environment-unified-models list
truto environment-unified-model-resource-methods list
```

`version` is required on unified model updates — fetch with `get` first.

## Datastores, daemons, team

```bash
truto datastores create -b '{"label":"my-bucket","type":"s3","config":{...}}'
truto datastores test <id>

truto daemons create -b '{"label":"My Daemon"}'
truto daemon-jobs list
truto daemon-job-runs create -b '{"daemon_job_id":"...","daemon_id":"..."}'
truto daemon-job-triggers schedule <id>

truto team get
truto team update <id> -b '{"name":"New Team Name"}'
truto users list
```

## Gates, docs, link tokens, logs, files, schema

```bash
# Static IP egress proxies (command: gates, API: static-gate)
truto gates create -b '{"name":"us-west-proxy","domain":"api.example.com"}'

# User-authored integration/model documentation
truto docs list --integration_id <id>    # at least one filter required
truto docs create -b '{"content":"...","type":"readme","integration_id":"..."}'

truto link-tokens create --tenant-id <tid>
truto link-tokens create --tenant-id <tid> --integrated-account-id <id>

truto logs --log-type unified_proxy_api --integrated-account-id <id> --limit 50

truto files upload /path/to/file.csv

truto schema --out openapi.yml    # YAML output; --out not -o
```

**Log types and filters** vary by type — run `truto logs --help`. `--log-type` is required.

## Capabilities

Show what an integration or account can do (proxy + unified surfaces):

```bash
truto capabilities hubspot
truto capabilities <account-uuid> --type proxy
truto capabilities acme-crm --resource contacts --methods list,get
```

UUID-shaped targets are treated as integrated accounts; otherwise integration slug/ID.
