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

# Criar cliente

> Informe pelo menos um de `email` ou `phone` — não é preciso os dois. Útil pra importar bases onde nem todo contato tem e-mail cadastrado.




## OpenAPI

````yaml /api-reference/openapi.yaml post /clients
openapi: 3.0.3
info:
  title: Nupapia API — Integração
  version: '1.0'
  description: >
    Referência da API pública da Nupapia para integração de sistemas terceiros:
    conversas de chat e CRM (clientes). Gere um token de integração em
    **Configurações → Integrações** dentro da Nupapia e use-o como Bearer token
    em todas as chamadas abaixo.
servers:
  - url: https://api.nupapia.com.br/api
    description: Produção
security:
  - integrationToken: []
paths:
  /clients:
    post:
      tags:
        - Clientes
      summary: Criar cliente
      description: >
        Informe pelo menos um de `email` ou `phone` — não é preciso os dois.
        Útil pra importar bases onde nem todo contato tem e-mail cadastrado.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                lastname:
                  type: string
                email:
                  type: string
                  description: Obrigatório se `phone` não for enviado.
                phone:
                  type: string
                  description: Obrigatório se `email` não for enviado.
                type:
                  type: string
                  enum:
                    - pf
                    - pj
      responses:
        '201':
          description: Cliente criado
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Client'
        '422':
          description: Faltou `name`, ou faltaram os dois — `email` e `phone`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Client:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        lastname:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
        avatar_url:
          type: string
          nullable: true
        client_type:
          type: string
          enum:
            - pf
            - pj
          nullable: true
        assigned_to:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  securitySchemes:
    integrationToken:
      type: http
      scheme: bearer
      bearerFormat: Token de integração (gerado em Configurações → Integrações)

````