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

# Segments - Manage contacts

> Add contacts to a segment, or remove them from it. Contacts are matched by phone number (or SHA-256 hash of the phone number) against contacts that already exist in Simio; unknown numbers are counted as not found. Up to 1000 contacts per request. Rate limit: 1 request per minute.



## OpenAPI

````yaml post /api/segments/{segment_id}/contacts
openapi: 3.1.0
info:
  title: Simio API - segments
  version: 2.0.0
servers:
  - url: https://getsimio.app
security: []
paths:
  /api/segments/{segment_id}/contacts:
    post:
      tags:
        - segments-api
      summary: Segments - Manage contacts
      description: >-
        Add contacts to a segment, or remove them from it. Contacts are matched
        by phone number (or SHA-256 hash of the phone number) against contacts
        that already exist in Simio; unknown numbers are counted as not found.
        Up to 1000 contacts per request. Rate limit: 1 request per minute.
      operationId: manage_segment_contacts_api_segments__segment_id__contacts_post
      parameters:
        - description: ID of the segment, as returned by Create.
          in: path
          name: segment_id
          required: true
          schema:
            description: ID of the segment, as returned by Create.
            examples:
              - 42
            title: Segment Id
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentContactsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentContactsResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid `simio-api-key`.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Your company has no active subscription.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Segment not found.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
          description: Rate limit exceeded.
      security:
        - SimioApiKey: []
components:
  schemas:
    SegmentContactsRequest:
      properties:
        contacts:
          description: >-
            Phone numbers to add or remove (up to 1000 per request). When
            use_hashed_phone is true, these must be SHA-256 hex digests of the
            phone numbers instead of raw phone numbers.
          examples:
            - - '33612345678'
          items:
            maxLength: 64
            type: string
          title: Contacts
          type: array
        mode:
          description: Whether to add or delete the given contacts from the segment.
          enum:
            - add
            - delete
          examples:
            - add
          title: Mode
          type: string
        use_hashed_phone:
          default: false
          description: >-
            If true, contacts contains SHA-256 hex digests of phone numbers
            rather than raw phone numbers.
          examples:
            - false
          title: Use Hashed Phone
          type: boolean
      required:
        - contacts
        - mode
      title: SegmentContactsRequest
      type: object
    SegmentContactsResponse:
      properties:
        contacts_found:
          description: Number of those contacts that exist in Simio.
          examples:
            - 2
          title: Contacts Found
          type: integer
        contacts_not_found:
          description: Number of those contacts that don't exist in Simio.
          examples:
            - 1
          title: Contacts Not Found
          type: integer
        contacts_processed:
          description: Number of contacts added to or removed from the segment.
          examples:
            - 2
          title: Contacts Processed
          type: integer
        contacts_provided:
          description: Number of distinct contacts in the request.
          examples:
            - 3
          title: Contacts Provided
          type: integer
        mode:
          description: Operation that was applied.
          enum:
            - add
            - delete
          examples:
            - add
          title: Mode
          type: string
        segment_id:
          description: ID of the segment.
          examples:
            - 42
          title: Segment Id
          type: integer
      required:
        - segment_id
        - mode
        - contacts_provided
        - contacts_found
        - contacts_not_found
        - contacts_processed
      title: SegmentContactsResponse
      type: object
    ErrorResponse:
      properties:
        detail:
          description: Human-readable error message.
          examples:
            - Invalid API key
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    RateLimitResponse:
      properties:
        error:
          description: Rate limit that was exceeded.
          examples:
            - 'Rate limit exceeded: 10 per 1 second'
          title: Error
          type: string
      required:
        - error
      title: RateLimitResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    SimioApiKey:
      description: >-
        Company API key, created in Settings > Integrations & developers >
        Credentials.
      in: header
      name: simio-api-key
      type: apiKey

````

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