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

# Add static segment members

> Add contacts to a static segment by email

Adds one or more existing workspace contacts to a **static** segment.

## Path parameters

* `id` (string, required): Segment ID

## Request body

```json theme={null}
{
  "emails": ["alice@example.com", "bob@example.com"]
}
```

* `emails` must be a non-empty array of valid email addresses.
* Maximum length is 500 emails per request.

## Response

```json theme={null}
{
  "added": 2,
  "notFound": []
}
```

* `added`: Number of emails that matched contacts in the workspace.
* `notFound`: Input emails that were not found in the workspace.

## Notes

* This endpoint only works for `STATIC` segments.
* Calling it for a `DYNAMIC` segment returns `400`.


## OpenAPI

````yaml openapi.json POST /segments/{id}/members
openapi: 3.0.3
info:
  title: MailGlyph API
  description: >-
    Email platform API for transactional emails, campaigns, and marketing
    automation
  version: 1.0.0
  contact:
    name: MailGlyph Support
    url: https://mailglyph.com
servers:
  - url: https://api.mailglyph.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Public API
    description: Public API endpoints for sending emails and tracking events
  - name: Events
    description: Event ingestion and querying
  - name: Contacts
    description: Contact management operations
  - name: Templates
    description: Email template management
  - name: Campaigns
    description: Email campaign management
  - name: Segments
    description: Audience segmentation
  - name: Workflows
    description: Workflow automation
paths:
  /segments/{id}/members:
    post:
      tags:
        - Segments
      summary: Add static segment members
      description: Add contacts to a static segment by email
      operationId: addStaticSegmentMembers
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - emails
              properties:
                emails:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    type: string
                    format: email
            example:
              emails:
                - alice@example.com
                - bob@example.com
      responses:
        '200':
          description: Contacts added to static segment
          content:
            application/json:
              schema:
                type: object
                properties:
                  added:
                    type: integer
                  notFound:
                    type: array
                    items:
                      type: string
                      format: email
        '400':
          description: Bad request
        '404':
          description: Segment not found
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication. **Secret keys (sk_*)** are required for all
        endpoints except `/v1/track`. **Public keys (pk_*)** only work with the
        `/v1/track` endpoint for client-side event tracking. Workspaces can have
        multiple active keys, and sender-domain operations enforce per-key
        domain scope when configured.

````

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