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

# Delete Account Entity Relationship

> Deletes a specific entity relationship from an account and returns the updated list of entity relationships.
The relationship_type must be specified to identify which relationship to delete.




## OpenAPI

````yaml DELETE /v0/accounts/{id}/entity_relationships/{entity_id}
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/{entity_id}:
    delete:
      tags:
        - Compliance
      summary: Delete account entity relationship
      description: >
        Deletes a specific entity relationship from an account and returns the
        updated list of entity relationships.

        The relationship_type must be specified to identify which relationship
        to delete.
      operationId: delete-account-entity-relationship
      parameters:
        - name: id
          in: path
          required: true
          description: Account ID
          schema:
            $ref: '#/components/schemas/AccountID'
        - name: entity_id
          in: path
          required: true
          description: Entity ID to remove from the account relationships
          schema:
            $ref: '#/components/schemas/EntityID'
        - name: relationship_type
          in: query
          required: true
          description: The specific relationship type to delete for the entity.
          schema:
            $ref: '#/components/schemas/EntityRelationshipType'
      responses:
        '200':
          description: >-
            Entity relationship deleted successfully. Returns the updated list
            of entity relationships for the account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  objects:
                    type: array
                    items:
                      $ref: '#/components/schemas/EntityRelationship'
                required:
                  - objects
        '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'
        '404':
          description: Account ID or Entity ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              examples:
                account_not_found:
                  summary: Account not found
                  value:
                    code: parameters_invalid
                    title: Your request parameters did not validate.
                    detail: Account ID does not exist.
                    invalid_parameters:
                      - name: id
                        reason: not_found
                entity_relationship_not_found:
                  summary: Entity relationship not found
                  value:
                    code: parameters_invalid
                    title: Your request parameters did not validate.
                    detail: >-
                      The specified relationship type for this entity does not
                      exist on this account.
                    invalid_parameters:
                      - name: entity_id
                        reason: not_found
                      - name: relationship_type
                        reason: not_found
        '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+$
    EntityID:
      type: string
      description: The ID of your entity.
      example: entity_xyz123
      pattern: ^entity_[^\s]{1,33}$
    EntityRelationshipType:
      type: string
      description: Indicates the type of Entity
      enum:
        - account_holder
        - authorized_signer
        - authorized_user
    EntityRelationship:
      type: object
      description: Common fields for entity relationships
      properties:
        entity_id:
          $ref: '#/components/schemas/EntityID'
        relationship_type:
          $ref: '#/components/schemas/EntityRelationshipType'
      required:
        - entity_id
        - relationship_type
    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

````