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

# List or look up contacts

> This endpoint has two modes.

**Lookup by identifier** — pass `email` and/or `phone` to fetch a single contact by its normalized email address or phone number. `items` contains the matching contact (including `custom_fields`) or is empty; `pagination` is omitted. When both identifiers are supplied, an email match wins and the phone is only consulted if no contact has that email. Empty identifier values are ignored.

**Paginated listing** — without `email`/`phone`, returns a page of contacts sorted by `sort`/`order`, optionally narrowed by `search` and `updated_after` (contacts updated strictly after an ISO 8601 timestamp — useful for incremental syncs). Listing items do not include `custom_fields`; fetch a single contact with `GET /v1/contacts/{contactId}` for those. Unrecognized query parameters are rejected in listing mode.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/contacts
openapi: 3.1.0
info:
  title: Tented API
  version: 1.0.0
  description: >-
    The Tented public API: generate, publish, and manage AI-built web pages
    (tents), and run the email platform — contacts, reusable emails, one-time
    blasts, and triggered flows.


    ## Authentication

    Authenticate every request with a workspace API key: `Authorization: Bearer
    <api-key>`. Keys are created in **Workspace Settings → API Keys** and are
    scoped to a single workspace.


    ## Asynchronous work

    Tent generation, bulk creation, and email AI generation return `202
    Accepted` immediately. Poll the corresponding status endpoint (`GET
    /v1/tents/{tentId}`, `GET /v1/bulk-jobs/{bulkJobId}`, `GET
    /v1/emails/{emailId}/generations/{generationId}`) — no more than every 10
    seconds.


    ## Pagination

    Email listings use cursor pagination (`cursor`/`next_cursor`). Blast, flow,
    and member listings use page pagination (`page`/`limit` with a `pagination`
    object in the response).


    ## Conventions

    Request and response fields are snake_case, with two exceptions: analytics
    query parameters (`tentIdOrAlias`, `daysBack`) and segment rule trees
    (camelCase keys such as `listId` and `timeWindow`).
  contact:
    name: Tented Support
    email: support@tented.ai
servers:
  - url: https://api.tented.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Tents
    description: >-
      Create, edit, publish, and manage AI-generated pages, including asset
      uploads and bulk creation.
  - name: Analytics
    description: Traffic analytics for single tents and the whole workspace.
  - name: Contacts
    description: >-
      Batch create, update, and delete contacts. Up to 25 items per request with
      per-item results.
  - name: Emails
    description: >-
      Reusable email content: AI generation, direct HTML edits, plain-text
      control, and approval.
  - name: Email Blasts
    description: >-
      One-time sends to an audience: compose, schedule, track engagement, export
      recipients.
  - name: Triggered Flows
    description: >-
      Multi-step automations that enroll contacts on triggers and move them
      through a step graph.
  - name: Contact Imports
  - name: Contact Fields
  - name: Contact Lists
  - name: Email Templates
  - name: Tent Templates
    description: >-
      Reusable, AI-editable tent layouts. Create from HTML or an existing tent,
      iterate with AI, approve, and clone. Approved tent templates seed new
      tents.
paths:
  /v1/contacts:
    get:
      tags:
        - Contacts
      summary: List or look up contacts
      description: >-
        This endpoint has two modes.


        **Lookup by identifier** — pass `email` and/or `phone` to fetch a single
        contact by its normalized email address or phone number. `items`
        contains the matching contact (including `custom_fields`) or is empty;
        `pagination` is omitted. When both identifiers are supplied, an email
        match wins and the phone is only consulted if no contact has that email.
        Empty identifier values are ignored.


        **Paginated listing** — without `email`/`phone`, returns a page of
        contacts sorted by `sort`/`order`, optionally narrowed by `search` and
        `updated_after` (contacts updated strictly after an ISO 8601 timestamp —
        useful for incremental syncs). Listing items do not include
        `custom_fields`; fetch a single contact with `GET
        /v1/contacts/{contactId}` for those. Unrecognized query parameters are
        rejected in listing mode.
      operationId: list-contacts
      parameters:
        - name: email
          in: query
          required: false
          schema:
            type: string
          description: >-
            Lookup mode: return the contact whose normalized email matches.
            Supplying this (non-empty) switches the endpoint to lookup mode and
            listing parameters are ignored.
        - name: phone
          in: query
          required: false
          schema:
            type: string
          description: >-
            Lookup mode: return the contact whose normalized phone matches.
            Consulted after `email` when both are given. Supplying this
            (non-empty) switches the endpoint to lookup mode.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: 'Listing mode: page number, starting at 1.'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: 'Listing mode: results per page (1–100).'
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - created_at
              - updated_at
              - last_activity_at
              - display_name
              - first_name
              - last_name
              - normalized_email
              - original_source
            default: updated_at
          description: 'Listing mode: sort key.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          description: 'Listing mode: sort direction.'
        - name: search
          in: query
          required: false
          schema:
            type: string
            maxLength: 255
          description: >-
            Listing mode: case-insensitive substring match against display name,
            email, phone, company, first name, and last name.
        - name: updated_after
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: >-
            Listing mode: only return contacts updated strictly after this ISO
            8601 timestamp.
      responses:
        '200':
          description: >-
            Matching contacts. Lookup mode returns 0 or 1 items (with
            `custom_fields`) and no `pagination`; listing mode returns a page of
            contacts (without `custom_fields`) plus `pagination`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContactWithCustomFields'
                    description: >-
                      Contacts. In lookup mode, at most one item, including
                      `custom_fields`. In listing mode, the current page,
                      without `custom_fields`.
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    description: Present in listing mode only.
                required:
                  - items
        '400':
          description: >-
            Bad request — an `email`/`phone` identifier that cannot be
            normalized, or invalid listing parameters. Validation failures
            include `details.issues` with per-field messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized — missing, malformed, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ContactWithCustomFields:
      allOf:
        - $ref: '#/components/schemas/Contact'
        - type: object
          properties:
            custom_fields:
              type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
              description: >-
                Custom field values keyed by field API name. Values are returned
                as stored strings (or `null`) regardless of the field's declared
                value type.
      description: A contact record including its custom field values.
    Pagination:
      type: object
      properties:
        page:
          type: integer
          description: Current page (1-based).
        limit:
          type: integer
          description: Page size.
        total:
          type: integer
          description: Total matching records.
        totalPages:
          type: integer
          description: Total number of pages.
      description: Offset pagination metadata.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        error_code:
          type: string
          description: >-
            Stable machine-readable error code (present on email, blast, flow,
            and related endpoints, e.g. `campaign_not_ready`,
            `generation_in_progress`).
        message:
          type: string
          description: Additional human-readable context (present on some tent endpoints).
        code:
          type: string
          description: >-
            Machine-readable code used by tent creation errors (e.g.
            `INVALID_PROMPT_INTENT`).
        details:
          type: object
          additionalProperties: true
          description: >-
            Additional error context. Validation errors include `issues`: an
            array of `{ path, message }` objects.
        limit:
          type: integer
          description: Plan limit that was hit (present on `429` publish-limit errors).
        current:
          type: integer
          description: >-
            Current usage against the limit (present on `429` publish-limit
            errors).
      required:
        - error
      description: >-
        Error response. All errors include `error`; the other fields vary by
        endpoint group.
    Contact:
      type: object
      properties:
        contact_id:
          type: string
          format: uuid
          description: Contact ID.
        display_name:
          type:
            - string
            - 'null'
          description: Display name.
        first_name:
          type:
            - string
            - 'null'
          description: First name.
        last_name:
          type:
            - string
            - 'null'
          description: Last name.
        email:
          type:
            - string
            - 'null'
          description: Email address.
        phone:
          type:
            - string
            - 'null'
          description: Phone number.
        email_domain:
          type:
            - string
            - 'null'
          description: Domain derived from the email address.
        company:
          type:
            - string
            - 'null'
          description: Company.
        job_title:
          type:
            - string
            - 'null'
          description: Job title.
        address:
          type:
            - string
            - 'null'
          description: Street address.
        address2:
          type:
            - string
            - 'null'
          description: Address line 2.
        city:
          type:
            - string
            - 'null'
          description: City.
        state:
          type:
            - string
            - 'null'
          description: State or region.
        country:
          type:
            - string
            - 'null'
          description: Country.
        zip_code:
          type:
            - string
            - 'null'
          description: Postal code.
        original_source:
          type:
            - string
            - 'null'
          description: How the contact was first created, e.g. `Public API`.
        original_source_detail:
          type:
            - string
            - 'null'
          description: Additional source detail.
        lead_status:
          type:
            - string
            - 'null'
          description: Lead status.
        lifecycle_stage:
          type:
            - string
            - 'null'
          description: Lifecycle stage.
        tented_score:
          type:
            - number
            - 'null'
          description: Contact score.
        unsubscribed:
          type: boolean
          description: Global unsubscribe flag.
        marketing_email_subscribed:
          type:
            - boolean
            - 'null'
          description: Email marketing subscription state.
        marketing_sms_subscribed:
          type:
            - boolean
            - 'null'
          description: SMS marketing subscription state.
        marketing_email_invalid:
          type: boolean
          description: Whether the email address is known to be invalid.
        marketing_sms_invalid:
          type: boolean
          description: Whether the phone number is known to be invalid.
        last_activity_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Most recent tracked activity.
        created_at:
          type: string
          format: date-time
          description: Creation time.
        updated_at:
          type: string
          format: date-time
          description: Last update.
      description: A contact record. Fields that were never set are omitted.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, e.g. `Authorization: Bearer tented_...`. Create keys
        in Workspace Settings → API Keys.

````