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

# Create or upsert a person

> Creates a person or upserts onto an existing one (matched by phone, then email, then `externalId`). When `tagIds` are supplied, only newly attached tags emit `contact.tag_added` events — retries are idempotent.



## OpenAPI

````yaml /openapi.json post /v1/people
openapi: 3.0.0
info:
  title: Notealy Public API
  description: >-
    REST API for managing contacts, companies, transactional email and email
    campaigns. Authenticate with a Bearer API token issued from your dashboard
    (Settings → API Tokens).
  version: '1.0'
  contact: {}
servers:
  - url: https://thanos.notealy.com
    description: Production
security: []
tags:
  - name: Me
    description: >-
      Verify the authenticated identity. Call this first to confirm a token is
      alive and discover its scopes.
  - name: People
    description: >-
      Create, read, update and delete people (contacts). Includes tag
      attachment.
  - name: Companies
    description: Create, read, update and delete company records.
  - name: Tags
    description: >-
      List and create tags. Use the ids returned here as `tagIds` in `POST
      /v1/people` to drive automations.
  - name: Email
    description: >-
      Send transactional emails through saved templates, either to a known
      contact or to an arbitrary address.
  - name: Email templates
    description: Discover the email template ids you reference from `Email` endpoints.
  - name: Email campaigns
    description: >-
      List and trigger email campaigns. Requires the email-campaigns plan
      feature.
  - name: Messages
    description: >-
      Send outbound messages across WhatsApp, Instagram and Facebook to a CRM
      contact.
paths:
  /v1/people:
    post:
      tags:
        - People
      summary: Create or upsert a person
      description: >-
        Creates a person or upserts onto an existing one (matched by phone, then
        email, then `externalId`). When `tagIds` are supplied, only newly
        attached tags emit `contact.tag_added` events — retries are idempotent.
      operationId: people.create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonDto'
      responses:
        '200':
          description: The created or updated person
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '401':
          description: Missing, invalid, revoked or expired bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '403':
          description: Token lacks the required scope for this endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '429':
          description: Rate limit exceeded (100 requests per minute per token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
      security:
        - bearer: []
components:
  schemas:
    CreatePersonDto:
      type: object
      properties:
        name:
          type: string
          description: Display name (required). Used for attribution and UX.
          minLength: 1
          maxLength: 500
        channel:
          type: string
          enum:
            - WHATSAPP
            - EMAIL
            - INSTAGRAM
            - FACEBOOK
            - TIKTOK
            - TELEGRAM
            - PHONE
            - WEB
            - OTHER
          description: >-
            Contact channel; defaults to WEB (typical web lead). When WHATSAPP,
            phone is required.
        phone:
          type: string
          description: 10–15 digits, optional +
        email:
          type: string
          description: >-
            Required when channel is not WHATSAPP if phone is empty (validated
            in service)
        firstName:
          type: string
        lastName:
          type: string
        jobTitle:
          type: string
        companyId:
          type: string
        companyName:
          type: string
        city:
          type: string
        description:
          type: string
        externalId:
          type: string
        customFields:
          type: object
          additionalProperties: true
        tagIds:
          description: >-
            Tag IDs to attach. Tags must already exist in the org. Only newly
            attached tags emit `tag_added` (idempotent on retry).
          type: array
          items:
            type: string
      required:
        - name
    HttpErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Validation failed
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````