> ## 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 User Account Entity Relationship

> Remove an Entity from a User Account and return the updated list of relationships. Send `relationship_type` to identify which relationship to remove.



## OpenAPI

````yaml DELETE /v2/user_accounts/{user_account_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: Receivable Sale
  - name: Balances
  - name: Compliance
  - name: Application
  - name: User Account
  - name: Blockchain Payment
  - name: Core Account
  - name: Core Balance
  - name: Core Transaction
  - name: Event Subscription
  - name: Receivable
  - name: User Credit Transaction
  - name: Files
paths:
  /v2/user_accounts/{user_account_id}/entity_relationships/{entity_id}:
    delete:
      tags:
        - User Account
      summary: Delete user account entity relationship
      description: >-
        Remove an Entity from a User Account and return the updated list of
        relationships. Send `relationship_type` to identify which relationship
        to remove.
      operationId: delete-user-account-entity-relationship-v2
      parameters:
        - name: user_account_id
          in: path
          required: true
          description: User Account ID
          schema:
            $ref: '#/components/schemas/UserAccountID'
        - name: entity_id
          in: path
          required: true
          description: Entity ID to remove from the user 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 user account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  objects:
                    type: array
                    items:
                      $ref: '#/components/schemas/EntityRelationship'
                required:
                  - objects
        '400':
          description: The request could not be parsed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: request_malformed
                message: The request is invalid and cannot be parsed by the server.
                errors:
                  - code: url_malformed
                    message: The request URL could not be parsed.
        '403':
          description: >-
            `code` is one of:

            `authentication_missing` (the request has no credentials),

            `token_invalid` (the bearer token is missing, expired, or invalid,
            or does not grant `user_account/read_write`),

            `source_ip_not_allowed` (the request came from an IP address that is
            not on your program's allowlist).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: token_invalid
                message: The bearer token is missing, expired, malformed, or invalid.
        '404':
          description: >-
            No user account exists with this ID, the entity does not exist, or
            the entity has no relationship of this type on the user account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: object_not_found
                message: >-
                  No object exists at the requested ID, or it is not visible to
                  this caller.
        '422':
          description: >-
            `code` is one of:

            `parameters_invalid` (`relationship_type` is missing or invalid;
            `errors[].code` is `schema_violation`),

            `lead_control_restricted` (your program is not enabled for User
            Accounts v2; `errors[].code` is `feature_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: parameters_invalid
                message: One or more parameters are invalid.
                errors:
                  - code: schema_violation
                    message: relationship_type is required.
                    parameters:
                      - relationship_type
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: rate_limit_exceeded
                message: >-
                  You have exceeded the rate limit for this endpoint. Retry with
                  backoff.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: internal_server_error
                message: >-
                  Something went wrong on our end. Contact Lead with the
                  Request-Id if this persists.
        '503':
          description: >-
            The service or endpoint is temporarily unavailable. Retry after a
            delay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: service_unavailable
                message: >-
                  The service is temporarily unavailable. Retry after the
                  indicated delay.
        '504':
          description: An upstream system did not respond in time. Retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: gateway_timeout
                message: An upstream system timed out. Retry with backoff.
components:
  schemas:
    UserAccountID:
      type: string
      description: The ID of the User Account object.
      example: user_account_xyz123
      pattern: ^user_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
      example: account_holder
    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
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            A human-readable description of the error family. Identical for
            every occurrence of a given `code`; carries no request-specific
            detail.
          example: One or more parameters are invalid.
        errors:
          type: array
          description: >-
            Zero or more specific errors within this family. Always present for
            validation errors, one entry per failing field.
          items:
            $ref: '#/components/schemas/ErrorItem'
    ErrorCode:
      type: string
      description: >-
        A snake_case code identifying the error family — the stable,
        machine-readable value partners branch on, together with the HTTP
        status.
      example: parameters_invalid
      enum:
        - request_malformed
        - content_too_large
        - idempotency_key_missing
        - authentication_missing
        - token_invalid
        - source_ip_not_allowed
        - url_invalid
        - object_not_found
        - method_not_allowed
        - idempotency_key_in_use
        - idempotency_request_inconsistent
        - rate_limit_exceeded
        - internal_server_error
        - service_unavailable
        - endpoint_disabled
        - gateway_timeout
        - unclassified
        - parameters_invalid
        - related_object_invalid
        - related_object_not_ready
        - related_object_conflict
        - limit_exceeded
        - client_control_restricted
        - lead_control_restricted
        - object_state_conflict
        - object_modified_concurrently
        - operation_invalid
    ErrorItem:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: A snake_case code naming the specific error or sub-category.
          example: required
        message:
          type: string
          description: >-
            A human-readable description of this specific error, with
            interpolated values where relevant.
          example: account_number_id is required.
        parameters:
          type: array
          description: >-
            The request fields this error implicates, in dot notation for nested
            fields. Present for validation errors.
          items:
            type: string
          example:
            - account_number_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.