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

# Step 1 Get remove users payload (passkey or wallet)

> Get the payload to sign in order to remove users from an account. Nothing is removed yet: the same user IDs
must be sent again to `remove-users` with the signature.

A `root` user cannot be removed: demote them with `update-users-role` first. The account's KYC subject and the
beneficiaries of an entity account (UBOs, directors) are not removed either: they stay on the account with the
`beneficiary` role, and only their access is revoked. A self-custodial account must keep at least one member.

A Turnkey account receives `bodyToSign`, the Turnkey `DELETE_USERS` request to stamp with a root user's passkey.
A self-custodial account receives `typedData` and `issuedAt`: the EIP-712 typed data to sign with the account
wallet (`eth_signTypedData_v4`), on the requested chain (Ethereum when `chain_id` is omitted).



## OpenAPI

````yaml /api-reference/openapi-integrator.json post /v1/query/get-remove-users-payload
openapi: 3.0.3
info:
  title: Byzantine Integrator API
  description: Byzantine REST API for integrators.
  license:
    name: ''
  version: 0.2.0
servers:
  - url: https://api.byzantine.fi
    description: Prod deployment
security: []
tags:
  - name: API health
    description: Check API status.
  - name: Customer management
    description: Endpoints to create, update, and retrieve customer information.
  - name: Account management
    description: Endpoints to manage accounts, bank accounts, invitations, and user roles.
  - name: Products
    description: Endpoints to get data about products and vaults.
  - name: Transactions
    description: Endpoints to create and manage transactions.
  - name: OTP authentication
    description: Endpoints to initialize and manage user authentication with OTP.
  - name: Events
    description: Endpoints to list lifecycle events.
  - name: Webhooks
    description: Integrator-managed outbound webhook subscriptions and delivery history.
  - name: Integrator key management
    description: >-
      Endpoints to inspect the current integrator credential scope, create,
      update and delete integrator keys.
paths:
  /v1/query/get-remove-users-payload:
    post:
      tags:
        - Account management
      summary: Step 1 Get remove users payload (passkey or wallet)
      description: >-
        Get the payload to sign in order to remove users from an account.
        Nothing is removed yet: the same user IDs

        must be sent again to `remove-users` with the signature.


        A `root` user cannot be removed: demote them with `update-users-role`
        first. The account's KYC subject and the

        beneficiaries of an entity account (UBOs, directors) are not removed
        either: they stay on the account with the

        `beneficiary` role, and only their access is revoked. A self-custodial
        account must keep at least one member.


        A Turnkey account receives `bodyToSign`, the Turnkey `DELETE_USERS`
        request to stamp with a root user's passkey.

        A self-custodial account receives `typedData` and `issuedAt`: the
        EIP-712 typed data to sign with the account

        wallet (`eth_signTypedData_v4`), on the requested chain (Ethereum when
        `chain_id` is omitted).
      operationId: get_remove_users_payload
      parameters:
        - name: X-Pubkey
          in: header
          description: >-
            Integrator's ECDSA public key (P-256 curve, compressed SEC1 format).
            Example:
            0x038fedef7c12f93bbf342ad8943b7a825a3b41f61c9dc118b2c718efebabbf62fd
          required: true
          schema:
            type: string
        - name: X-Timestamp
          in: header
          description: >-
            Unix timestamp in seconds (UTC). Must be within tolerance window (1
            minute) to prevent replay attacks. Example: 1760375826
          required: true
          schema:
            type: string
        - name: X-Signature
          in: header
          description: >-
            ECDSA signature (DER-encoded, hex with 0x prefix). Signs the
            message: `{timestamp}{METHOD}{path_and_query}{json_body}`. Example:
            0x3045022100...
          required: true
          schema:
            type: string
        - name: chain_id
          in: query
          description: >-
            Chain ID the intent is bound to (1 for Ethereum, 8453 for Base).
            Defaults to 1. Only used by self-custodial accounts
          required: false
          schema:
            type: integer
            format: int32
            nullable: true
            minimum: 0
      requestBody:
        description: Body to remove users from an existing account
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoveUsersRequest'
        required: true
      responses:
        '200':
          description: Payload to sign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoveUsersRequestResponse'
        '400':
          description: >-
            Invalid request payload, invalid chain ID, user not in the account,
            root user or beneficiary without access, or last member of a
            self-custodial account
        '401':
          description: Unauthorized - Invalid credential or signature
        '404':
          description: Account not found
        '500':
          description: Internal server error
      security:
        - integrator_auth: []
components:
  schemas:
    RemoveUsersRequest:
      type: object
      description: Request body for removing users from a Byzantine account
      required:
        - accountId
        - userIds
      properties:
        accountId:
          $ref: '#/components/schemas/Uuid'
        userIds:
          type: array
          items:
            $ref: '#/components/schemas/Uuid'
          description: >-
            The IDs of the users to remove. A `root` user cannot be removed:
            demote them first.
    RemoveUsersRequestResponse:
      type: object
      properties:
        bodyToSign:
          allOf:
            - $ref: '#/components/schemas/DeleteUsersRequest'
          nullable: true
        typedData:
          type: object
          description: >-
            Self-custodial accounts: the EIP-712 typed data to sign with the
            account wallet (`eth_signTypedData_v4`).
          nullable: true
        issuedAt:
          type: integer
          format: int64
          description: >-
            Self-custodial accounts: the `issuedAt` of the typed data (unix
            seconds), to send back with the wallet signature.
          example: 1700000000
          nullable: true
          minimum: 0
    Uuid:
      type: string
      format: uuid
      description: A UUID string
      example: 550e8400-e29b-41d4-a716-446655440000
    DeleteUsersRequest:
      type: object
      description: >-
        The object that needs to be signed by a root user to delete users from a
        Byzantine account's sub-organization.
      required:
        - type
        - timestampMs
        - organizationId
        - parameters
      properties:
        type:
          type: string
          description: Defaults to `ACTIVITY_TYPE_DELETE_USERS`
          example: ACTIVITY_TYPE_DELETE_USERS
        timestampMs:
          type: string
          description: UNIX timestamp of the creation of the request.
        organizationId:
          type: string
          description: The account ID (sub-organization ID) the users are removed from.
          example: d107c1e1-766a-4091-802c-de61a3973e91
        parameters:
          $ref: '#/components/schemas/DeleteUsersParams'
    DeleteUsersParams:
      type: object
      description: The Turnkey user IDs to delete.
      required:
        - userIds
      properties:
        userIds:
          type: array
          items:
            type: string
  securitySchemes:
    integrator_auth:
      type: apiKey
      in: header
      name: X-Pubkey, X-Timestamp, X-Signature

````

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