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

# upsert contact

> Creates or updates a contact, matched by its natural key. Returns the resulting record whether it was newly created or updated in place.



## OpenAPI

````yaml /api/v2/openapi.json put /contacts
openapi: 3.1.0
info:
  title: Klipy API
  version: '2'
  description: Klipy public CRM API, version 2.
servers:
  - url: https://api.klipy.ai/api/v2
security:
  - ApiKeyHeader: []
  - BearerAuth: []
paths:
  /contacts:
    put:
      tags:
        - contacts
      summary: upsert contact
      description: >-
        Creates or updates a contact, matched by its natural key. Returns the
        resulting record whether it was newly created or updated in place.
      operationId: upsert_contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                alt_emails:
                  type: array
                  items:
                    type: string
                company_id:
                  type: string
                email:
                  type: string
                first_name:
                  type: string
                keep_in_touch:
                  type: boolean
                last_name:
                  type: string
                owner_id:
                  type: string
                phone:
                  type: string
                remarks:
                  type: string
                title:
                  type: string
              required:
                - email
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    Success:
      description: Success.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessEnvelope'
    Unauthorized:
      description: Authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Insufficient scope or forbidden operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ValidationFailed:
      description: Request body validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    InternalError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        data:
          type: object
        meta:
          $ref: '#/components/schemas/Meta'
        object:
          type: string
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            details:
              type: array
              items:
                type: object
            message:
              type: string
        meta:
          $ref: '#/components/schemas/Meta'
        object:
          type: string
    Meta:
      type: object
      properties:
        api_version:
          type: string
        request_id:
          type: string
        timestamp:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Klipy-Api-Key
    BearerAuth:
      type: http
      scheme: bearer

````