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

# Batch Create Account Entity Relationships

> Associates multiple entities with an account under a single relationship type.




## OpenAPI

````yaml POST /v0/accounts/{id}/entity_relationships/batch
openapi: 3.0.1
info:
  title: Lead Bank
  description: Lead Bank's APIs
  version: v1.0
servers:
  - url: https://api.sandbox.lead.bank
  - url: https://api.lead.bank
security:
  - bearerAuth: []
tags:
  - name: ACH
  - name: Account Number
  - name: OAuth
  - name: Events
  - name: Instant Payments
  - name: Lending
  - name: Simulation
  - name: Internal Transfer
  - name: Disbursement
  - name: Entity
  - name: Wire
  - name: Originator
  - name: Funding
  - name: Balances
  - name: Compliance
  - name: UserAccount
  - name: Blockchain Payment
paths:
  /v0/accounts/{id}/entity_relationships/batch:
    post:
      tags:
        - Compliance
      summary: Batch create account entity relationships
      description: >
        Associates multiple entities with an account under a single relationship
        type.
      operationId: batch-create-account-entity-relationships
      parameters:
        - name: id
          in: path
          required: true
          description: Account ID
          schema:
            $ref: '#/components/schemas/AccountID'
        - name: Idempotency-Key
          in: header
          required: true
          description: Unique key to ensure idempotent requests
          schema:
            type: string
            maxLength: 255
          example: batch-entity-rel-12345-abc
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateEntityRelationshipsRequest'
            examples:
              authorized_user:
                summary: Batch add authorized users
                value:
                  entity_ids:
                    - entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO
                    - entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0
                    - entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK
                    - entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1
                    - entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6
                  relationship_type: authorized_user
      responses:
        '200':
          description: Entity relationships created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  account_id:
                    $ref: '#/components/schemas/AccountID'
                  relationship_type:
                    $ref: '#/components/schemas/EntityRelationshipType'
                  entity_ids:
                    type: array
                    description: >-
                      List of entity IDs associated with the account under the
                      specified relationship type.
                    items:
                      $ref: '#/components/schemas/EntityID'
                required:
                  - account_id
                  - relationship_type
                  - entity_ids
              examples:
                authorized_user:
                  summary: Batch add authorized users
                  value:
                    account_id: account_9h8g7f6e5d4c3b2a1z0y9x8w7v6
                    relationship_type: authorized_user
                    entity_ids:
                      - entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO
                      - entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0
                      - entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK
                      - entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1
                      - entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6
        '400':
          description: Your request parameters did not validate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '401':
          description: Valid access token was not used to call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '403':
          description: Access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Account ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '409':
          description: >-
            A request with this Idempotency-Key has already been processed with
            different parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '422':
          description: Request validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '429':
          description: Too many requests. Please slow down your request rate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '500':
          description: Server error. Please try your request again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
components:
  schemas:
    AccountID:
      type: string
      description: The ID of the Account object.
      example: account_xyz123
      pattern: ^account_\w+$
    BatchCreateEntityRelationshipsRequest:
      type: object
      description: Request body for batch creating entity relationships on an account.
      properties:
        entity_ids:
          type: array
          description: >-
            List of entity IDs to associate with the account under the specified
            relationship type.
          maxItems: 20
          items:
            $ref: '#/components/schemas/EntityID'
        relationship_type:
          $ref: '#/components/schemas/EntityRelationshipType'
      required:
        - entity_ids
        - relationship_type
    EntityRelationshipType:
      type: string
      description: Indicates the type of Entity
      enum:
        - account_holder
        - authorized_signer
        - authorized_user
    EntityID:
      type: string
      description: The ID of your entity.
      example: entity_xyz123
      pattern: ^entity_[^\s]{1,33}$
    APIError:
      type: object
      properties:
        code:
          type: string
          description: The error code.
        title:
          type: string
          description: The error title.
        detail:
          type: string
          description: A detailed error description.
        status:
          type: string
          description: The HTTP status code.
        invalid_parameters:
          type: array
          description: Invalid request parameters with reasons, if applicable.
          items:
            $ref: '#/components/schemas/InvalidParameterDetail'
        instance:
          type: string
          description: >-
            The object causing this specific occurrence of the error, if
            applicable.
    InvalidParameterDetail:
      type: object
      properties:
        parameter:
          type: string
          description: Which parameter is invalid.
          example: transaction_type
        reason:
          type: string
          description: Why the parameter is invalid.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````