MepMail Segments API

Saved contact filters for broadcasts.

GitHub OpenAPI

Operations 6

POST /segments Create a segment #
GET /segments List segments #
GET /segments/{id} Retrieve a segment #
PATCH /segments/{id} Update a segment #
DELETE /segments/{id} Delete a segment #
GET /segments/{id}/contacts List a segment's contacts #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mepmail-dev:mepmail-dev-segments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mepmail-dev-segments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mepmail Dev Segments API
  version: 1.0.0
  description: 'Operations tagged Segments across 2 of this provider''s published API definitions: docs.json, mepmail-dev-docs-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.mepmail.dev
  description: MepMail Cloud
- url: '{baseUrl}'
  description: Self-hosted instance
  variables:
    baseUrl:
      default: http://localhost:3001
security:
- apiKey: []
tags:
- name: Segments
  description: Saved contact filters for broadcasts.
paths:
  /segments:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSegmentRequest'
            example:
              name: Customers at example.com
              filter:
                match: all
                conditions:
                - field: email
                  op: ends_with
                  value: '@example.com'
      responses:
        '200':
          description: Segment created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentResponse'
              example:
                object: segment
                id: ae2014de-c168-4c61-8267-70d2662a1ce1
                name: Order updates
                filter:
                  match: all
                  conditions:
                  - field: email
                    op: ends_with
                    value: '@example.com'
                created_at: '2026-10-19T12:00:00.000Z'
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: createSegment
      summary: Create a segment
      tags:
      - Segments
      description: Creates a segment of contacts for broadcasts.
    get:
      parameters:
      - schema:
          type: integer
          minimum: 1
          maximum: 100
          description: Page size, 1-100 (default 20)
        required: false
        description: Page size, 1-100 (default 20)
        name: limit
        in: query
      - schema:
          type: string
          format: uuid
          description: 'Cursor: id of the last item of the previous page. Must be an id this list returned; there is no sentinel value.'
        required: false
        description: 'Cursor: id of the last item of the previous page. Must be an id this list returned; there is no sentinel value.'
        name: after
        in: query
      - schema:
          type: string
          format: uuid
          description: 'Cursor: id of the first item of the next page (page backwards); same rule as after.'
        required: false
        description: 'Cursor: id of the first item of the next page (page backwards); same rule as after.'
        name: before
        in: query
      responses:
        '200':
          description: Segments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSegmentsResponse'
              example:
                object: list
                data:
                - object: segment
                  id: 4ef9a417-02e9-4d39-ad75-9611e0fcc33c
                  name: Order updates
                  filter:
                    match: all
                    conditions:
                    - field: email
                      op: ends_with
                      value: '@example.com'
                  created_at: '2026-10-19T12:00:00.000Z'
                has_more: false
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: listSegments
      summary: List segments
      tags:
      - Segments
      description: Lists the team's segments.
    servers:
    - url: https://api.mepmail.dev
      description: MepMail Cloud
    - url: '{baseUrl}'
      description: Self-hosted instance
      variables:
        baseUrl:
          default: http://localhost:3001
  /segments/{id}:
    get:
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Segment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSegmentResponse'
              example:
                object: segment
                id: ae2014de-c168-4c61-8267-70d2662a1ce1
                name: Order updates
                filter:
                  match: all
                  conditions:
                  - field: email
                    op: ends_with
                    value: '@example.com'
                created_at: '2026-10-19T12:00:00.000Z'
                contact_count: 1
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getSegment
      summary: Retrieve a segment
      tags:
      - Segments
      description: Returns one segment and its filter.
    patch:
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSegmentRequest'
            example:
              name: Example customers
      responses:
        '200':
          description: Segment updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentResponse'
              example:
                object: segment
                id: ae2014de-c168-4c61-8267-70d2662a1ce1
                name: Order updates
                filter:
                  match: all
                  conditions:
                  - field: email
                    op: ends_with
                    value: '@example.com'
                created_at: '2026-10-19T12:00:00.000Z'
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: updateSegment
      summary: Update a segment
      tags:
      - Segments
      description: Renames a segment or changes its filter.
    delete:
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Segment deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoveSegmentResponse'
              example:
                object: segment
                id: ae2014de-c168-4c61-8267-70d2662a1ce1
                deleted: true
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Segment is in use
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: deleteSegment
      summary: Delete a segment
      tags:
      - Segments
      description: Deletes a segment; its contacts stay.
    servers:
    - url: https://api.mepmail.dev
      description: MepMail Cloud
    - url: '{baseUrl}'
      description: Self-hosted instance
      variables:
        baseUrl:
          default: http://localhost:3001
  /segments/{id}/contacts:
    get:
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      - schema:
          type: integer
          minimum: 1
          maximum: 100
          description: Page size, 1-100 (default 20)
        required: false
        description: Page size, 1-100 (default 20)
        name: limit
        in: query
      - schema:
          type: string
          format: uuid
          description: 'Cursor: id of the last item of the previous page. Must be an id this list returned; there is no sentinel value.'
        required: false
        description: 'Cursor: id of the last item of the previous page. Must be an id this list returned; there is no sentinel value.'
        name: after
        in: query
      - schema:
          type: string
          format: uuid
          description: 'Cursor: id of the first item of the next page (page backwards); same rule as after.'
        required: false
        description: 'Cursor: id of the first item of the next page (page backwards); same rule as after.'
        name: before
        in: query
      - schema:
          type: string
          description: 'MepMail extension: comma-separated facets attached to every item — `properties` (the {type, value} map GET /contacts/{id} returns) and `topics` (the rows GET /contacts/{id}/topics returns). Omitted, each item has the Resend shape.'
        required: false
        description: 'MepMail extension: comma-separated facets attached to every item — `properties` (the {type, value} map GET /contacts/{id} returns) and `topics` (the rows GET /contacts/{id}/topics returns). Omitted, each item has the Resend shape.'
        name: include
        in: query
      responses:
        '200':
          description: Contacts the segment resolves to
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListContactsResponse'
              example:
                object: list
                data:
                - id: 4ef9a417-02e9-4d39-ad75-9611e0fcc33c
                  email: customer@example.com
                  first_name: Ana
                  last_name: Silva
                  created_at: '2026-10-19T12:00:00.000Z'
                  unsubscribed: false
                  properties: {}
                  topics:
                  - id: faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb
                    name: Order updates
                    description: Shipping and delivery updates
                    subscription: opt_in
                    explicit: false
                    visibility: public
                has_more: false
        '401':
          description: Missing, malformed or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 'Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: listSegmentContacts
      summary: List a segment's contacts
      tags:
      - Segments
      description: Lists the contacts a segment resolves to right now.
    servers:
    - url: https://api.mepmail.dev
      description: MepMail Cloud
    - url: '{baseUrl}'
      description: Self-hosted instance
      variables:
        baseUrl:
          default: http://localhost:3001
components:
  schemas:
    SegmentFilter:
      type:
      - object
      - 'null'
      properties:
        match:
          type: string
          enum:
          - all
          - any
        conditions:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              op:
                type: string
              value:
                type:
                - string
                - 'null'
                maxLength: 500
            required:
            - field
            - op
            - value
          maxItems: 50
      required:
      - match
      - conditions
    RemoveSegmentResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - segment
        id:
          type: string
          format: uuid
        deleted:
          type: boolean
          enum:
          - true
      required:
      - object
      - id
      - deleted
    CreateSegmentRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        filter:
          $ref: '#/components/schemas/SegmentFilter'
      required:
      - name
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
        name:
          type: string
        message:
          type: string
      required:
      - statusCode
      - name
      - message
    ListContactsResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - list
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              email:
                type: string
              first_name:
                type:
                - string
                - 'null'
              last_name:
                type:
                - string
                - 'null'
              created_at:
                type: string
              unsubscribed:
                type: boolean
              properties:
                type: object
                additionalProperties:
                  anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - string
                      value:
                        type: string
                    required:
                    - type
                    - value
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - number
                      value:
                        type: number
                    required:
                    - type
                    - value
                description: Present with include=properties
              topics:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    name:
                      type: string
                    description:
                      type:
                      - string
                      - 'null'
                    subscription:
                      type: string
                      enum:
                      - opt_in
                      - opt_out
                      description: 'Effective choice: the contact''s explicit one, else the topic''s default'
                    explicit:
                      type: boolean
                      description: True when the contact or the API chose this; false when it is the topic's default
                    visibility:
                      type: string
                      enum:
                      - public
                      - private
                      description: The hosted preference page lists public topics only
                  required:
                  - id
                  - name
                  - description
                  - subscription
                  - explicit
                  - visibility
                description: Present with include=topics
            required:
            - id
            - email
            - first_name
            - last_name
            - created_at
            - unsubscribed
        has_more:
          type: boolean
      required:
      - object
      - data
      - has_more
    GetSegmentResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - segment
        id:
          type: string
          format: uuid
        name:
          type: string
        filter:
          $ref: '#/components/schemas/SegmentFilter'
        created_at:
          type: string
        contact_count:
          type: number
      required:
      - object
      - id
      - name
      - filter
      - created_at
      - contact_count
    UpdateSegmentRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        filter:
          $ref: '#/components/schemas/SegmentFilter'
    ListSegmentsResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                enum:
                - segment
              id:
                type: string
                format: uuid
              name:
                type: string
              filter:
                $ref: '#/components/schemas/SegmentFilter'
              created_at:
                type: string
            required:
            - object
            - id
            - name
            - filter
            - created_at
        has_more:
          type: boolean
      required:
      - object
      - data
      - has_more
    SegmentResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - segment
        id:
          type: string
          format: uuid
        name:
          type: string
        filter:
          $ref: '#/components/schemas/SegmentFilter'
        created_at:
          type: string
      required:
      - object
      - id
      - name
      - filter
      - created_at
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'An API key from the dashboard (ms_…), sent as Authorization: Bearer. A sending-only key reaches the /emails routes only.'
x-refined-from:
- docs.json
- mepmail-dev-docs-openapi.json
x-provenance:
  method: harvested
  publisher: MepMail
  source: https://docs.mepmail.dev/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)