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

# Update a saved segment

> Rename, re-describe or re-filter a list. `list_type` is immutable; create a new list to change direction.



## OpenAPI

````yaml /public_openapi.json patch /api/public/v1/contacts/lists/{list_id}
openapi: 3.0.3
info:
  title: ColdSend Public API
  description: >-
    Programmatic access to ColdSend for managing cold email campaigns and sender
    accounts.
  version: 1.0.0
  contact:
    name: ColdSend Support
    email: support@coldsend.pro
    url: https://coldsend.pro
servers:
  - url: https://api.coldsend.pro
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/public/v1/contacts/lists/{list_id}:
    patch:
      tags:
        - Contacts
      summary: Update a saved segment
      description: >-
        Rename, re-describe or re-filter a list. `list_type` is immutable;
        create a new list to change direction.
      operationId: update_contact_list_api_public_v1_contacts_lists__list_id__patch
      parameters:
        - name: list_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: List Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactListUpdate'
      responses:
        '200':
          description: List updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListApiResponse'
        '403':
          description: Insufficient permissions - requires 'contacts:update' scope
        '404':
          description: List not found in this team
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ContactListUpdate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
          title: Name
        description:
          type: string
          maxLength: 500
          nullable: true
          title: Description
        filter_definition:
          $ref: '#/components/schemas/ContactFilterSpec'
          nullable: true
      additionalProperties: false
      type: object
      title: ContactListUpdate
      description: Patch a saved segment. `list_type` is immutable.
    ContactListApiResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        message:
          type: string
          title: Message
        contact_list:
          $ref: '#/components/schemas/ContactListResponse'
      type: object
      required:
        - message
        - contact_list
      title: ContactListApiResponse
      description: Response carrying a single saved segment.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContactFilterSpec:
      properties:
        signal:
          items:
            $ref: '#/components/schemas/ContactSignal'
          type: array
          nullable: true
          title: Signal
          description: Match any of these engagement signals
        tag_ids:
          items:
            type: string
            format: uuid
          type: array
          nullable: true
          title: Tag Ids
          description: Match contacts carrying any of these tag IDs
        is_unsubscribed:
          type: boolean
          nullable: true
          title: Is Unsubscribed
          description: Filter on team-level suppression
        is_bounced:
          type: boolean
          nullable: true
          title: Is Bounced
          description: Filter on whether any membership bounced
        source_type:
          items:
            $ref: '#/components/schemas/ContactSourceType'
          type: array
          nullable: true
          title: Source Type
          description: Match any of these acquisition sources
        source_name:
          type: string
          maxLength: 255
          nullable: true
          title: Source Name
          description: Exact origin name, e.g. the uploaded file name
        campaign_id:
          type: string
          format: uuid
          nullable: true
          title: Campaign Id
          description: Only contacts with a membership in this campaign
        not_in_campaign_id:
          type: string
          format: uuid
          nullable: true
          title: Not In Campaign Id
          description: Exclude contacts already in this campaign
        last_touch_after:
          type: string
          format: date-time
          nullable: true
          title: Last Touch After
          description: Last outbound contact at or after this time
        last_touch_before:
          type: string
          format: date-time
          nullable: true
          title: Last Touch Before
          description: Last outbound contact strictly before this time
        has_replied:
          type: boolean
          nullable: true
          title: Has Replied
          description: Filter on whether the contact ever replied
        has_opened:
          type: boolean
          nullable: true
          title: Has Opened
          description: Filter on whether the contact ever opened
        search:
          type: string
          maxLength: 255
          nullable: true
          title: Search
          description: Substring match across email, name and company
      additionalProperties: false
      type: object
      title: ContactFilterSpec
      description: >-
        The v1 directory filter set.


        Deliberately a fixed, indexed set rather than a general boolean query

        builder: every field below resolves to an index on `contacts` or to an

        EXISTS over an indexed child, so a filter combination cannot degrade
        into

        a sequential scan of a team's directory.


        Multiple fields AND together. Within a list-valued field the values OR

        together (`signal=["HOT_LEAD","ENGAGED"]` means either).


        `extra="forbid"` is load-bearing. This model parses `filter_definition`

        JSONB written by earlier versions of the UI, and a silently-ignored

        unknown key would widen a saved segment instead of failing it -- which,

        for a list that feeds a campaign, means emailing people the segment was

        written to exclude.


        Note there is no `list_id` field. Resolving a list is the service's job,

        precisely so a DYNAMIC list's filter cannot reference another list (or

        itself) and recurse.
    ContactListResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        team_id:
          type: string
          format: uuid
          title: Team Id
        name:
          type: string
          title: Name
        description:
          type: string
          nullable: true
          title: Description
        list_type:
          type: string
          title: List Type
        filter_definition:
          additionalProperties: true
          type: object
          nullable: true
          title: Filter Definition
        created_by_user_id:
          type: string
          format: uuid
          nullable: true
          title: Created By User Id
        cached_count:
          type: integer
          nullable: true
          title: Cached Count
        count_refreshed_at:
          type: string
          format: date-time
          nullable: true
          title: Count Refreshed At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - team_id
        - name
        - list_type
        - created_at
        - updated_at
      title: ContactListResponse
      description: A saved segment.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContactSignal:
      type: string
      enum:
        - NEVER_CONTACTED
        - CONTACTED
        - ENGAGED
        - HOT_LEAD
        - BOUNCED
        - UNSUBSCRIBED
      title: ContactSignal
      description: |-
        Engagement signal for a directory contact.

        Materialised onto `contacts.signal` by the contact rollup job so the
        directory can filter and sort on it without touching `leads`. Derived
        from the contact's campaign memberships in strict precedence order --
        the first match wins:

            UNSUBSCRIBED    : suppressed for this team, i.e. a row exists in
                              `unsubscribes` for (team_id, email) with
                              unsubscribed_at IS NOT NULL. Suppression is
                              email-keyed, so this is independent of any
                              particular lead row.
            BOUNCED         : a membership bounced and the contact has never
                              otherwise engaged.
            HOT_LEAD        : a thread carries a positive INTENT tag
                              (Demo Booked / Interested).
            ENGAGED         : has replied or opened, or a thread carries the
                              Question INTENT tag.
            CONTACTED       : has been sent to, but no engagement recorded.
            NEVER_CONTACTED : no membership has been sent yet.

        A non-NULL `contacts.signal_override` always wins over the derived
        value, so a manually pinned signal is never clobbered by the job.

        Mirrors the `contactsignal` Postgres enum created in migration
        `20260826_0001_add_contact_directory.py`. Keep in sync.
    ContactSourceType:
      type: string
      enum:
        - CSV
        - MANUAL
        - COPY
        - EXTERNAL_EMAIL
        - API
      title: ContactSourceType
      description: |-
        How a contact first entered the directory.

        Stored as a plain string column (not a Postgres enum) to match the
        existing `lead_batches.source_type` convention; this class is the
        canonical set of allowed values and is enforced by a CHECK constraint.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key with format cs_live_xxx

````

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