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

# Remove a dedicated IP from a pool

> Remove the dedicated IP from the pool. The IP is kept but carries no mail until added to a pool again. Removing the last IP requires `force=true` and `drain=true`.



## OpenAPI

````yaml /openapi/source/external/email/email.json delete /email/ip_pools/{id}/ips/{ip_id}
openapi: 3.0.3
info:
  x-latency-category: responsive
  x-endpoint-cost: light
  title: Telnyx API
  description: >-
    Programmable email: sending, templates, validation, events, agent inboxes,
    drafts, threads, domains & DKIM, suppressions and unsubscribe groups.
  version: 2.0.0
  contact:
    name: Telnyx
    url: https://telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - BearerAuth: []
tags:
  - name: Email Validations
    description: Validate email addresses synchronously or in asynchronous batches.
  - name: Email Templates
    description: Create, list, retrieve, update, delete, and render Liquid email templates.
  - name: Email Messages
    description: >-
      Send and manage email messages. Legacy `/v2/emails` routes are aliases for
      these endpoints.
  - name: Email Events
    description: Retrieve account-level email events and event statistics.
  - name: Email Inboxes
    description: >-
      Create and manage agent inboxes, retrieve inbound messages and threads,
      and reply to or forward messages.
  - name: Email Drafts
    description: >-
      Create, list, retrieve, update, delete, and send unsent draft messages
      belonging to an agent inbox.
  - name: Email Threads
    description: >-
      Account-wide conversation threads across every inbox, for agents operating
      many inboxes at once.
  - name: Email Domains
    description: Email domain CRUD operations
  - name: Email Domain DNS Records
    description: DNS verification records for email domains
  - name: Email Webhooks
    description: Per-domain webhook endpoints with event subscriptions
  - name: Email Suppressions
    description: Recipient suppression records (`/v2/email_blocks`).
  - name: Email Suppression Imports
    description: Async CSV import of competitor suppression lists.
  - name: Email Unsubscribe Groups
    description: Named groups and group-scoped suppressions.
  - name: Dedicated IPs
    description: >-
      Purchase and manage dedicated sending IP addresses for your Telnyx email
      traffic.
  - name: IP Pools
    description: Group dedicated IPs into pools for sending.
paths:
  /email/ip_pools/{id}/ips/{ip_id}:
    delete:
      tags:
        - IP Pools
      summary: Remove a dedicated IP from a pool
      description: >-
        Remove the dedicated IP from the pool. The IP is kept but carries no
        mail until added to a pool again. Removing the last IP requires
        `force=true` and `drain=true`.
      operationId: removeIpFromPool
      parameters:
        - name: id
          in: path
          required: true
          description: The IP pool identifier (UUID).
          schema:
            type: string
            format: uuid
        - name: ip_id
          in: path
          required: true
          description: The dedicated IP identifier (UUID).
          schema:
            type: string
            format: uuid
        - name: force
          in: query
          required: false
          description: >-
            Set together with `drain=true` to remove the last IP in the pool.
            Either flag alone has no effect.
          schema:
            type: boolean
            default: false
        - name: drain
          in: query
          required: false
          description: >-
            Set together with `force=true` to remove the last IP in the pool.
            Acknowledges that mail routed to the emptied pool is held until the
            pool has a sendable IP again.
          schema:
            type: boolean
            default: false
      responses:
        '204':
          description: IP removed from the pool. No response body.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: >-
            The pool or the dedicated IP was not found, or the IP is not in this
            pool.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                errors:
                  - code: '10001'
                    title: Not Found
                    detail: The requested pool membership was not found
        '409':
          description: >-
            The IP is the pool's last member and `force`/`drain` were not both
            set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                errors:
                  - code: '40901'
                    title: Conflict
                    detail: >-
                      cannot remove the last IP from a pool without force: true
                      and drain: true (in-flight messages need a routable
                      source)
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            await client.email.ipPools.ips.delete('id', 'ip_id');
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            client.email.ip_pools.ips.delete(
                "id",
                "ip_id",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Email.IPPools.Ips.Delete(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\t\"ip_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    client.email().ipPools().ips().delete("id", "ip_id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.email.ip_pools.ips.delete("id", "ip_id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->email->ipPools->ips->delete(
                'id',
                'ip_id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx email:ip-pools:ips delete \
              --api-key 'My API Key' \
              --id id \
              --ip-id ip_id
components:
  schemas:
    ErrorEnvelope:
      type: object
      description: Telnyx v2 error envelope.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
                  parameter:
                    type: string
      required:
        - errors
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Telnyx API key supplied as `Authorization: Bearer <token>`. In
        production, auth may be validated by the API gateway and forwarded via
        Telnyx auth headers.

````