> ## 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.

# Create workspace

Creates a workspace in the named Organization; you must be an owner or admin of it and become the workspace owner. An Idempotency-Key is scoped to that user. Reusing it with the same request returns the existing Workspace in its current state; a different request returns 409/7015. Keys do not expire; replay remains available until the Workspace is permanently deleted.

`POST https://api.akua.dev/v1/workspaces`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Headers

- `idempotency-key` (string): Optional caller-supplied idempotency key. Any non-empty key up to 64 characters is accepted. Endpoint-specific documentation describes how the key is used. Required string length: `1 - 64`. Example: `"create-prod-2026-05-07"`.

## Body

Required.

`application/json`: `object`

- `organization` (string, required): The Organization the Workspace is created in (its parent). Required: the server picks none. You must be an owner or admin of it. Clients may default it, as the dashboard does from its current Organization and the CLI from its configuration. Required string length: `1 - 54`.
- `name` (string, required): Required string length: `1 - 100`. Pattern: `^(?=.*\S)[^\p{Cc}\p{Zl}\p{Zp}]+$`.
- `slug` (string): Required string length: `3 - 39`.

## Response

### 201: Workspace created

`application/json`: `Workspace`

- `organization_id` (string, required): ID of the organization that owns this workspace. Required string length: `1 - 54`.
- `id` (string, required): Workspace ID. Required string length: `1 - 53`. Example: `"ws_j572abc123def4"`.
- `name` (string, required): Display name. Example: `"Acme Research"`.
- `slug` (string, required): URL-safe workspace slug.
- `plan` (object, required)
  - `tier` (string, required)
  - `billed_by` (enum<string>, required): Available options: `"platform"`, `"seller"`.
- `workspace_class` (enum<string>, required): Available options: `"standard"`, `"platform"`, `"sandbox"`.
- `lifecycle` (object, required)
  - `state` (enum<string>, required): Lifecycle state of the workspace. `DELETING` means deletion was accepted and the workspace is retained until `purge_at`. Available options: `"ACTIVE"`, `"DELETING"`, `"PURGED"`.
  - `deletion_phase` (enum<string> | null, required): Progress of the accepted deletion request, or null when no deletion has been recorded. Available options: `"ACCEPTED"`, `"RUNNING"`, `"SUCCEEDED"`, `"FAILED"`.
  - `deleted_at` (integer | null, required): When deletion was accepted, or null. Required range: `x >= 0`.
  - `purge_at` (integer | null, required): Scheduled retention expiry that #955 owns as the purge executor, or null. Required range: `x >= 0`.
- `created_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
- `updated_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
- `etag` (string, required)

### 400: The request is malformed.

`application/json`: `ApiBadRequest`

- `_tag` (enum<string>, required): Available options: `"Validation"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 409: The request conflicts with existing resource state or immutable intent. | The idempotency key was already used for a different request.

`application/json`: `object`

- Any of:
  - `Conflict`
    - `_tag` (enum<string>, required): Available options: `"Conflict"`.
    - `success` (enum<boolean>, required): Available options: `false`.
    - `errors` (object[], required): Minimum array length: `1 element`.
      - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
      - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
      - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
      - `metadata` (record<string, string>)
    - `result` (object, required)
  - `IdempotencyConflict`
    - `_tag` (enum<string>, required): Available options: `"IdempotencyConflict"`.
    - `success` (enum<boolean>, required): Available options: `false`.
    - `errors` (object[], required): Minimum array length: `1 element`.
      - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
      - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
      - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
      - `metadata` (record<string, string>)
    - `result` (object, required)

### 422: The request is well-formed but cannot be processed.

`application/json`: `ApiUnprocessable`

- `_tag` (enum<string>, required): Available options: `"Unprocessable"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 429: The caller is over a rate budget, or a resource it adds to is at its limit (resource exhausted).

`application/json`: `ApiTooManyRequests`

- `_tag` (enum<string>, required): Available options: `"TooManyRequests"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 503: The service is temporarily unavailable.

`application/json`: `ApiServiceUnavailable`

- `_tag` (enum<string>, required): Available options: `"ServiceUnavailable"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request POST \
  --url 'https://api.akua.dev/v1/workspaces' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "organization": "<string>",
    "name": "<string>",
    "slug": "<string>"
  }'
```

## Example response

`201` `application/json`

```json
{
  "organization_id": "org_j572abc123def456",
  "id": "ws_j572abc123def4",
  "name": "Acme Research",
  "slug": "<string>",
  "plan": {
    "tier": "<string>",
    "billed_by": "platform"
  },
  "workspace_class": "standard",
  "lifecycle": {
    "state": "ACTIVE",
    "deletion_phase": "ACCEPTED",
    "deleted_at": 123,
    "purge_at": 123
  },
  "created_at": 123,
  "updated_at": 123,
  "etag": "<string>"
}
```
