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

# Listar segmentos

> Lista segmentos registrados.



## OpenAPI

````yaml /es/contacts-api/api-reference/openapi-contacts.json get /v1/segments
openapi: 3.0.3
info:
  title: Notificar contactos API, etiquetas y audiencia
  description: >-
    API para **CRUD de contactos**, **etiquetas**, **temas**, **segmentos** y
    **campañas** (plantilla + audiencia + canales).


    **Contacto:** al menos uno de los **teléfono** o **correo electrónico**
    (único por espacio de trabajo). **Idiomas:** `languages` es una serie de
    códigos BCP-47 permitidos (enumerados en **`GET
    /v1/meta/contact-locales`**); orden = prioridad. **Telegram:** use
    **`telegramLinks`** (`instanceId` + `peer`) para múltiples instancias de
    Telegram en el mismo espacio de trabajo; **`telegramPeer`** permanece como
    un acceso directo heredado (rellena el enlace en la **instancia
    predeterminada de Telegram** del espacio de trabajo). En la campaña, el par
    utilizado es el de **`telegramInstanceId`** de la campaña (o
    predeterminado), con *respaldo* a `telegramPeer`.


    **Campañas:** `channels` puede incluir `whatsapp`, `sms`, `email`,
    `telegram`. Cada canal enumerado debe estar **habilitado en la plantilla**.
    **`instanceId`** = WhatsApp; **`telegramInstanceId`** = Telegrama.


    **Tarjeta WhatsApp:** `POST /v1/whatsapp/messages` con `type: "contact"` y
    `payload.contactId`.


    **Autenticación:** `Authorization: Bearer sk_live_xxxxx` o `x-api-key`.


    **Alcances:** `contacts:*`, `tags:*`, `topics:*`, `segments:*`,
    `campaigns:*` (incluye `campaigns:run`).


    **Extras de campaña:** `POST .../cancel` (BORRADOR/PROGRAMADO), `GET
    .../stats` y `GET .../recipients` (actualización/lectura de alcances).
    Ejecutar devuelve `runId`. Grupo de envío de WhatsApp: panel de control.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Producción
security:
  - ntfContactBearerAuth: []
  - ntfContactApiKeyHeader: []
tags:
  - name: Contatos
    description: >-
      CRUD de contactos del espacio de trabajo (teléfono o correo electrónico;
      etiquetas)
  - name: Tags
    description: Tags (etiquetas) para vincular a contactos
  - name: Temas
    description: Temas de comunicación (marketing/inscripción por tema)
  - name: Segmentos
    description: >-
      Segmentos de audiencia (DSL v1). Reglas: etiqueta, propiedad, campo de
      contacto, tema, recibirMarketing. Segmentos de ámbitos:
      leer|crear|actualizar|eliminar.
  - name: Campanhas
    description: Campañas multicanal con plantilla; ejecución vía POST .../ejecutar
paths:
  /v1/segments:
    get:
      tags:
        - Segmentos
      summary: Listar segmentos
      description: Lista segmentos registrados.
      operationId: ntfContact_getV1Segments
      responses:
        '200':
          description: Lista en `data`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_SegmentListResponse'
              examples:
                ok:
                  summary: Lista de segmentos
                  value:
                    success: true
                    data:
                      - id: clseg01abc
                        name: Cachoeiro VIP con marketing
                        definition:
                          version: 1
                          match: all
                          rules:
                            - type: tag
                              tagId: cltag01vip
                            - type: property
                              key: cidade
                              op: contains
                              value: cachoeiro
                              ignoreCase: true
                            - type: topic
                              topicId: cltopic01
                              subscribed: true
                            - type: contactField
                              field: languages
                              op: includes
                              value: pt-BR
                            - type: receiveMarketing
                              value: true
                        createdAt: '2026-06-28T12:00:00.000Z'
                        updatedAt: '2026-07-01T09:00:00.000Z'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
        '402':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
components:
  schemas:
    NtfContact_SegmentListResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/NtfContact_Segment'
      example:
        success: true
        data:
          - id: clseg01abc
            name: Cachoeiro VIP con marketing
            definition:
              version: 1
              match: all
              rules:
                - type: tag
                  tagId: cltag01vip
                - type: property
                  key: cidade
                  op: contains
                  value: cachoeiro
                  ignoreCase: true
                - type: topic
                  topicId: cltopic01
                  subscribed: true
                - type: contactField
                  field: languages
                  op: includes
                  value: pt-BR
                - type: receiveMarketing
                  value: true
            createdAt: '2026-06-28T12:00:00.000Z'
            updatedAt: '2026-07-01T09:00:00.000Z'
    NtfContact_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: >-
            Etiqueta de error de estilo HTTP (por ejemplo, no autorizado,
            solicitud incorrecta, no encontrada).
        message:
          type: string
          description: >-
            Mensaje legible por humanos para usuarios finales (localizado a
            través de Accept-Language/x-locale cuando corresponda).
        code:
          type: string
          description: >-
            Código API v1 estable (enumeración). Siempre presente en los
            errores. Úselo con el estado HTTP para decidir reintentar o
            corregir. Ver [Respuestas de
            error](/es/guides/conceitos/resposta-de-erros).
      required:
        - success
        - error
        - message
        - code
    NtfContact_Segment:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        definition:
          $ref: '#/components/schemas/NtfContact_SegmentDefinition'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      example:
        id: clseg01abc
        name: Cachoeiro VIP con marketing
        definition:
          version: 1
          match: all
          rules:
            - type: tag
              tagId: cltag01vip
            - type: property
              key: cidade
              op: contains
              value: cachoeiro
              ignoreCase: true
            - type: topic
              topicId: cltopic01
              subscribed: true
            - type: contactField
              field: languages
              op: includes
              value: pt-BR
            - type: receiveMarketing
              value: true
        createdAt: '2026-06-28T12:00:00.000Z'
        updatedAt: '2026-07-01T09:00:00.000Z'
    NtfContact_SegmentDefinition:
      type: object
      description: >-
        DSL v1: versión, coincidencia (todas|cualquiera), reglas (comieron 32).
        Tipos: etiqueta, propiedad, campo de contacto, tema, recibirMarketing.
      required:
        - version
        - match
        - rules
      properties:
        version:
          type: integer
          enum:
            - 1
          example: 1
        match:
          type: string
          enum:
            - all
            - any
          example: all
        rules:
          type: array
          maxItems: 32
          description: Lista vacía = todos los contactos.
          items:
            $ref: '#/components/schemas/NtfContact_SegmentRule'
          example:
            - type: property
              key: cidade
              op: containsOneOf
              value: cachoeiro,marataizes
              ignoreCase: true
            - type: topic
              topicId: cltopic01
              subscribed: true
            - type: contactField
              field: hasEmail
              op: isTrue
            - type: receiveMarketing
              value: true
      example:
        version: 1
        match: all
        rules:
          - type: tag
            tagId: cltag01vip
          - type: property
            key: cidade
            op: contains
            value: cachoeiro
            ignoreCase: true
          - type: topic
            topicId: cltopic01
            subscribed: true
          - type: contactField
            field: languages
            op: includes
            value: pt-BR
          - type: receiveMarketing
            value: true
    NtfContact_SegmentRule:
      type: object
      description: Una regla de segmento. Los campos dependen del tipo.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - tag
            - property
            - contactField
            - topic
            - receiveMarketing
          example: property
        tagId:
          type: string
          description: Obligatorio cuando tipo = etiqueta
          example: cltag01vip
        key:
          type: string
          description: Clave de campo personalizado (tipo=propiedad)
          example: cidade
        value:
          description: >-
            Valor de la regla (cadena/número/booleano según operación).
            contieneOneOf utiliza CSV.
          oneOf:
            - type: string
            - type: number
            - type: boolean
          example: cachoeiro,marataizes
        op:
          type: string
          description: >-
            Operador escrito (propiedad/campo de contacto). Prefiérelo a
            valueMatch.
          example: containsOneOf
        valueMatch:
          type: string
          enum:
            - exact
            - contains
          description: Legado de la propiedad STRING. Prefiero op.
        ignoreCase:
          type: boolean
          example: true
        field:
          type: string
          description: Campo de plataforma cuando tipo = contactField
          enum:
            - name
            - phone
            - email
            - url
            - telegramPeer
            - languages
            - hasPhone
            - hasEmail
            - hasUrl
            - hasTelegram
          example: phone
        topicId:
          type: string
          description: Obligatorio cuando tipo = tema
          example: cltopic01
        subscribed:
          type: boolean
          description: Cuando tipo = tema
          example: true
      example:
        type: tag
        tagId: cltag01vip
  securitySchemes:
    ntfContactBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Autorización: Portador sk_live_xxxxx'
    ntfContactApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'x-api-clave: sk_live_xxxxx'

````