> ## 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.

# Crea password principale

> Create a master password under the path account.

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


## OpenAPI

````yaml /openapi.it.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: Crea password principale
      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: Errore di validazione
      security:
        - PublicBearerAuth: []
components:
  schemas:
    AccountCredentialCreateRequest:
      additionalProperties: false
      description: >-
        Richiesta per creare una password principale nell’ambito del percorso
        account.
      properties:
        domain:
          anyOf:
            - type: string
            - type: 'null'
          description: Ambito della password master come UUID del dominio o nome di dominio
          title: Dominio
        generate:
          default: false
          description: Genera un segreto di password principale invece di fornirne uno
          title: Genera
          type: boolean
        name:
          description: Nome visualizzato della password principale
          maxLength: 100
          minLength: 1
          title: Nome
          type: string
        value:
          anyOf:
            - maxLength: 256
              minLength: 4
              type: string
            - type: 'null'
          description: Valore segreto della password principale quando non viene generato
          title: Valore
        workspace_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Ambito UUID dell’area di lavoro per la password principale
          title: Id area di lavoro
      required:
        - name
      title: AccountCredentialCreateRequest
      type: object
    CredentialCreateResponse:
      properties:
        created_at:
          description: Timestamp di creazione della password principale
          title: Creato il
          type: string
        generated_secret:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Segreto della password principale generato una sola volta, se
            richiesto
          title: Segreto generato
        id:
          description: UUID della password principale
          format: uuid
          title: ID
          type: string
        name:
          description: Nome visualizzato della password principale
          title: Nome
          type: string
        scope_id:
          description: UUID della risorsa per l’ambito della password principale
          format: uuid
          title: Id ambito
          type: string
        scope_type:
          description: >-
            Tipo di ambito della risorsa in cui si applica la password
            principale
          enum:
            - account
            - workspace
            - domain
          title: Tipo ambito
          type: string
        updated_at:
          description: Timestamp dell’ultimo aggiornamento della password principale
          title: Aggiornato il
          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: Dettaglio
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Posizione
          type: array
        msg:
          title: Messaggio
          type: string
        type:
          title: Tipo errore
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      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

````