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

# Create a contact

> Creates a new contact in the workspace.



## OpenAPI

````yaml /openapi.yaml post /contacts
openapi: 3.0.3
info:
  title: Leonar API
  description: >
    REST API for accessing and managing workspace data in Leonar CRM.


    ## Authentication


    All API requests require a Bearer token in the Authorization header:


    ```

    Authorization: Bearer leo_xxxxx

    ```


    API keys can be created and managed in Settings > API.


    ## Rate limiting


    - **2000 requests per hour by default**, configurable per workspace and
    shared by all API keys owned by the same user

    - Rate limit headers are included in all responses


    ## Pagination


    List endpoints support pagination via `limit` and `offset` query parameters.
  version: 1.0.0
  contact:
    name: Leonar Support
    url: https://leonar.ai
    email: support@leonar.ai
servers:
  - url: https://app.leonar.app/api/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Contacts
    description: Manage contacts in your workspace
  - name: Companies
    description: Manage companies and their relationships
  - name: Deals
    description: Track and manage sales deals
  - name: Deal Pipelines
    description: View deal pipeline configurations
  - name: Projects
    description: Organize recruiting projects
  - name: Pipeline Entries
    description: Manage candidates in project pipelines
  - name: Tasks
    description: Track to-dos and follow-ups
  - name: Tags
    description: Organize resources with tags
  - name: Notes
    description: Manage notes on contacts, companies, deals, and projects
  - name: Sequences
    description: Automate outreach campaigns
  - name: Conversations
    description: View conversations across channels
  - name: Messages
    description: Send messages via email, LinkedIn, or WhatsApp
  - name: Enrichment
    description: Find emails and phone numbers for contacts
  - name: Sourcing
    description: Search and import candidates
  - name: Connected Accounts
    description: View linked LinkedIn accounts
paths:
  /contacts:
    post:
      tags:
        - Contacts
      summary: Create a contact
      description: Creates a new contact in the workspace.
      operationId: create-contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactCreate'
      responses:
        '201':
          description: Contact created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    ContactCreate:
      type: object
      required:
        - first_name
      properties:
        first_name:
          type: string
          maxLength: 100
        last_name:
          type: string
          maxLength: 100
        email:
          type: string
          format: email
          description: Single email (convenience field). Use `emails` array for multiple.
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ContactEmail'
          maxItems: 5
        phone:
          type: string
          description: Single phone (convenience field). Use `phones` array for multiple.
        phones:
          type: array
          items:
            $ref: '#/components/schemas/ContactPhone'
          maxItems: 5
        title:
          type: string
        current_company:
          type: string
        location:
          type: string
        linkedin_profile:
          type: string
          format: uri
        resume:
          type: string
          format: uri
        contact_type:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
          description: >-
            Tag names to attach. Tags are created automatically if they don't
            exist.
        source:
          type: string
        company_id:
          type: string
          format: uuid
        custom_data:
          allOf:
            - $ref: '#/components/schemas/CustomFieldValueMap'
          description: |
            Custom field values indexed by custom field `key`.
            Values are validated against workspace custom field definitions.
        global_status:
          type: string
          enum:
            - new
            - contacted
            - replied
            - qualified
            - archived
        do_not_contact:
          type: boolean
        years_experience:
          type: integer
        skills:
          type: array
          items:
            type: string
        languages:
          type: array
          items:
            type: string
      example:
        first_name: Sophie
        last_name: Martin
        title: Senior Software Engineer
        current_company: Doctolib
        location: Paris, France
        emails:
          - email: sophie@doctolib.com
            type: work
        linkedin_profile: https://www.linkedin.com/in/sophie-martin
        skills:
          - React
          - TypeScript
        custom_data:
          industry_code: A12
          vip: true
        tags:
          - frontend
    Contact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        current_company:
          type: string
          nullable: true
        location:
          type: string
          nullable: true
        linkedin_profile:
          type: string
          format: uri
          nullable: true
        resume:
          type: string
          format: uri
          nullable: true
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ContactEmail'
          nullable: true
        phones:
          type: array
          items:
            $ref: '#/components/schemas/ContactPhone'
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Tag names associated with the contact
        global_status:
          type: string
          enum:
            - new
            - contacted
            - replied
            - qualified
            - archived
          nullable: true
        source:
          type: string
          nullable: true
        summary:
          type: string
          nullable: true
        skills:
          type: array
          items:
            type: string
          nullable: true
        languages:
          type: array
          items:
            type: string
          nullable: true
        years_experience:
          type: integer
          nullable: true
        custom_data:
          $ref: '#/components/schemas/CustomFieldValueMap'
        do_not_contact:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        last_contacted_at:
          type: string
          format: date-time
          nullable: true
        archived_at:
          type: string
          format: date-time
          nullable: true
      example:
        id: a1b2c3d4-5678-90ab-cdef-1234567890ab
        first_name: Sophie
        last_name: Martin
        title: Senior Software Engineer
        current_company: Doctolib
        location: Paris, France
        linkedin_profile: https://www.linkedin.com/in/sophie-martin
        emails:
          - email: sophie@doctolib.com
            type: work
        phones:
          - phone: '+33612345678'
            type: personal
        tags:
          - frontend
          - senior
        global_status: new
        source: linkedin
        summary: null
        skills:
          - React
          - TypeScript
          - Node.js
        languages:
          - French
          - English
        years_experience: 8
        custom_data:
          industry_code: A12
          vip: true
        do_not_contact: false
        created_at: '2025-01-15T10:30:00Z'
        updated_at: '2025-01-20T14:00:00Z'
        last_contacted_at: null
        archived_at: null
    ContactEmail:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
        type:
          type: string
          enum:
            - work
            - personal
          default: work
    ContactPhone:
      type: object
      required:
        - phone
      properties:
        phone:
          type: string
        type:
          type: string
          enum:
            - work
            - personal
          default: personal
    CustomFieldValueMap:
      type: object
      additionalProperties: true
      description: >
        Object keyed by custom field `key`.

        Use `GET /contacts/custom-fields` or `GET /companies/custom-fields` to
        discover available keys and types.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - insufficient_scope
                - rate_limit_exceeded
                - validation_error
                - not_found
                - internal_error
                - billing_required
                - plan_upgrade_required
              description: >
                Error codes:

                - `invalid_api_key` — API key is missing, malformed, or revoked

                - `insufficient_scope` — API key lacks the required scope for
                this endpoint

                - `rate_limit_exceeded` — Too many requests (2000/hour)

                - `validation_error` — Request body or parameters failed
                validation

                - `not_found` — The requested resource does not exist

                - `internal_error` — Unexpected server error

                - `billing_required` — Workspace has no active subscription

                - `plan_upgrade_required` — Current plan does not include this
                feature
            message:
              type: string
              description: Human-readable error description
  responses:
    ValidationError:
      description: Invalid request data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validation_error
              message: Invalid input
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_api_key
              message: Invalid API key
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limit_exceeded
              message: 'Rate limit exceeded. Limit: 2000 requests per hour.'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `leo_`

````