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

# Introduction

> Programmatic access to Akua resources for automation, CLI tools, and integrations

![An authenticated GET request reaches the Akua API and branches into three response shapes: a single object, a paginated data list with next cursor, or an error with a code](https://docs.akua.dev/images/heros/api-introduction-light.svg)

The Akua API is a RESTful API that lets you manage workspaces, clusters,
products, offers, and installs programmatically. It powers the dashboard and
the [Akua CLI](https://docs.akua.dev/cli.md), and you can use it to build custom integrations.

## Soft-launch availability

Use the guides to [deploy your application](https://docs.akua.dev/guides/deploy-an-app.md),
[share it with a customer](https://docs.akua.dev/guides/share-with-a-customer.md), or
[install an app you received](https://docs.akua.dev/guides/install-on-your-own-server.md).
The reference also lists hosted Sandbox and dedicated OpenCode Server APIs.
Those features are not available in the soft launch. A listed API operation
does not mean that the feature is available.

## Base URL

All API requests are made to:

```text
https://api.akua.dev/v1
```

An illustrative request:

```bash
curl https://api.akua.dev/v1/workspaces \
  -H "Authorization: Bearer $AKUA_API_TOKEN"
```

Workspace-scoped endpoints resolve the workspace from your credential. A workspace API token already belongs to a workspace, so you can omit any workspace header entirely. With a broad credential (dashboard session or multi-workspace token), select the workspace with the optional `Akua-Context` header:

```bash
curl https://api.akua.dev/v1/installs \
  -H "Authorization: Bearer $AKUA_API_TOKEN" \
  -H "Akua-Context: ws_xxx"
```

> [card] [Authentication guide](https://docs.akua.dev/apis/authentication.md)
>
> Learn how to create tokens, scope requests, and use JWTs.

## Conventions

The API uses `snake_case` for all field names. This keeps responses consistent regardless of the client language and matches the format you see in curl, logs, and debugging tools.

## Response format

**Single objects** are returned directly (no wrapper). Timestamps are Unix seconds:

```json
{
	"id": "ws_j572abc123def4",
	"name": "my-workspace",
	"created_at": 1734567890
}
```

**List responses** return `data` with flat pagination fields:

```json
{
	"data": [{ "id": "ws_j572abc123def4", "name": "my-workspace", "created_at": 1734567890 }],
	"has_more": true,
	"next_cursor": "opaque..."
}
```

**Error responses** use one envelope for every failure. `errors` always has at least one entry; `path` and `metadata` appear when they apply:

```json
{
	"_tag": "NotFound",
	"success": false,
	"errors": [{ "code": 7002, "message": "Install not found" }],
	"result": {}
}
```

## Pagination

List endpoints support cursor-based pagination with two query parameters:

| Parameter | Type | Default | Description |
| - | - | - | - |
| `limit` | integer | 50 | Items per page (1–100) |
| `cursor` | string | (none) | Value of `next_cursor` from a previous response |

## Error codes

`_tag` names the error and `errors[].code` is the stable machine-readable code. Branch on the HTTP status or `_tag`, and show `message` to people.

| HTTP status | `_tag` | `code` | Meaning |
| - | - | - | - |
| 400 | `Validation` | 7001 | The request is malformed |
| 401 | `Unauthorized` | 7003 | Missing, invalid, or expired credential |
| 403 | `Forbidden` | 7004 | The credential may not act in this workspace |
| 404 | `NotFound` | 7002 | Resource does not exist |
| 409 | `Conflict` | 7006 | Conflicts with the current state |
| 409 | `PreconditionFailed` | 7006 | The `If-Match` etag is stale; `metadata.current_etag` has the current one |
| 410 | `Gone` | 7013 | The resource is gone |
| 422 | `Unprocessable` | 7007 | The request is well formed but cannot be processed |
| 429 | `TooManyRequests` | 7008 | Rate limit reached |
| 500 | `InternalServerError` | 7009 | Unexpected server error |
| 502 | `ExternalServiceError` | 7010 | An upstream service failed |
| 503 | `ServiceUnavailable` | 7011 | Temporarily unavailable |
| 504 | `GatewayTimeout` | 7012 | An upstream service timed out |

Idempotency-key reuse with a different request returns 409 `IdempotencyConflict` (code 7015).

## OpenAPI spec

The spec for the public API is served as raw OpenAPI 3.1 JSON:

> [card] [OpenAPI spec](https://api.akua.dev/openapi.json)
>
> Raw OpenAPI 3.1 specification (JSON).

## Related topics

> [card] [Authentication](https://docs.akua.dev/apis/authentication.md)
>
> Create tokens and learn about supported auth methods.

> [card] [OpenAPI specification](https://docs.akua.dev/apis/openapi.md)
>
> Download the spec and generate type-safe clients.

> [card] [CLI](https://docs.akua.dev/cli.md)
>
> Authenticate and run generated OpenAPI commands.

> [card] [Use your coding agent](https://docs.akua.dev/agent-setup.md)
>
> Operate Akua with your coding agent.
