API
/web_api/auth/register
/web_api/auth/register
This page is built from the JSON Schema snapshot in the documentation repository. The snapshot is updated by a separate command from the main app catalog and is not rewritten when the site is built.
Request
main-app://schemas/api_auth/register.request.json
POST /web_api/auth/register body
| Name | Type | Required | Constraint |
|---|---|---|---|
email | string | Yes | minLength 1 |
password | string | Yes | minLength 8 |
first_name | string | Yes | maxLength 255 |
last_name | string | Yes | maxLength 255 |
device | string | No | maxLength 255 |
Other top-level fields are not allowed.
Response
main-app://schemas/api_auth/register.response.json
POST /web_api/auth/register success
| Name | Type | Required | Constraint |
|---|---|---|---|
api_code | integer | Yes | const 200 |
api_result | object | Yes | no other fields |
empty | boolean | No | - |
Other top-level fields are not allowed.
api_result
| Name | Type | Required | Constraint |
|---|---|---|---|
access_token | string | Yes | minLength 1 |
token_type | string | Yes | const "Bearer" |
expires_in_days | integer | Yes | minimum 1 |
user | object | Yes | no other fields |
api_result.user
| Name | Type | Required | Constraint |
|---|---|---|---|
id | integer | Yes | minimum 1 |
email | string | Yes | minLength 1 |
first_name | string | Yes | - |
last_name | string | Yes | - |
Source schema
The files below are copied from the snapshot unchanged. A $ref fragment is a separate block. The schemas are not merged.
Request: main-app://schemas/api_auth/register.request.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_auth/register.request.json",
"title": "POST /web_api/auth/register body",
"type": "object",
"required": ["email", "password", "first_name", "last_name"],
"additionalProperties": false,
"properties": {
"email": { "type": "string", "minLength": 1 },
"password": { "type": "string", "minLength": 8 },
"first_name": { "type": "string", "maxLength": 255 },
"last_name": { "type": "string", "maxLength": 255 },
"device": { "type": "string", "maxLength": 255 }
}
}Response: main-app://schemas/api_auth/register.response.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_auth/register.response.json",
"title": "POST /web_api/auth/register success",
"allOf": [
{ "$ref": "main-app://schemas/_shared/envelope-success.json" },
{
"type": "object",
"properties": {
"api_result": { "$ref": "main-app://schemas/_shared/auth-token-result.json" }
}
}
]
}Fragment: main-app://schemas/_shared/envelope-success.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/_shared/envelope-success.json",
"title": "Canonical success envelope",
"type": "object",
"required": ["api_code", "api_result"],
"properties": {
"api_code": { "const": 200 },
"api_result": true,
"empty": { "type": "boolean" }
},
"additionalProperties": false
}Fragment: main-app://schemas/_shared/auth-token-result.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/_shared/auth-token-result.json",
"title": "api_result of /web_api/auth/login and /web_api/auth/register",
"type": "object",
"required": ["access_token", "token_type", "expires_in_days", "user"],
"additionalProperties": false,
"properties": {
"access_token": { "type": "string", "minLength": 1 },
"token_type": { "const": "Bearer" },
"expires_in_days": { "type": "integer", "minimum": 1 },
"user": { "$ref": "main-app://schemas/_shared/auth-user.json" }
}
}Fragment: main-app://schemas/_shared/auth-user.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/_shared/auth-user.json",
"title": "User object in /web_api/auth responses",
"type": "object",
"required": ["id", "email", "first_name", "last_name"],
"additionalProperties": false,
"properties": {
"id": { "type": "integer", "minimum": 1 },
"email": { "type": "string", "minLength": 1 },
"first_name": { "type": "string" },
"last_name": { "type": "string" }
}
}Did this page help?