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

# Re-check a registered sheet

> See what a registered source's sheet would produce for a campaign right now. It re-reads the sheet live with the stored `ref` and `mapping`, and persists nothing — worth a run before you launch against a source you registered days ago. To try a different mapping, use [`/contact-sources/preview`](/api-reference/contacts/dry-run-a-contact-import).



## OpenAPI

````yaml /voice-agents/api-reference/openapi.yaml post /contact-sources/{sourceId}/preview
openapi: 3.1.0
info:
  title: UpliftAI Voice Agents API
  version: '1.0'
  description: >-
    Build voice assistants, start conversations on the web or the phone, run
    calling campaigns, and receive outcomes by webhook. All endpoints take a
    bearer API key unless noted otherwise.
servers:
  - url: https://api.upliftai.org/v1
security:
  - apiKey: []
tags:
  - name: Assistants
  - name: Authoring an assistant
  - name: Starting a conversation
  - name: Sessions & call records
  - name: Campaigns
  - name: Campaign outcomes
  - name: Contacts
  - name: Google Sheet sources
  - name: Integrations & delivery health
paths:
  /contact-sources/{sourceId}/preview:
    post:
      tags:
        - Google Sheet sources
      summary: Re-check a registered sheet
      description: >-
        See what a registered source's sheet would produce for a campaign right
        now. It re-reads the sheet live with the stored `ref` and `mapping`, and
        persists nothing — worth a run before you launch against a source you
        registered days ago. To try a different mapping, use
        [`/contact-sources/preview`](/api-reference/contacts/dry-run-a-contact-import).
      operationId: previewRegisteredContactSource
      parameters:
        - name: sourceId
          in: path
          required: true
          description: The `sourceId` returned when the source was registered.
          schema:
            type: string
            format: uuid
          example: 8420468d-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      responses:
        '200':
          description: The sheet as it reads right now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactSourcePreview'
              example:
                summary:
                  willBeCalled: 2
                  excluded:
                    invalidPhone: 1
                    missingName: 0
                    duplicate: 1
                    dnc: 0
                    recentlyCalled: 0
                  errors:
                    - row: 4
                      issue: invalidPhone
                      value: 0300-999
                    - row: 5
                      issue: duplicate
                      value: '03001234567'
                detectedMapping:
                  nameColumn: Full Name
                  phoneColumn: Mobile
                  attributeColumns:
                    - City
                    - Property Type
                sample:
                  - name: عائشہ صدیقی
                    phone: '03001234567'
                    attributes:
                      City: لاہور
                      Property Type: 5 مرلہ گھر
                  - name: بلال احمد
                    phone: '+923215557788'
                    attributes:
                      City: کراچی
                      Property Type: اپارٹمنٹ
                total: 4
                columns:
                  - Full Name
                  - Mobile
                  - City
                  - Property Type
                mappingIssues: []
        '400':
          description: The source's connection cannot be used to read the sheet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: >-
                  Connection 6b1f90c4-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not a
                  Google Sheets connection
                error: Bad Request
                statusCode: 400
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            No such source in the API key's project — or the source's Google
            connection no longer exists (`Connection not found: …`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'Contact source not found: 00000000-0000-4000-8000-000000000000'
                error: Not Found
                statusCode: 404
        '500':
          description: >-
            The sheet could not be read — deleted, unshared, a `ref` range that
            no longer exists, or a revoked Google connection. The body does not
            say which.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 500
                message: Internal server error
components:
  schemas:
    ContactSourcePreview:
      type: object
      properties:
        summary:
          $ref: '#/components/schemas/ImportSummary'
        detectedMapping:
          $ref: '#/components/schemas/ContactColumnMapping'
          description: >-
            The columns actually used, after applying `mapping`. When a name was
            joined from two columns, `nameColumn` reads `First Name + Last
            Name`.
        sample:
          type: array
          maxItems: 10
          description: The first ten contacts that would be dialed.
          items:
            $ref: '#/components/schemas/NormalizedContact'
        total:
          type: integer
          description: Rows read, before validation.
        columns:
          type: array
          items:
            type: string
          description: >-
            The header row as parsed — what a `mapping` override chooses from.
            Absent for free-form paste, which has no headers.
        mappingIssues:
          type: array
          items:
            type: string
            enum:
              - phoneColumnNotFound
              - nameColumnNotFound
          description: >-
            Non-empty means column detection failed. An unmapped phone column
            then shows up as every row `invalidPhone` with an empty value.
    Error:
      type: object
      properties:
        message:
          description: >-
            One message per failed field for validation errors, a single string
            otherwise.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
        statusCode:
          type: integer
    ImportSummary:
      type: object
      description: What the import kept and dropped.
      properties:
        willBeCalled:
          type: integer
          description: Rows that became contacts.
        excluded:
          type: object
          description: >-
            Dropped rows by reason. `dnc` and `recentlyCalled` are always `0` —
            those checks do not run yet.
          properties:
            invalidPhone:
              type: integer
            missingName:
              type: integer
            duplicate:
              type: integer
              description: >-
                Same number seen twice. Numbers are compared as E.164, so
                `03001234567` and `+923001234567` collapse to one contact,
                keeping the first spelling.
            dnc:
              type: integer
            recentlyCalled:
              type: integer
        errors:
          type: array
          description: The dropped rows, first 20 only.
          items:
            type: object
            properties:
              row:
                type: integer
                description: Line in the source file, counting the header as line 1.
              issue:
                type: string
                enum:
                  - invalidPhone
                  - missingName
                  - duplicate
                  - dnc
                  - recentlyCalled
              value:
                type: string
                description: >-
                  The row's phone number: raw source text for `invalidPhone` and
                  `missingName`, normalized for `duplicate`.
    ContactColumnMapping:
      type: object
      description: >-
        Column overrides. Whatever you leave out is auto-detected from the
        headers.
      properties:
        nameColumn:
          type: string
          description: >-
            Header name (case-insensitive) or A1 column letter. An explicit
            value never falls back to auto-detection — if it matches no column,
            names read as empty and the preview reports it in `mappingIssues`.
          example: Name
        phoneColumn:
          type: string
          description: Header name or A1 column letter, resolved like `nameColumn`.
          example: B
        attributeColumns:
          type: array
          items:
            type: string
          description: >-
            Columns to carry as per-contact attributes, usable as
            personalization variables. Exact header names only — no A1 letters.
            Omit to keep every column that is not the name or phone column; send
            `[]` to keep none.
          example:
            - City
            - Appointment
    NormalizedContact:
      type: object
      properties:
        name:
          type: string
        phone:
          type: string
          description: >-
            Kept in the format the sheet used, PK national (`03…`) or E.164
            (`+92…`), with spaces and dashes stripped.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: >-
            The remaining columns, handed to the assistant as a contact record
            at dial time. Truncated at 1500 bytes per contact.
  responses:
    Unauthorized:
      description: A bearer key was sent but is not recognized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: invalid authorization
            error: Unauthorized
            statusCode: 401
    Forbidden:
      description: No API key sent, or the key lacks permission for this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Forbidden resource
            error: Forbidden
            statusCode: 403
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Project API key (`sk_api_…`).

````