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

# Remove members from a list

> Removes members by id (`selection.kind: "ids"`, the `id` of each row of `GET /api/v1/lead-lists/{listId}/members`) or everyone matching a filter (`selection.kind: "filter"`; an empty filter empties the list). Only the membership goes: the people and the contact data the workspace bought are kept. Requires `confirm: true`; a filter selection also requires `name`, the list’s exact current name. Ids of another list are ignored.

#### Billing

Free — this endpoint does not consume points.



## OpenAPI

````yaml /openapi.json post /api/v1/lead-lists/{listId}/members/remove
openapi: 3.1.0
info:
  title: Loice API
  version: v1
  description: >-
    The Loice API finds and verifies professional contact data. Every capability
    is exposed here, key-authenticated and rate-limited; the web app is a client
    of the same platform.


    **Authentication** — pass your workspace API key on every request (except
    the API description) as `Authorization: Bearer loice_sk_…`. Keys are created
    under Settings → API Keys.


    **Billing** — operations are billed in points against your workspace
    balance. Each operation below states when the charge applies. The current
    cost of every operation is shown in the app under [Settings →
    Billing](https://app.loice.ai/settings/account?tab=billing) and in the live
    API description, `GET /api/v1/openapi.json`. Calls that fail because of a
    system or provider error (timeouts, upstream failures, our defects) are not
    billed, and rate-limited calls are rejected before any billable work. Check
    headroom with `GET /api/v1/points`. Where an operation documents an
    `Idempotency-Key` header, send one to retry safely: a repeated request
    returns the original outcome and is not charged again.


    **Errors** — every non-200 response has the shape `{ "error": { "message":
    "…" } }`. Operations whose error responses document an `error.code` also
    return that machine-readable code beside the message; branch on the code,
    not the text.
servers:
  - url: https://app.loice.ai
security: []
paths:
  /api/v1/lead-lists/{listId}/members/remove:
    post:
      summary: Remove members from a list
      description: >-
        Removes members by id (`selection.kind: "ids"`, the `id` of each row of
        `GET /api/v1/lead-lists/{listId}/members`) or everyone matching a filter
        (`selection.kind: "filter"`; an empty filter empties the list). Only the
        membership goes: the people and the contact data the workspace bought
        are kept. Requires `confirm: true`; a filter selection also requires
        `name`, the list’s exact current name. Ids of another list are ignored.


        #### Billing


        Free — this endpoint does not consume points.
      parameters:
        - schema:
            type: string
            description: The list id.
          required: true
          description: The list id.
          name: listId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                selection:
                  anyOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - ids
                        ids:
                          type: array
                          items:
                            type: string
                            minLength: 1
                            maxLength: 64
                          minItems: 1
                          maxItems: 10000
                      required:
                        - kind
                        - ids
                    - type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - filter
                        filter:
                          type: object
                          properties:
                            q:
                              type: string
                              maxLength: 200
                            hasEmail:
                              anyOf:
                                - type: boolean
                                - type: string
                                  enum:
                                    - '0'
                                    - '1'
                                    - 'true'
                                    - 'false'
                            emailValid:
                              anyOf:
                                - type: boolean
                                - type: string
                                  enum:
                                    - '0'
                                    - '1'
                                    - 'true'
                                    - 'false'
                            hasMobile:
                              anyOf:
                                - type: boolean
                                - type: string
                                  enum:
                                    - '0'
                                    - '1'
                                    - 'true'
                                    - 'false'
                            crm:
                              type: string
                              enum:
                                - synced
                                - not_synced
                                - failed
                                - imported
                            source:
                              type: string
                              enum:
                                - lead_search
                                - employee_search
                                - finder
                                - linkedin_finder
                                - enrichment
                                - bulk
                                - list
                                - manual
                                - import
                                - crm
                                - icp
                                - company_website
                            columns:
                              type: array
                              items:
                                type: object
                                properties:
                                  field:
                                    type: string
                                    enum:
                                      - firstName
                                      - lastName
                                      - title
                                      - company
                                      - domain
                                      - industry
                                      - location
                                      - email
                                      - phone
                                  op:
                                    type: string
                                    enum:
                                      - contains
                                      - notContains
                                      - equals
                                      - notEquals
                                      - startsWith
                                      - endsWith
                                      - isEmpty
                                      - isNotEmpty
                                  value:
                                    type: string
                                    maxLength: 200
                                    default: ''
                                required:
                                  - field
                                  - op
                              maxItems: 20
                        limit:
                          type: integer
                          minimum: 1
                          maximum: 100000
                        sort:
                          type: string
                          enum:
                            - added_desc
                            - added_asc
                            - name_asc
                            - name_desc
                            - first_name_asc
                            - first_name_desc
                            - last_name_asc
                            - last_name_desc
                            - company_asc
                            - company_desc
                            - title_asc
                            - title_desc
                            - domain_asc
                            - domain_desc
                            - industry_asc
                            - industry_desc
                            - location_asc
                            - location_desc
                            - email_asc
                            - email_desc
                            - email_status_asc
                            - email_status_desc
                            - phone_asc
                            - phone_desc
                      required:
                        - kind
                        - filter
                confirm:
                  type: boolean
                name:
                  type: string
                  maxLength: 120
              required:
                - selection
            example:
              selection:
                kind: ids
                ids:
                  - cmf3x0v2b0003abcd
              confirm: true
      responses:
        '200':
          description: How many members were removed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      removed:
                        type: integer
                        description: Members removed.
                    required:
                      - removed
                required:
                  - data
              example:
                data:
                  removed: 1
        '400':
          description: >-
            `confirmation_required`: `confirm` is not `true`;
            `confirmation_mismatch`: `name` is not the list’s exact current
            name; `selection_too_large`: more than 10,000 members in one call;
            `validation_error`: the body is invalid. Nothing was changed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - unauthenticated
                          - not_found
                          - forbidden
                          - method_not_allowed
                          - idempotency_conflict
                          - idempotency_in_progress
                          - rate_limited
                          - internal_error
                          - run_already_active
                          - run_already_continued
                          - search_unavailable
                          - invalid_continuation
                          - invalid_input
                          - insufficient_credits
                          - incomplete
                          - list_name_taken
                          - confirmation_required
                          - confirmation_mismatch
                          - selection_too_large
                        description: >-
                          Machine-readable error code. Branch on this, not on
                          `message`.
                      message:
                        type: string
                        description: Human-readable explanation.
                      retryAfterSeconds:
                        type: integer
                        description: >-
                          Present on a 429 only: seconds until the workspace may
                          call again (same value as the `Retry-After` header).
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: >-
            API key missing (`Missing API key. Pass it as: Authorization: Bearer
            <key>`), invalid (`Invalid API key`), or expired (`This API key has
            expired`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                    required:
                      - message
                required:
                  - error
        '404':
          description: '`not_found`: no such active list in this workspace.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - unauthenticated
                          - not_found
                          - forbidden
                          - method_not_allowed
                          - idempotency_conflict
                          - idempotency_in_progress
                          - rate_limited
                          - internal_error
                          - run_already_active
                          - run_already_continued
                          - search_unavailable
                          - invalid_continuation
                          - invalid_input
                          - insufficient_credits
                          - incomplete
                          - list_name_taken
                          - confirmation_required
                          - confirmation_mismatch
                          - selection_too_large
                        description: >-
                          Machine-readable error code. Branch on this, not on
                          `message`.
                      message:
                        type: string
                        description: Human-readable explanation.
                      retryAfterSeconds:
                        type: integer
                        description: >-
                          Present on a 429 only: seconds until the workspace may
                          call again (same value as the `Retry-After` header).
                    required:
                      - code
                      - message
                required:
                  - error
        '405':
          description: Method not allowed — see the `Allow` response header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                    required:
                      - message
                required:
                  - error
        '429':
          description: >-
            Rate limit exceeded for this workspace. Retry after the number of
            seconds in the `Retry-After` header (60). Rate-limited calls are
            never billed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                    required:
                      - message
                required:
                  - error
        '500':
          description: '`internal_error`: the write failed on our side.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - unauthenticated
                          - not_found
                          - forbidden
                          - method_not_allowed
                          - idempotency_conflict
                          - idempotency_in_progress
                          - rate_limited
                          - internal_error
                          - run_already_active
                          - run_already_continued
                          - search_unavailable
                          - invalid_continuation
                          - invalid_input
                          - insufficient_credits
                          - incomplete
                          - list_name_taken
                          - confirmation_required
                          - confirmation_mismatch
                          - selection_too_large
                        description: >-
                          Machine-readable error code. Branch on this, not on
                          `message`.
                      message:
                        type: string
                        description: Human-readable explanation.
                      retryAfterSeconds:
                        type: integer
                        description: >-
                          Present on a 429 only: seconds until the workspace may
                          call again (same value as the `Retry-After` header).
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - workspaceApiKey: []
components:
  securitySchemes:
    workspaceApiKey:
      type: http
      scheme: bearer
      description: >-
        Workspace API key (`loice_sk_` + 48 hex characters), created under
        Settings → API Keys. Sent as `Authorization: Bearer loice_sk_…`.
        Invalid, missing, or expired keys are rejected with 401 before any
        billable work happens.

````

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