auth

Self-service registration — create user, tenant, and first API key.

Atomic registration: user + tenant + api_key in one transaction.

Returns JWT access token and the plaintext api_key (shown ONCE). Audit-trail fields (signed_ip, signed_user_agent) come from request headers, not from the request body.

Cross-field validation (consents, password match) is performed here rather than in Pydantic model_validator to emit ADR-014 wire format {"detail": {"error": "...", ...}} instead of FastAPI's default 422 shape.

post/v1/auth/register

Request

  • Base URL: https://api.andish.ru (the document declares no server; this is the origin it was published from)
  • URL: https://api.andish.ru/v1/auth/register
  • Auth: none declared

Request body

emailstring email required

User email address. Stored as CITEXT (case-insensitive unique).

passwordstring required

Plain-text password, hashed with argon2id before storage. Min 10 chars (OWASP 2023 baseline). No composition requirements.

confirm_passwordstring required

Must match password. Validated at Pydantic layer, not stored.

workspace_namestring nullable

Optional workspace display name. Defaults to the email address if not provided.

agreed_terms_v1boolean required

User accepted Terms of Service v1. Must be True.

agreed_no_pdnboolean required

User acknowledges they will NOT upload third-party personal data (PII) per ФЗ-152 Part В. Must be True.

agreed_processing_metadataboolean required

User consents to processing of their content metadata per ФЗ-152 Part А. Must be True.

agreed_crossborder_llmboolean

Separate cross-border transfer flag of consent set v1. Optional since consent-register-v2-2026-09-27: defaults to false, stored as sent, not validated at registration.

Response

Successful Response

user_idstring uuid required

Newly created user UUID.

tenant_idstring uuid required

Newly created tenant UUID.

access_tokenstring required

JWT HS256 access token (TTL 12h).

token_typestring

Always 'bearer'.

api_keystring required

First api_key in plaintext (adsh_test_* or adsh_live_*). Shown ONCE at registration — the server stores only the hash. Store this securely.

api_key_idstring uuid required

UUID of the api_key record.

redirect_urlstring required

Frontend URL the client should redirect to after registration. Points to the post-registration onboarding flow.

Changes

No recorded changes to this operation across all 1 revision of this API.