---
title: "Create an account with its first workspace"
method: POST
path: "/api/v1/auth/register"
tags: ["Auth"]
---

# Create an account with its first workspace

`POST /api/v1/auth/register`

## Request

- Base URL: `https://otprun.com`
- URL: `https://otprun.com/api/v1/auth/register`
- Auth: none declared

Answers 410 with code passwords_disabled once sign-in by email code is turned on.

## Headers

- `User-Agent` string

## Request body

- RegisterInputBody
  - `email` string, email, required
  - `locale` string: BCP 47 tag such as en or pt-BR, defaults to en
  - `name` string: Optional, asked on the welcome screen when empty
  - `password` string, required
  - `workspace_name` string: Optional, defaults to My workspace

## Response `201`

Created

- SessionBody
  - `access_token` string, required
  - `expires_at` string, date-time, required
  - `needs_profile` boolean, required: True until the name and workspace steps of the welcome screen are done
  - `token_type` 'Bearer', required
  - `user` AccountUserBody, required
    - `created_at` string, date-time, required
    - `email` string, nullable, required: Null for accounts created with a phone number
    - `email_verified` boolean, required: True once the email was confirmed with a code or a sign-in link
    - `has_password` boolean, required
    - `id` integer, required
    - `is_admin` boolean, required
    - `locale` string, required
    - `name` string, required: Empty until the person enters a name
    - `phone` string, nullable, required: E.164 number the account signs in with, null for email accounts
    - `public_id` string, uuid, required
  - `workspace` AccountWorkspaceBody, required
    - `created_at` string, date-time, required
    - `id` integer, required
    - `name` string, required
    - `plan` 'free' | 'starter' | 'growth' | 'scale', required
    - `role` 'owner' | 'admin' | 'developer' | 'viewer', required
    - `slug` string, required
    - `trial_ends_at` string, date-time, nullable, required

## Other responses

- `409`: Conflict
- `410`: Gone
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/otprun/apis/otp-run-api.md) · [All operations](https://skmtc.dev/otprun/apis/otp-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/otprun/apis/otp-run-api/revisions/43d40d5f4050?raw)
