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

> ## Agent Instructions
> Every Lath operation is POST https://platform.trylath.com/<operation name with dots replaced by slashes>, with a JSON body and `Authorization: Bearer <key>`. `email.send` is POST /email/send.
> Branch on `error.code`, never on `error.message`. Every refusal also carries `error.fix`, which names the next step.
> Send an `Idempotency-Key` header on any operation that is not retry-safe, so a retry cannot run it twice.
> A `lath_test_` key emails only the account's own members and sends no SMS; a `lath_live_` key reaches real recipients and is billed.
> The OpenAPI document, generated from the same registry as the routes, is at https://platform.trylath.com/openapi.json.

# audience.contact.import

> Imports up to 1,000 contacts, merging by email or phone. A row grants marketing consent only if it carries a consentSource or the batch carries an attestation; rows with neither import without consent and are counted. Purchased or scraped lists are prohibited.



## OpenAPI

````yaml /api-reference/openapi.json post /audience/contact/import
openapi: 3.1.0
info:
  title: Lath API
  version: 0.1.0
  description: >-
    Every operation is one POST. The same set is reachable over MCP, the SDK and
    the CLI; nothing is dashboard-only.
servers:
  - url: https://platform.trylath.com
    description: This deployment
security: []
paths:
  /audience/contact/import:
    post:
      tags:
        - audience
      summary: audience.contact.import
      description: >-
        Imports up to 1,000 contacts, merging by email or phone. A row grants
        marketing consent only if it carries a consentSource or the batch
        carries an attestation; rows with neither import without consent and are
        counted. Purchased or scraped lists are prohibited.
      operationId: audience.contact.import
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Replays the stored response for the same key and input; refuses
            different input.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                rows:
                  minItems: 1
                  maxItems: 1000
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        format: email
                        pattern: >-
                          ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                      phone:
                        type: string
                        pattern: ^\+[1-9]\d{6,14}$
                      locale:
                        description: >-
                          This contact's language, e.g. 'fr' or 'pt-BR'. Decides
                          which template variant they receive.
                        type: string
                        maxLength: 20
                      properties:
                        type: object
                        propertyNames:
                          type: string
                          pattern: ^[a-zA-Z0-9_]{1,64}$
                        additionalProperties: {}
                      consentSource:
                        type: string
                        minLength: 1
                        maxLength: 200
                      consentWording:
                        type: string
                        maxLength: 1000
                    additionalProperties: false
                attestation:
                  type: string
                  minLength: 1
                  maxLength: 500
                topics:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
                channel:
                  default: email
                  type: string
                  enum:
                    - email
                    - sms
              required:
                - rows
              additionalProperties: false
      responses:
        '200':
          description: '{ activityId, result }. activityId is empty for reads.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  activityId:
                    type: string
                    description: The activity this call created, or empty for a read.
                  result:
                    $schema: https://json-schema.org/draft/2020-12/schema
                    type: object
                    properties:
                      created:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      updated:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      withoutConsent:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      skipped:
                        type: array
                        items:
                          type: object
                          properties:
                            row:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            reason:
                              type: string
                          required:
                            - row
                            - reason
                          additionalProperties: {}
                      total:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - created
                      - updated
                      - withoutConsent
                      - skipped
                      - total
                    additionalProperties: {}
                required:
                  - activityId
                  - result
        '400':
          description: invalid_input or invalid_json
        '401':
          description: unauthenticated
        '403':
          description: forbidden
        '404':
          description: not_found
        '409':
          description: 'conflict: idempotency_mismatch, email_taken, last_key'
        '413':
          description: body_too_large
        '429':
          description: rate_limited
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A Lath API key: lath_live_sk… or lath_test_sk… on a server,
        lath_live_pk… or lath_test_pk… in a browser.

````