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

# API overview

The Osmos REST API is grouped by actor and resource area. All paths are prefixed with `/api/v1` unless otherwise noted.

## Base URL

* Local development: `http://localhost:9000/api/v1`
* Production: configured by `APP_PUBLIC_URL`

## Authentication

Most endpoints require authentication via:

* HTTP-only cookie `osmos_access_token` (set at login or session exchange), or
* `Authorization: Bearer <token>` header.

Public endpoints (landing pages, setup links, public payments, webhooks) do not require authentication.

## Response envelope

Every response is wrapped in `ApiResponse<T>`:

```json
{
  "status": "Success",
  "message": "Operation completed successfully",
  "traceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": { ... }
}
```

Error responses use `status: "Failed"` or `"Error"` and may include `errorCode` and `errors`.

## Pagination

List endpoints support Spring Data pagination through query parameters:

* `page` — zero-based page number (default 0).
* `size` — page size (default 20, maximum 100).
* `sort` — sort field and direction, for example `createdAt,desc`.

Paginated responses include `content`, `page`, `size`, `totalElements`, `totalPages`.

## API groups

* [Authentication](/api-reference/auth.md)
* [Organizations and onboarding](/api-reference/organizations.md)
* [Tenant services](/api-reference/tenant-services.md)
* [Customer requests](/api-reference/customer-requests.md)
* [Staff applications and requests](/api-reference/staff-applications.md)
* [Finance and payments](/api-reference/finance.md)
* [Billing subscriptions](/api-reference/billing.md)
* [Files](/api-reference/files.md)
* [Platform administration](/api-reference/platform.md)

## OpenAPI

Interactive Swagger UI is available at `/swagger-ui.html` and the OpenAPI JSON at `/v3/api-docs` when the application is running.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.osmosworks.com/api-reference/api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
