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

# Admin Configs

> Manage the admin-level Query Runner connection configuration for a service through the Collate REST API

# Admin Configs

An admin config is the base connection configuration for Query Runner on one database service: its service type, authentication configuration, default row cap, and which fields (role, database, schema, warehouse) individual users and teams are allowed to override with their own credentials. There's one admin config per service, and only a workspace admin can manage it.

| Method | Endpoint | Description |
| - | - | - |
| `GET` | `/v1/queryRunner/configs/test` | Health check for the Config API. |
| `GET` | `/v1/queryRunner/configs/defaults` | The platform default row cap (`QuerySettings`) applied when a service has no admin override. |
| `GET` | `/v1/queryRunner/configs` | List all services and their config status, or return one service's config with `?service=`. |
| `POST` | `/v1/queryRunner/configs` | Create the admin config for a service. |
| `PUT` | `/v1/queryRunner/configs?service={name}` | Update (or create) the admin config for a service. Changing credentials might invalidate existing user and team configs. |
| `DELETE` | `/v1/queryRunner/configs?service={name}` | Delete the admin config, cascading to every user and team config and stored secret for that service. |

`POST`/`PUT` take a `CreateQueryRunnerConfig` body:

* `serviceName` (required)
* `serviceType`: one of `BigQuery`, `Snowflake`, `Trino`, `Redshift`, `Postgres`, `Mssql`, or `Mysql`
* `authConfig`: connection credentials, shaped according to `serviceType`
* `querySettings`: `{ maxResultSize }`, defaults to `1000`
* `enabled`: defaults to `false`
* `userConfigurableFields`: which fields users and teams can override (`role`, `database`, `schema`, `warehouse`, `dataset`), defaulting to none

## Example

The following request creates an admin config for a database service.

<RequestExample>
  ```bash Create an admin config theme={null}
  curl -X POST "{base_url}/api/v1/queryRunner/configs" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -d '{
      "serviceName": "snowflake_production",
      "serviceType": "Snowflake",
      "authConfig": { "authType": "Basic" },
      "enabled": true,
      "userConfigurableFields": ["role", "database", "schema"]
    }'
  ```
</RequestExample>
