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

# Create contact

> Creates a contact for the API key company. The contact must contain at least one identity. Required API key scope: `read-write`.



## OpenAPI

````yaml /openapi/public-api-v1.json post /v1/contacts
openapi: 3.1.0
info:
  title: YoLead Public API
  version: 1.0.0
  description: >-
    Public REST API for YoLead integrations. Only endpoints mounted under /v1
    are included. Management endpoints used by the YoLead UI, including
    /integrations/*, are intentionally excluded.
servers:
  - url: https://api.yo-lead.com
    description: Production
security:
  - YoLeadPublicKey: []
    YoLeadTimestamp: []
    YoLeadSignature: []
tags:
  - name: Employees
    description: Employee data available to integrations.
  - name: Embed
    description: Iframe session creation for embedding YoLead UI.
  - name: Tickets
    description: Ticket history, status, and assignee operations.
  - name: Contacts
    description: Contacts available to the API key company.
  - name: Lists
    description: Contact lists available to the API key company.
paths:
  /v1/contacts:
    post:
      tags:
        - Contacts
      summary: Create contact
      description: >-
        Creates a contact for the API key company. The contact must contain at
        least one identity. Required API key scope: `read-write`.
      operationId: createContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContactRequest'
            example:
              firstName: Alex
              lastName: Smith
              identities:
                email:
                  - alex@example.com
                phone:
                  - '15551234567'
      responses:
        '201':
          description: Contact created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateContactRequest:
      type: object
      additionalProperties: false
      required:
        - firstName
        - identities
      properties:
        firstName:
          type: string
          minLength: 1
          maxLength: 100
        lastName:
          type: string
          minLength: 1
          maxLength: 100
        identities:
          $ref: '#/components/schemas/ContactIdentities'
    ContactResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Contact'
    ContactIdentities:
      type: object
      additionalProperties: false
      description: >-
        At least one identity type is required when creating a contact. Each
        provided identity type contains 1 to 20 trimmed values of at most 512
        characters.
      properties:
        phone:
          $ref: '#/components/schemas/IdentityValues'
        whatsapp_phone:
          $ref: '#/components/schemas/IdentityValues'
        whatsapp_user_id:
          $ref: '#/components/schemas/IdentityValues'
        whatsapp_parent_user_id:
          $ref: '#/components/schemas/IdentityValues'
        email:
          $ref: '#/components/schemas/IdentityValues'
        telegram_user_id:
          $ref: '#/components/schemas/IdentityValues'
        telegram_username:
          $ref: '#/components/schemas/IdentityValues'
        telegram_phone:
          $ref: '#/components/schemas/IdentityValues'
        max_user_id:
          $ref: '#/components/schemas/IdentityValues'
        max_username:
          $ref: '#/components/schemas/IdentityValues'
        max_phone:
          $ref: '#/components/schemas/IdentityValues'
        vk_user_id:
          $ref: '#/components/schemas/IdentityValues'
        facebook_user_id:
          $ref: '#/components/schemas/IdentityValues'
        instagram_user_id:
          $ref: '#/components/schemas/IdentityValues'
        instagram_username:
          $ref: '#/components/schemas/IdentityValues'
    Contact:
      type: object
      additionalProperties: false
      required:
        - id
        - firstName
        - identities
      properties:
        id:
          $ref: '#/components/schemas/ObjectId'
        firstName:
          type: string
          minLength: 1
          maxLength: 100
          example: Alex
        lastName:
          type: string
          minLength: 1
          maxLength: 100
          example: Smith
        identities:
          $ref: '#/components/schemas/ContactIdentities'
        createdAt:
          $ref: '#/components/schemas/IsoDateTime'
        updatedAt:
          $ref: '#/components/schemas/IsoDateTime'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 40001
        message:
          type: string
          example: Validation error
    IdentityValues:
      type: array
      minItems: 1
      maxItems: 20
      items:
        type: string
        minLength: 1
        maxLength: 512
    ObjectId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: MongoDB ObjectId represented as a 24-character hexadecimal string.
      example: 64f000000000000000000001
    IsoDateTime:
      type: string
      format: date-time
      description: ISO 8601 date-time string.
      example: '2026-05-08T12:00:00.000Z'
  responses:
    ValidationError:
      description: Validation or business-rule error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40001
            message: Validation error
    Unauthorized:
      description: Invalid API credentials, stale timestamp, or invalid request signature.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40121
            message: Invalid API credentials
    Forbidden:
      description: >-
        API key scope is not sufficient for this operation, or the required
        feature is unavailable on the company's current plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientScope:
              value:
                code: 40361
                message: API key scope is not sufficient
            apiAccessUnavailable:
              value:
                code: 40351
                message: API access is unavailable on your current plan
    Conflict:
      description: The request conflicts with the current entity state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40992
            message: Contact is already in this list
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 50001
            message: Internal server error
  securitySchemes:
    YoLeadPublicKey:
      type: apiKey
      in: header
      name: X-YoLead-Key
      description: Public API key generated in the YoLead UI.
    YoLeadTimestamp:
      type: apiKey
      in: header
      name: X-YoLead-Timestamp
      description: >-
        Unix timestamp in milliseconds. Requests must be signed within a
        5-minute window.
    YoLeadSignature:
      type: apiKey
      in: header
      name: X-YoLead-Signature
      description: >-
        Hex HMAC-SHA256 signature over `<timestamp>.<raw_body>` using the API
        secret.

````