# Register an account

Create a user and an owner workspace when the email is not already registered.

## Endpoint

`POST /api/v1/auth/register`

## Authentication

| Class | Authentication | Minimum role | API key |
| --- | --- | --- | --- |
| dashboard-session-api | No authentication. | none | Not allowed |

## Parameters

This operation has no path, query, or header parameters.

## Request body

### application/json request schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | PermintaanDaftar | — | No | Yes | — | — |
| `email` | `string` | — | email | No | Yes | — | — |
| `name` | `string` | — | — | No | Yes | — | — |
| `password` | `string` | — | — | No | Yes | — | — |
| `workspace_name` | `string` | — | — | No | Yes | — | — |

## Example

```bash
curl --request POST 'https://operade.ai/api/v1/auth/register' \
  --header 'Content-Type: application/json' \
  --data '{"email":"alex@example.com","password":"EXAMPLE_PASSWORD_16","name":"Alex Example","workspace_name":"Example Workspace"}'
```

## Responses

| Status | Description | Content |
| --- | --- | --- |
| 4XX | Handled client error | application/json: `ErrorResponse` |
| 202 | Successful Response | application/json: `RegisterResponse` |

### 4XX application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | ErrorResponse | — | No | Yes | — | — |
| `error` | `object` | ErrorItem | — | No | Yes | — | — |
| `error.code` | `string` | — | — | No | Yes | — | — |
| `error.details` | `object` | — | — | No | No | — | — |
| `error.message` | `string` | — | — | No | Yes | — | — |

### 202 application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | RegisterResponse | — | No | Yes | — | — |
| `status` | `string` | — | — | No | Yes | "diterima" | — |

### Response example

```json
{
  "status": "diterima"
}
```

## Errors

Reviewed common and route-declared errors are summarized here; the list is not exhaustive. Start with the [distributed error index](/docs/reference/api/errors) to find each code's canonical domain page.

| Status | Code | Description |
| --- | --- | --- |
| 422 | `validation_failed` | The request did not pass field or business validation. |
| 429 | `rate_limited` | Too many attempts were made within the active limit window. |

## Related operations

- [Get the current user](/docs/api-reference/auth/get-current-user) — `GET /api/v1/auth/me`
- [Log in](/docs/api-reference/auth/login) — `POST /api/v1/auth/login`
- [Log out](/docs/api-reference/auth/logout) — `POST /api/v1/auth/logout`
