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

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# Add a contact

> Authentication required. Agency administrators and staff; a project user cannot add contacts by API.

Adds one lead to a sub-account that keeps its contacts on the platform, which is a sub-account with no CRM connected. The body is the lead: `phone` is required; `first_name`, `last_name` (or `name`), `email`, `timezone`, `address1`, `city`, `state` and `postalCode` are optional, and so is any of the sub-account's custom fields, by its key or its name.

A number already in the sub-account updates that contact instead of adding it twice, and a blank never erases a value. A new contact starts any campaign whose trigger is "New contact". The response is 201 for a new contact and 200 for an update.

A sub-account with a CRM keeps its contacts there and answers 400. This is the same import as the sub-account's lead link, which exists for forms, Zapier and Make steps that cannot set a header; when your sender can set one, use this endpoint and your API key.

Cookie-auth callers must send the `x-csrf-token` header.

Required API key scope: `contacts:write`.



## OpenAPI

````yaml /openapi.yaml post /api/contacts/add/{locationId}
openapi: 3.1.0
info:
  title: TFUAI Server API
  version: 1.0.0
  description: >-
    API reference for the TFUAI SaaS server.


    All published endpoints are mounted under `/api`. Responses use a standard
    envelope: `{ "success": true, ... }` on success and `{ "success": false,
    "error": "..." }` on failure.


    Product API modules are being launched module by module. This spec currently
    exposes only contracted public modules.


    Authenticate public API requests with an API key in the `Authorization`
    header: `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.teamfollowup.ai
    description: Production API origin. Public API paths are under /api.
security: []
tags:
  - name: Agents
    description: Manage voice agents, campaigns, workflows, and outcomes.
  - name: Analytics
    description: >-
      Minimal, non-billing performance summary: volume, conversion, and pickup
      metrics.
  - name: Billing
    description: >-
      Billing for your own agency: balance, spend, transaction history, invoices
      and sub-account wallets; auto-recharge, rebilling, Credit Guard and Stripe
      customers; and, with the billing:charge scope, purchases and charges.
  - name: Calls
    description: Review calls, test runs, and execution history.
  - name: Campaign Workflows
    description: >-
      What runs after a call lands: for each outcome (booked, opted out, asked
      for a callback…), an ordered chain of actions — tag the contact, move a
      pipeline stage, send an SMS, book an appointment. Stored as a graph:
      `nodes` are the actions, `edges` say what follows what, and
      `dispositionEntries` maps each outcome to the node its chain starts at.


      **Pick the narrowest endpoint that does the job.**


      | To | Call | |

      | --- | --- | --- |

      | See what fires per outcome | `GET .../workflow/digest` | Reads as plain
      text, no graph walking |

      | Add steps to an outcome | `POST .../outcomes/{outcome}/nodes` | Server
      derives node ids, edge ids, handles, layout |

      | Change a message, tag or setting | `PATCH .../workflow` | Merges;
      carries no graph, so it cannot damage one |

      | Remove one step | `DELETE .../nodes/{nodeId}` | Also re-links the chain
      around it |

      | Author or replace the whole graph | `PUT .../workflow` | Replaces
      everything you send |


      `PUT` is the only one that can re-wire, position nodes, build an `if`,
      save an unconfigured draft, or copy a whole workflow — and the only one
      that can overwrite a change someone else made after you read it. Use it
      when you are genuinely authoring the graph, and send `expectedVersion`
      when you do. For everything else the narrower endpoints are both easier
      and safer.
  - name: Contacts
    description: Contact list, filters, contact call history, and do-not-call actions.
  - name: GHL
    description: CRM variables and contact helpers used by agent and campaign setup flows.
  - name: Phone Numbers
    description: >-
      Caller ID pool, number search, assignment, movement, and release
      endpoints.
  - name: Power Dialer
    description: >-
      Power Dialer queue, lead cadence, callback, parked lead, and campaign
      schedule endpoints.
  - name: Projects
    description: >-
      Project management endpoints: list, update, disconnect, configure project
      campaigns, and validate setup.
  - name: Skills and Tools
    description: Manage reusable agent behaviors and in-call tool descriptions.
  - name: Split Testing
    description: >-
      Split live campaign traffic across agent variants and shift the weights
      between them.
  - name: Voices
    description: Voice catalogue endpoints for choosing the voice used by an agent.
paths:
  /api/contacts/add/{locationId}:
    post:
      tags:
        - Contacts
      summary: Add a contact
      description: >-
        Authentication required. Agency administrators and staff; a project user
        cannot add contacts by API.


        Adds one lead to a sub-account that keeps its contacts on the platform,
        which is a sub-account with no CRM connected. The body is the lead:
        `phone` is required; `first_name`, `last_name` (or `name`), `email`,
        `timezone`, `address1`, `city`, `state` and `postalCode` are optional,
        and so is any of the sub-account's custom fields, by its key or its
        name.


        A number already in the sub-account updates that contact instead of
        adding it twice, and a blank never erases a value. A new contact starts
        any campaign whose trigger is "New contact". The response is 201 for a
        new contact and 200 for an update.


        A sub-account with a CRM keeps its contacts there and answers 400. This
        is the same import as the sub-account's lead link, which exists for
        forms, Zapier and Make steps that cannot set a header; when your sender
        can set one, use this endpoint and your API key.


        Cookie-auth callers must send the `x-csrf-token` header.


        Required API key scope: `contacts:write`.
      operationId: add-contact
      parameters:
        - name: locationId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: The sub-account's stable location id.
          example: nat_fd9e2a8dd4be4396b604
      requestBody:
        required: true
        description: The lead.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactsAddRequest'
            examples:
              default:
                value:
                  phone: '+13125550142'
                  first_name: Ana
                  last_name: Diaz
                  email: ana@example.com
                  timezone: America/Chicago
                  city: Chicago
                  state: IL
                  lead_source: Website form
      responses:
        '200':
          description: A contact with that number already existed and was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsAddResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      created: false
                      updated: true
                      contactId: nct_0123456789abcdef0123
                      ignoredFields:
                        - utm_source
        '201':
          description: Contact added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsAddResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      created: true
                      updated: false
                      contactId: nct_0123456789abcdef0123
        '400':
          description: Validation failed or the request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Location ID is required
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Unauthorized
        '403':
          description: Authenticated but not permitted to access the requested project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Access denied to this project
        '404':
          description: Project or contact action target not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Project not found or not configured for CRM integration
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: TooManyRequests
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Unexpected server error.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.teamfollowup.ai/api/contacts/add/{locationId} \
              --header 'Authorization: Bearer YOUR_API_KEY' \
              --header 'Content-Type: application/json' \
              --data '{
              "phone": "+13125550142",
              "first_name": "Ana",
              "last_name": "Diaz",
              "email": "ana@example.com",
              "timezone": "America/Chicago",
              "city": "Chicago",
              "state": "IL",
              "lead_source": "Website form"
            }'
components:
  schemas:
    ContactsAddRequest:
      type: object
      additionalProperties:
        type:
          - string
          - number
          - boolean
        description: >-
          Any of the sub-account's custom fields, by its key or its name. A
          field the sub-account does not have is ignored and named in
          `ignoredFields`.
      required:
        - phone
      description: >-
        One lead. `phone` is required; everything else is optional. Fields
        nested one level under `contact`, `data` or `lead` are read as well, for
        senders that wrap the lead. Arrays and deeper objects are ignored.
      properties:
        phone:
          type: string
          description: >-
            The lead's number. E.164 preferred; a North American number without
            a country code is completed. `phone_number` and `mobile` are read as
            this field.
          example: '+13125550142'
        first_name:
          type: string
          example: Ana
        last_name:
          type: string
          example: Diaz
        name:
          type: string
          description: A full name, split into first and last when the two are not sent.
          example: Ana Diaz
        email:
          type: string
          example: ana@example.com
        timezone:
          type: string
          description: IANA zone. Decides when the lead may be called.
          example: America/Chicago
        address1:
          type: string
          example: 1 Main St
        city:
          type: string
          example: Chicago
        state:
          type: string
          example: IL
        postalCode:
          type: string
          example: '60601'
    ContactsAddResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - data
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/ContactsAddData'
    ContactsErrorResponse:
      type: object
      additionalProperties: {}
      required:
        - success
        - error
      properties:
        success:
          type: boolean
        error:
          type: string
          example: Access denied to this project
        code:
          type: string
          example: FORBIDDEN
        message:
          type: string
          example: Access denied to this project
    ContactsAddData:
      type: object
      additionalProperties: false
      required:
        - created
        - updated
        - contactId
      properties:
        created:
          type: boolean
          description: A new contact was made.
          example: true
        updated:
          type: boolean
          description: >-
            A contact with that number already existed and was updated. A blank
            never erases a value.
          example: false
        contactId:
          type:
            - string
            - 'null'
          description: The contact's id on the platform.
          example: nct_0123456789abcdef0123
        ignoredFields:
          type: array
          items:
            type: string
          description: >-
            Fields in the request the sub-account has no column for. Present
            only when there were some.
          example:
            - utm_source
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key as `Authorization: Bearer YOUR_API_KEY`.'

````