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

# 역할 할당

> 계정 역할 할당 생성

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


## OpenAPI

````yaml /openapi.ko.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: 계정 역할 할당 생성
      description: 계정 범위 역할 할당을 만듭니다.
      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: 검증 오류
      security:
        - PublicBearerAuth: []
components:
  schemas:
    RoleAssignmentRequest:
      description: 새 역할 할당을 만들기 위한 요청 스키마입니다.
      properties:
        resource_id:
          description: 할당 범위 리소스 식별자
          format: uuid
          title: 리소스 ID
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
          description: 할당 범위 리소스 유형
        role_key:
          $ref: '#/components/schemas/RoleKey'
          description: 코드 정의 역할 키
        subject_id:
          description: 사용자, 그룹 또는 서비스 계정 식별자
          minLength: 1
          title: 주체 ID
          type: string
        subject_type:
          $ref: '#/components/schemas/SubjectType'
          description: '역할 할당 대상 유형: user, group 또는 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: 생성일
        expanded_capability_keys:
          items:
            type: string
          title: 확장된 기능 키
          type: array
        id:
          format: uuid
          title: ID
          type: string
        resource_id:
          format: uuid
          title: 리소스 ID
          type: string
        resource_type:
          title: 리소스 유형
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: 취소 시각
        role_key:
          title: 역할 키
          type: string
        subject_id:
          title: 주체 ID
          type: string
        subject_type:
          title: 주체 유형
          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: 세부 정보
          type: array
      title: HTTP검증 오류
      type: object
    ResourceType:
      description: 권한 리소스 및 범위 유형입니다.
      enum:
        - client
        - account
        - workspace
        - domain
        - dns_record
        - mailbox
        - redirect
        - forwarding
        - credential
        - tenant
        - route
        - proxy
      title: ResourceType
      type: string
    RoleKey:
      description: 안정적이고 재사용 가능한 역할 식별자.
      enum:
        - viewer
        - editor
        - domain_manager
        - manager
        - dns_manager
        - ip_manager
        - billing_viewer
        - billing_admin
        - credential_manager
      title: RoleKey
      type: string
    SubjectType:
      description: 권한 주체 유형입니다.
      enum:
        - user
        - group
        - service_account
      title: SubjectType
      type: string
    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

````