---
title: "Partially update a segment"
method: PATCH
path: "/v1/projectId/{projectId}/segments/{id}"
tags: ["Segments"]
---

# Partially update a segment

`PATCH /v1/projectId/{projectId}/segments/{id}`

## Request

- Base URL: `https://api.bluefox.email`
- URL: `https://api.bluefox.email/v1/projectId/{projectId}/segments/{id}`
- Auth: HTTP bearer

Merges the given fields into the existing document - omitted fields are left unchanged. Nothing is required (unlike create) since every field is optional on a partial update.

## Path parameters

- `projectId` string, required
- `id` string, required

## Request body

- SegmentInputPatch
  - `name` string
  - `groups` object[]: OR-ed groups of AND-ed conditions - matches the segment builder in the app.
    - `conditions` object[]
      - `category` 'contact-property' | 'engagement'
      - `property` string: A custom contact field name, or "createdAt". Required unless operator is "any" or a tag operator.
      - `operator` 'any' | 'equals' | 'does-not-equal' | 'contains' | 'does-not-contain' | 'is-empty' | 'is-not-empty' | 'is-true' | 'is-false' | 'greater-than' | 'greater-than-or-equal' | 'less-than' | 'less-than-or-equal' | 'has-tag' | 'does-not-have-tag' | 'opened' | 'not-opened' | 'clicked' | 'not-clicked' | 'received' | 'not-received' | 'date-equals' | 'date-before' | 'date-after' | 'date-in-last' | 'date-more-than'
      - `value` unknown

## Response `200`

OK

- object
  - `status` integer
  - `result` Segment
    - `_id` string
    - `name` string
    - `groups` object[]: OR-ed groups of AND-ed conditions - matches the segment builder in the app.
      - `conditions` object[]
        - `category` 'contact-property' | 'engagement'
        - `property` string: A custom contact field name, or "createdAt". Required unless operator is "any" or a tag operator.
        - `operator` 'any' | 'equals' | 'does-not-equal' | 'contains' | 'does-not-contain' | 'is-empty' | 'is-not-empty' | 'is-true' | 'is-false' | 'greater-than' | 'greater-than-or-equal' | 'less-than' | 'less-than-or-equal' | 'has-tag' | 'does-not-have-tag' | 'opened' | 'not-opened' | 'clicked' | 'not-clicked' | 'received' | 'not-received' | 'date-equals' | 'date-before' | 'date-after' | 'date-in-last' | 'date-more-than'
        - `value` unknown
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit.
- `403`: Missing or invalid API key
- `404`: Segments not found

---

[API](https://skmtc.dev/bluefox/apis/bluefox-email-public-api.md) · [All operations](https://skmtc.dev/bluefox/apis/bluefox-email-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bluefox/apis/bluefox-email-public-api/revisions/fa1a0a835c7f?raw)
