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

# Assign vault accounts to a legal entity

> Assigns one or more vault accounts to a specific legal entity registration. Explicitly mapped vault accounts take precedence over the workspace default legal entity.
Endpoint Permission: Admin, Non-Signing Admin.



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml post /legal_entities/{legalEntityId}/vaults
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /legal_entities/{legalEntityId}/vaults:
    post:
      tags:
        - Compliance
      summary: Assign vault accounts to a legal entity
      description: >-
        Assigns one or more vault accounts to a specific legal entity
        registration. Explicitly mapped vault accounts take precedence over the
        workspace default legal entity.

        Endpoint Permission: Admin, Non-Signing Admin.
      operationId: assignVaultsToLegalEntity
      parameters:
        - in: path
          name: legalEntityId
          required: true
          description: The unique ID of the legal entity registration
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignVaultsToLegalEntityRequest'
      responses:
        '201':
          description: Vault accounts assigned successfully
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignVaultsToLegalEntityResponse'
        '404':
          description: Legal entity registration not found
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response:
            Promise<FireblocksResponse<AssignVaultsToLegalEntityResponse>> =
            fireblocks.compliance.assignVaultsToLegalEntity(complianceApiAssignVaultsToLegalEntityRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<AssignVaultsToLegalEntityResponse>>
            response =
            fireblocks.compliance().assignVaultsToLegalEntity(assignVaultsToLegalEntityRequest,
            legalEntityId, idempotencyKey);
        - lang: Python
          source: >-
            response =
            fireblocks.compliance.assign_vaults_to_legal_entity(assign_vaults_to_legal_entity_request,
            legal_entity_id, idempotency_key);
components:
  parameters:
    X-Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: >-
        A unique identifier for the request. If the request is sent multiple
        times with the same idempotency key, the server will return the same
        response as the first request. The idempotency key is valid for 24
        hours.
      required: false
      schema:
        type: string
  schemas:
    AssignVaultsToLegalEntityRequest:
      type: object
      description: Request body to assign vault accounts to a legal entity
      properties:
        vaultAccountIds:
          type: array
          items:
            type: string
          description: List of vault account IDs to assign to the legal entity
          minItems: 1
          example:
            - '0'
            - '1'
            - '2'
      required:
        - vaultAccountIds
    AssignVaultsToLegalEntityResponse:
      type: object
      description: Response after assigning vault accounts to a legal entity
      properties:
        assignedCount:
          type: integer
          description: Number of vault accounts successfully assigned
          example: 3
      required:
        - assignedCount
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'

````