> For the complete documentation index, see [llms.txt](https://docs.visdom.virtuslab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visdom.virtuslab.com/visdom-control-plane/api-reference.md).

# API reference

Every Control Plane endpoint, grouped by what it manages.

All endpoints are under `/api/v1`, take and return JSON, and need a bearer token from Keycloak. The machine-readable specification is served by every instance at `/_/openapi.json`, with a Swagger UI at `/_/openapi/ui`; use it as the authority when this page and the service disagree.

Errors are plain strings with a dotted code, for example `permission.denied` or `project.slug_conflict`.

## Me

| Method      | Path                  | Purpose                                                                                        |
| ----------- | --------------------- | ---------------------------------------------------------------------------------------------- |
| GET         | `/me`                 | The signed-in principal, their permissions, selected project, theme and the workspace timezone |
| PUT, DELETE | `/me/default-project` | The project selected across the suite                                                          |
| PUT, DELETE | `/me/theme`           | Light or dark; delete to follow the operating system                                           |

## Projects and repositories

| Method             | Path                                          | Purpose                                                             |
| ------------------ | --------------------------------------------- | ------------------------------------------------------------------- |
| GET, POST          | `/projects`                                   | List projects the caller can see; create (admin). `?slugs=` filters |
| GET, PATCH         | `/projects/{id}`                              | Read; edit name and description                                     |
| POST               | `/projects/{id}/archive`                      | Archive (admin)                                                     |
| GET, POST          | `/projects/{id}/repositories`                 | List and add repositories                                           |
| POST               | `/projects/{id}/repositories/test-connection` | Probe a URL with the project token                                  |
| GET, PATCH, DELETE | `/projects/{id}/repositories/{repo_id}`       | Read, edit, remove a repository                                     |
| GET, PUT, DELETE   | `/projects/{id}/repository-secret`            | Repository token metadata; set; remove                              |
| GET                | `/projects/{id}/repository-secret/value`      | The decrypted token (machine principals and admins)                 |
| GET                | `/repositories`                               | Every repository in every project (machine principals and admins)   |

## Users

| Method | Path                  | Purpose                                                                         |
| ------ | --------------------- | ------------------------------------------------------------------------------- |
| GET    | `/users`              | Paginated, sortable list                                                        |
| POST   | `/users/resolve`      | Find or create a user by identity-provider subject (admins, machine principals) |
| POST   | `/users/{id}/disable` | Disable a user (admin)                                                          |

## Permissions

| Method    | Path                       | Purpose                                                                                         |
| --------- | -------------------------- | ----------------------------------------------------------------------------------------------- |
| GET       | `/permissions/catalog`     | Every product, its sign-in key and roles with their scopes                                      |
| GET, POST | `/permissions/grants`      | List grants; grant a role                                                                       |
| PUT       | `/permissions/grants/set`  | Replace the set of projects one project-scoped role applies to                                  |
| DELETE    | `/permissions/grants/{id}` | Revoke a grant                                                                                  |
| GET       | `/permissions/effective`   | What a user may do; see [Integrating a product](/visdom-control-plane/integrating-a-product.md) |

## Secrets and settings

| Method    | Path                  | Purpose                           |
| --------- | --------------------- | --------------------------------- |
| GET, POST | `/secrets`            | List metadata; create             |
| PUT       | `/secrets/{id}/value` | Replace a value                   |
| DELETE    | `/secrets/{id}`       | Delete                            |
| GET, PUT  | `/workspace/settings` | Workspace timezone (write: admin) |

## Outside `/api/v1`

`/healthz`, `/readyz`, `/_/openapi.json`, `/_/openapi/ui`, and `/config.js`, which hands the UI its OIDC settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.visdom.virtuslab.com/visdom-control-plane/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
