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

# Remove a tag from a contact

> Remove a tag by name (URL-encode it), matched trimmed and case-insensitively. Idempotent: a tag the contact doesn't have answers `200` unchanged. Removing a tag starts no workflow.

### Remove a tag from a contact

**Method:** `DELETE` | **Endpoint:** `/v1/contacts/{contact_id}/tags/{name}`

**Description:** Take a tag off a contact by name, ignoring case and outer spaces. Calling it for a tag the contact doesn't have changes nothing. Removing a tag starts no workflow, and the tag itself stays available for other contacts.

**Authentication:** API key in the `Authorization` header: `Authorization: Bearer ib_pk_<64 hex>`. Create keys in the dashboard under **Settings → API access**.

#### Request Body

None. The path parameters are `contact_id`, the contact's ID (a UUID), and `name`, the tag name, URL-encoded (`Spring%20promo`). If two tags differ only by case (`VIP` and `vip`), both come off.

```bash cURL theme={null}
# URL-encode the tag name: "Spring promo" becomes Spring%20promo.
curl -X DELETE https://api.ibubbl.com/v1/contacts/c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f/tags/vip \
  -H "Authorization: Bearer $IBUBBL_API_KEY"
```

```typescript TypeScript theme={null}
const contactId = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f";
const tag = "vip";

const res = await fetch(`https://api.ibubbl.com/v1/contacts/${contactId}/tags/${encodeURIComponent(tag)}`, {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.IBUBBL_API_KEY}` },
  signal: AbortSignal.timeout(10_000),
});

const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.detail?.error}`);
console.log(data.tags);
```

```python Python theme={null}
import os
from urllib.parse import quote

import requests

API_KEY = os.environ["IBUBBL_API_KEY"]

contact_id = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f"
tag = "vip"

res = requests.delete(
    f"https://api.ibubbl.com/v1/contacts/{contact_id}/tags/{quote(tag, safe='')}",
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['detail']['error']}")
print(data["tags"])
```

```json 200 OK theme={null}
{
  "id": "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f",
  "phone": "+14155551234",
  "first_name": "Sam",
  "last_name": "Rivera",
  "email": "sam@example.com",
  "city": "Brooklyn",
  "state": "NY",
  "timezone": "America/New_York",
  "tags": [
    "Spring promo"
  ],
  "opted_out": false,
  "opted_out_at": null,
  "blocked": false,
  "blocked_at": null,
  "created_at": "2026-11-05T14:23:45.123Z"
}
```

```json 404 Not Found theme={null}
{
  "detail": {
    "error": "not_found",
    "message": "Contact not found"
  }
}
```

#### Responses

**200 OK**

```json theme={null}
{
  "id": "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f",
  "phone": "+14155551234",
  "first_name": "Sam",
  "last_name": "Rivera",
  "email": "sam@example.com",
  "city": "Brooklyn",
  "state": "NY",
  "timezone": "America/New_York",
  "tags": [
    "Spring promo"
  ],
  "opted_out": false,
  "opted_out_at": null,
  "blocked": false,
  "blocked_at": null,
  "created_at": "2026-11-05T14:23:45.123Z"
}
```

The contact, with the tags it has left.

**401 Unauthorized**

```json theme={null}
{
  "detail": {
    "error": "unauthorized",
    "message": "Invalid or revoked API key"
  }
}
```

Other `message` values: `Authorization Bearer token required`, `API key required (use Authorization: Bearer ib_pk_…)`, `Invalid API key format`, `Customer account not found`.

**403 Forbidden**

```json theme={null}
{
  "detail": {
    "error": "forbidden",
    "message": "Account is suspended"
  }
}
```

Your iBubbl account is suspended or cancelled (`message` is then `Account is cancelled`). Every API-key endpoint returns this.

**404 Not Found**

```json theme={null}
{
  "detail": {
    "error": "not_found",
    "message": "Contact not found"
  }
}
```

Also returned for a malformed ID, a deleted contact, and a contact that belongs to another account.


## OpenAPI

````yaml DELETE /v1/contacts/{contact_id}/tags/{name}
openapi: 3.1.0
info:
  title: iBubbl API
  version: v1
  description: >-
    The iBubbl REST API. Send iMessages, manage contacts, and subscribe to
    webhook events from your backend.


    Authenticate every request with a Bearer API key (`ib_pk_<hex>`) — generate
    one from your dashboard's API Access settings. See the
    [Authentication](/authentication) guide.
servers:
  - url: https://api.ibubbl.com
security:
  - BearerAuth: []
tags:
  - name: Messages
  - name: Contacts
  - name: Conversations
  - name: Webhooks
  - name: Inbound Events
paths:
  /v1/contacts/{contact_id}/tags/{name}:
    delete:
      tags:
        - Contacts
      summary: Remove a tag from a contact
      description: >-
        Remove a tag by name (URL-encode it), matched trimmed and
        case-insensitively. Idempotent: a tag the contact doesn't have answers
        `200` unchanged. Removing a tag starts no workflow.
      operationId: v1_remove_contact_tag_v1_contacts__contact_id__tags__name__delete
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
            title: Contact Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      responses:
        '200':
          description: The contact, with its tags.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: '`forbidden`: your iBubbl account is suspended or cancelled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Contact not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    Contact:
      properties:
        id:
          type: string
          title: Id
          description: Unique contact identifier (UUID).
        phone:
          type: string
          title: Phone
          description: >-
            Contact's phone number as first seen. Usually E.164; a contact first
            created by an inbound SMS can carry the sender's bare national form
            (e.g. `4155551234`). Upserting any form of the same number returns
            this contact.
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
          description: >-
            IANA timezone used for this contact's sending hours, or null if not
            set yet. When it is null and the number is a US or Canadian one,
            iBubbl infers the zone from the area code and saves it here when the
            contact's first message is processed; otherwise your account's
            timezone is used. Once set, an upsert never replaces it, so pass
            `timezone` on the first upsert, before you send, or change it with
            PATCH.
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: The contact's tag names, sorted case-insensitively.
        opted_out:
          type: boolean
          title: Opted Out
          description: >-
            True if this person has opted out: a STOP reply, a rep in the
            dashboard, a Do Not Disturb in your connected GoHighLevel account,
            or `POST /v1/contacts/{id}/opt-out`. When true, every send to this
            contact returns `422 contact_opted_out`. An opt-out can't be undone,
            and it belongs to the number: a contact deleted and created again is
            still opted out.
        opted_out_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Opted Out At
          description: ISO 8601 UTC timestamp of the opt-out, or null.
        blocked:
          type: boolean
          title: Blocked
          description: >-
            True if you blocked this contact (dashboard or `POST
            /v1/contacts/{id}/block`). Sends to them return `422
            contact_blocked` until you unblock them. Unlike an opt-out, a block
            is yours to undo, and it fires no webhook.
          default: false
        blocked_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Blocked At
          description: ISO 8601 UTC timestamp of the block, or null.
        created_at:
          type: string
          title: Created At
          description: ISO 8601 UTC timestamp the contact was created.
      type: object
      required:
        - id
        - phone
        - opted_out
        - created_at
      title: Contact
      example:
        blocked: false
        city: Brooklyn
        created_at: '2026-05-17T14:23:45.123Z'
        email: sam@example.com
        first_name: Sam
        id: c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f
        last_name: Rivera
        opted_out: false
        phone: '+14155551234'
        state: NY
        tags:
          - Spring promo
          - VIP
        timezone: America/Los_Angeles
    ApiError:
      properties:
        detail:
          allOf:
            - $ref: '#/components/schemas/ApiErrorDetail'
          description: >-
            Error envelope. Every `/v1` error response wraps a stable `error`
            code and a human-readable `message` in `detail`.
      type: object
      required:
        - detail
      title: ApiError
      example:
        detail:
          error: validation_error
          message: >-
            Exactly one of contact_id, to, chat_guid, or participant_phones is
            required
    ApiErrorDetail:
      properties:
        error:
          type: string
          title: Error
          description: >-
            Stable machine-readable error code. Use this for branching logic in
            your integration; the human-readable `message` is subject to change.
            See the Error Reference for the catalog.
          examples:
            - validation_error
        message:
          type: string
          title: Message
          description: Human-readable description of what went wrong.
          examples:
            - >-
              Exactly one of contact_id, to, chat_guid, or participant_phones is
              required
      type: object
      required:
        - error
        - message
      title: ApiErrorDetail
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ib_pk_<64 hex>
      description: >-
        Bearer API key. Format: `Authorization: Bearer ib_pk_<64 hex>` (70
        characters). Generate keys from Dashboard → Settings → API Access.

````

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