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

# Criar um cliente

> Criar um novo cliente.



## OpenAPI

````yaml /api-reference/openapi.json post /api/management/customers
openapi: 3.0.0
info:
  title: Olie API
  version: 1.0.0
  description: >
    # Introdução 👋


    Olá! Esta é a documentação oficial da API da [olie.ai](https://olie.ai/).
    Aqui você encontra as referências e exemplos de uso dos nossos endpoints.


    Para uma visão completa, recomendamos fortemente que você leia a
    [documentação oficial](https://docs.olie.ai/api-reference/introduction). Lá
    estão detalhados tópicos essenciais como
    [autenticação](https://docs.olie.ai/api-reference/introduction/authentication),
    [estrutura de
    respostas](https://docs.olie.ai/api-reference/general/response-structure),
    [paginação](https://docs.olie.ai/api-reference/general/pagination) e outros
    guias de integração.


    No Postman, esta coleção foca nas informações específicas de cada requisição
    (endpoints, parâmetros e exemplos), servindo como apoio rápido para testes e
    desenvolvimento.
servers:
  - url: https://api.olie.ai
security:
  - BearerAuth: []
paths:
  /api/management/customers:
    post:
      tags:
        - customers
      summary: Criar um cliente
      description: Criar um novo cliente.
      operationId: criarCliente
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Nome do contato
                role:
                  type: string
                  description: Cargo do contato
                email:
                  type: string
                  maxLength: 254
                  description: E-mail do contato
                  format: email
                phone:
                  type: string
                  maxLength: 30
                  description: Telefone do contato
                description:
                  type: string
                  maxLength: 255
                  description: Descrição do contato
                customers:
                  type: object
                  description: >-
                    Clientes vinculados ao contato. Envie to_add (clientes a
                    adicionar) e to_rem (clientes a remover).
                  properties:
                    to_add:
                      type: array
                      description: IDs dos clientes a adicionar
                      items:
                        type: string
                        format: uuid
                    to_rem:
                      type: array
                      description: IDs dos clientes a remover
                      items:
                        type: string
                        format: uuid
                  required:
                    - to_add
                    - to_rem
                tags:
                  type: object
                  description: >-
                    Etiquetas do contato. Envie to_add (etiquetas a adicionar) e
                    to_rem (etiquetas a remover).
                  properties:
                    to_add:
                      type: array
                      description: >-
                        Etiquetas a adicionar: use id para vincular etiqueta
                        existente ou name (e opcionalmente color) para criar
                        nova
                      items:
                        oneOf:
                          - type: object
                            properties:
                              id:
                                type: string
                                description: ID da etiqueta existente
                                format: uuid
                            required:
                              - id
                          - type: object
                            properties:
                              name:
                                type: string
                                maxLength: 255
                                description: Nome da nova etiqueta
                              color:
                                type: string
                                pattern: ^#[0-9A-Fa-f]{6}$
                                description: 'Cor em hex (ex: #FF0000)'
                            required:
                              - name
                    to_rem:
                      type: array
                      description: Etiquetas a remover
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: ID da etiqueta a remover
                            format: uuid
                        required:
                          - id
                  required:
                    - to_add
                    - to_rem
                form_answers:
                  type: array
                  description: Respostas do formulário dinâmico
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID da pergunta do formulário (form_edge id)
                      answer:
                        type: string
                        description: Resposta para a pergunta
                    required:
                      - id
                      - answer
              required:
                - name
            example:
              name: Cliente Exemplo - Filial Rio Preto
              document_type: 2
              customer_type: 1
              company_name: Cliente Exemplo Comércio LTDA
              document: 12.345.678/0002-71
              email: rp@clienteexemplo.com.br
              phone: (91) 99999-0000
              address: Av. Exemplo, 456 - Campinas/SP
              status: true
              parent_id: null
              tags:
                to_add: []
                to_rem: []
      responses:
        '200':
          description: Sucesso (CNPJ)
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
            Cache-Control:
              schema:
                type: string
              example: no-cache, private
            Date:
              schema:
                type: string
              example: Fri, 16 Jan 2026 18:03:26 GMT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 160
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 157
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
        '201':
          description: Sucesso (CNPJ)
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: '*'
            Cache-Control:
              schema:
                type: string
              example: no-cache, private
            Date:
              schema:
                type: string
              example: Fri, 16 Jan 2026 18:03:26 GMT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 160
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 157
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      headquarter:
                        type: string
                      company_name:
                        type: string
                      document_type:
                        type: integer
                      customer_type:
                        type: integer
                      document:
                        type: string
                      email:
                        type: string
                        format: email
                      phone:
                        type: string
                      address:
                        type: string
                      status:
                        type: boolean
                      form_answers:
                        type: array
                        items: {}
                      frame_id:
                        type: string
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      created_by:
                        type: string
                  response:
                    type: boolean
              example:
                customer:
                  id: 019bc7f9-f586-7386-a27d-a070e8ae5ac2
                  name: Cliente Exemplo - Filial Rio Preto
                  headquarter: Cliente Exemplo - Filial Rio Preto
                  branch: null
                  company_name: Cliente Exemplo Comércio LTDA
                  document_type: 2
                  customer_type: 1
                  document: 12.345.678/0000-00
                  main_activity: null
                  email: rp@clienteexemplo.com.br
                  phone: (91) 99999-0000
                  address: Av. Exemplo, 456 - Campinas/SP
                  description: null
                  custom_fields: null
                  status: true
                  form_answers: []
                  parent_id: null
                  frame_id: 019b329a-4346-7064-bba3-e7c19057cda4
                  created_at: '2026-01-16T18:03:25.000000Z'
                  updated_at: '2026-01-16T18:03:25.000000Z'
                  deleted_at: null
                  created_by: 019b329a-3f1f-7198-89e5-008dc4e2bd60
                response: true
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````