> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hybridbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Создать мастер-пароль

> Create a master password under the path account.

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.ru.json POST /v1/public/accounts/{account_id}/credentials
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/credentials:
    post:
      tags:
        - public-accounts
        - public-credentials
      summary: Создать мастер-пароль
      description: Create a master password under the path account.
      operationId: >-
        create_public_credential_v1_public_accounts__account_id__credentials_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCredentialCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialCreateResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Ошибка валидации
      security:
        - PublicBearerAuth: []
components:
  schemas:
    AccountCredentialCreateRequest:
      additionalProperties: false
      description: Запрос на создание мастер-пароля в области пути аккаунта.
      properties:
        domain:
          anyOf:
            - type: string
            - type: 'null'
          description: UUID домена или имя домена для области действия мастер-пароля
          title: Домен
        generate:
          default: false
          description: Сгенерировать секрет мастер-пароля вместо передачи значения
          title: Сгенерировать
          type: boolean
        name:
          description: Отображаемое имя мастер-пароля
          maxLength: 100
          minLength: 1
          title: Имя
          type: string
        value:
          anyOf:
            - maxLength: 256
              minLength: 4
              type: string
            - type: 'null'
          description: Секретное значение мастер-пароля, если оно не генерируется
          title: Значение
        workspace_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Область UUID рабочей области для мастер-пароля
          title: Id рабочей области
      required:
        - name
      title: AccountCredentialCreateRequest
      type: object
    CredentialCreateResponse:
      properties:
        created_at:
          description: Время создания мастер-пароля
          title: Создано в
          type: string
        generated_secret:
          anyOf:
            - type: string
            - type: 'null'
          description: Одноразово сгенерированный секрет мастер-пароля, если запрошен
          title: Сгенерированный секрет
        id:
          description: UUID мастер-пароля
          format: uuid
          title: ID
          type: string
        name:
          description: Отображаемое имя мастер-пароля
          title: Имя
          type: string
        scope_id:
          description: UUID ресурса для области мастер-пароля
          format: uuid
          title: Id области
          type: string
        scope_type:
          description: Тип области ресурса, где применяется мастер-пароль
          enum:
            - account
            - workspace
            - domain
          title: Тип области
          type: string
        updated_at:
          description: Время последнего обновления мастер-пароля
          title: Обновлено в
          type: string
      required:
        - id
        - name
        - scope_type
        - scope_id
        - created_at
        - updated_at
      title: CredentialCreateResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Сведения
          type: array
      title: HTTPОшибка проверки
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Расположение
          type: array
        msg:
          title: Сообщение
          type: string
        type:
          title: Тип ошибки
          type: string
      required:
        - loc
        - msg
        - type
      title: Ошибка проверки
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````