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

# Assegnare ruolo

> Creare l'assegnazione del ruolo dell'account

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


## OpenAPI

````yaml /openapi.it.json POST /v1/public/accounts/{account_id}/auth/role-assignments
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}/auth/role-assignments:
    post:
      tags:
        - public-accounts
        - public-account-auth
      summary: Creare l'assegnazione del ruolo dell'account
      description: Creare un'assegnazione di ruolo con ambito account.
      operationId: >-
        create_public_account_role_assignment_v1_public_accounts__account_id__auth_role_assignments_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/RoleAssignmentRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleAssignmentResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Errore di validazione
      security:
        - PublicBearerAuth: []
components:
  schemas:
    RoleAssignmentRequest:
      description: Richiedi lo schema per la creazione di una nuova assegnazione di ruolo.
      properties:
        resource_id:
          description: Identificatore della risorsa dell'ambito dell'assegnazione
          format: uuid
          title: risorsa ID
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
          description: Tipo di risorsa ambito dell'assegnazione
        role_key:
          $ref: '#/components/schemas/RoleKey'
          description: Chiave del ruolo definita dal codice
        subject_id:
          description: Identificatore di utente, gruppo o account di servizio
          minLength: 1
          title: soggetto ID
          type: string
        subject_type:
          $ref: '#/components/schemas/SubjectType'
          description: >-
            Tipo di soggetto dell’assegnazione ruolo: user, group o
            service_account
      required:
        - subject_type
        - subject_id
        - role_key
        - resource_type
        - resource_id
      title: RoleAssignmentRequest
      type: object
    RoleAssignmentResponse:
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Creato il
        expanded_capability_keys:
          items:
            type: string
          title: Chiavi con funzionalità estesa
          type: array
        id:
          format: uuid
          title: ID
          type: string
        resource_id:
          format: uuid
          title: risorsa ID
          type: string
        resource_type:
          title: risorsa tipo
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: revocato alle
        role_key:
          title: Chiave del ruolo
          type: string
        subject_id:
          title: soggetto ID
          type: string
        subject_type:
          title: soggetto tipo
          type: string
      required:
        - id
        - subject_type
        - subject_id
        - role_key
        - resource_type
        - resource_id
        - expanded_capability_keys
      title: RoleAssignmentResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Dettaglio
          type: array
      title: HTTPValidationError
      type: object
    ResourceType:
      description: Authorization resource e scope types.
      enum:
        - client
        - account
        - workspace
        - domain
        - dns_record
        - mailbox
        - redirect
        - forwarding
        - credential
        - tenant
        - route
        - proxy
      title: ResourceType
      type: string
    RoleKey:
      description: Identificatori di ruolo riutilizzabili stabili.
      enum:
        - viewer
        - editor
        - domain_manager
        - manager
        - dns_manager
        - ip_manager
        - billing_viewer
        - billing_admin
        - credential_manager
      title: RoleKey
      type: string
    SubjectType:
      description: Tipologie di soggetti autorizzativi.
      enum:
        - user
        - group
        - service_account
      title: SubjectType
      type: string
    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

````