openapi: 3.2.0 info: title: Oto Data Customers API description: 'A Data API do Oto permite que você faça cargas de dados de forma segura e confiável, utilizando padrões REST e corpos das mensagens em formato JSON. Os registros são inseridos na modalidade _upsert_, isto é, caso um registro com a mesma chave primária exista na base de dados, ele será integralmente substituído pelo registro enviado. Caso contrário, um novo registro será criado na base de dados. # Limites Dois limites são aplicados em todos os endpoints desta API: requisições por minuto e quantidade máxima de registros por requisição. ## Limite de requisições Para garantir a estabilidade e segurança da plataforma, esta API aceita um número máximo de **200** requisições por minuto por IP de origem. As requisições que excederem este limite terão suas respostas atrasadas para que se mantenha o ritmo estipulado, até que eventualmente podem ser barradas com a resposta `HTTP/1.1 429 Too many requests`. ## Limite de registros por requisição São aceitos até **10.000** registros por requisição. Caso a propriedade `data` contenha um número superior de entradas, a requisição será recusada com a resposta `HTTP/1.1 413 Payload Too Large`.' version: 1.3.5 x-logo: url: https://pmweblabs.s3.amazonaws.com/assets/oto-logo.png href: https://suporte.otocrm.com.br/ altText: Oto. Quem conhece, vende. servers: - url: https://data-api.otocrm.com.br description: Production - url: https://data-api-hmg.otocrm.com.br description: Test - url: http://localhost:8000 description: Test tags: - name: Customers paths: /v1/customers: post: summary: Post Customers description: 'Criar ou editar clientes. Os registros são deduplicados pelas colunas `customer_id` e `data_source`. Os campos adicionais (`custom_field_NN`) podem ser configurados à parte e utilizados para critérios de segmentação e personalização da plataforma.' operationId: post_customers_v1_customers_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomersPostRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SuccessResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [] tags: - Customers components: schemas: TypePerson: type: string enum: - P - J title: TypePerson Gender: type: string enum: - M - F - O title: Gender HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError SuccessResponse: properties: success: anyOf: - type: boolean - type: 'null' title: Success requestId: anyOf: - type: string format: uuid - type: 'null' title: Requestid type: object title: SuccessResponse CustomersPostRequest: properties: data: items: $ref: '#/components/schemas/Customer' type: array title: Data type: object required: - data title: CustomersPostRequest Customer: properties: customer_id: type: string title: Customer Id description: Identificador único do cliente document_number: anyOf: - type: string - type: 'null' title: Document Number description: Documento de identificação (indexado na busca) username_whatsapp: anyOf: - type: string - type: 'null' title: Username Whatsapp description: Identificador do cliente para mensagens de WhatsApp mkt_cloud_id: anyOf: - type: string - type: 'null' title: Mkt Cloud Id description: Identificador do usuário na marketing cloud email: anyOf: - type: string - type: 'null' title: Email description: E-mail do cliente email_permission: anyOf: - type: boolean - type: 'null' title: Email Permission description: Permissão para envio de e-mails promocionais mobile_number: anyOf: - type: string - type: 'null' title: Mobile Number description: "Telefone celular do cliente, com DDD, DDI e nono dígito.\n\nO WhatsApp só aceita números formatados corretamente, ou seja, para\ntelefones do Brasil, o formato é de formato de 13 dígitos, sendo 2\ndígitos do DDI + 2 dígitos DDD + o dígito 9 + 8 dígitos do telefone.\n " mobile_permission: anyOf: - type: boolean - type: 'null' title: Mobile Permission description: Permissão para ligações e SMS promocionais phone_number: anyOf: - type: string - type: 'null' title: Phone Number description: Telefone fixo do cliente, com DDD, DDI e nono dígito. whatsapp_permission: anyOf: - type: boolean - type: 'null' title: Whatsapp Permission description: Permissão para mensagens promocionais de WhatsApp first_name: anyOf: - type: string - type: 'null' title: First Name description: Primeiro nome do cliente last_name: anyOf: - type: string - type: 'null' title: Last Name description: Sobrenome do cliente pref_store: anyOf: - type: string - type: 'null' title: Pref Store description: Código da loja de preferência (chave estrangeira) pref_seller: anyOf: - type: string - type: 'null' title: Pref Seller description: Código (matrícula) do vendedor de preferência create_date: type: string format: date title: Create Date description: Data de criação do cadastro (yyyy-mm-dd) country: anyOf: - type: string - type: 'null' title: Country description: País do cliente state: anyOf: - type: string - type: 'null' title: State description: Estado (UF) do cliente city: anyOf: - type: string - type: 'null' title: City description: Cidade do cliente zipcode: anyOf: - type: string - type: 'null' title: Zipcode description: Código postal (CEP) do cliente address: anyOf: - type: string - type: 'null' title: Address description: Logradouro address_number: anyOf: - type: string - type: 'null' title: Address Number description: Número address_complement: anyOf: - type: string - type: 'null' title: Address Complement description: Complemento do endereço neighborhood: anyOf: - type: string - type: 'null' title: Neighborhood description: Bairro gender: anyOf: - $ref: '#/components/schemas/Gender' - type: 'null' description: M = Masculino, F = Feminino, O = Outro type_person: anyOf: - $ref: '#/components/schemas/TypePerson' - type: 'null' description: P = Pessoa Física, J = Pessoa Jurídica date_birth: anyOf: - type: string format: date - type: 'null' title: Date Birth description: Data de nascimento do cliente (yyyy-mm-dd) first_order: anyOf: - type: string format: date - type: 'null' title: First Order description: Data da primeira compra do cliente (yyyy-mm-dd) rfv: anyOf: - type: string - type: 'null' title: Rfv description: Categoria do cliente exibida no Oto data_source: anyOf: - type: string - type: 'null' title: Data Source description: Código da origem de dados custom_field_01: anyOf: - type: string - type: 'null' title: Custom Field 01 description: Campo adicional para segmentação custom_field_02: anyOf: - type: string - type: 'null' title: Custom Field 02 description: Campo adicional para segmentação custom_field_03: anyOf: - type: string - type: 'null' title: Custom Field 03 description: Campo adicional para segmentação custom_field_04: anyOf: - type: string - type: 'null' title: Custom Field 04 description: Campo adicional para segmentação custom_field_05: anyOf: - type: string - type: 'null' title: Custom Field 05 description: Campo adicional para segmentação custom_field_06: anyOf: - type: string - type: 'null' title: Custom Field 06 description: Campo adicional para segmentação custom_field_07: anyOf: - type: string - type: 'null' title: Custom Field 07 description: Campo adicional para segmentação custom_field_08: anyOf: - type: string - type: 'null' title: Custom Field 08 description: Campo adicional para segmentação custom_field_09: anyOf: - type: string - type: 'null' title: Custom Field 09 description: Campo adicional para segmentação custom_field_10: anyOf: - type: string - type: 'null' title: Custom Field 10 description: Campo adicional para segmentação custom_field_11: anyOf: - type: string - type: 'null' title: Custom Field 11 description: Campo adicional para segmentação custom_field_12: anyOf: - type: string - type: 'null' title: Custom Field 12 description: Campo adicional para segmentação custom_field_13: anyOf: - type: string - type: 'null' title: Custom Field 13 description: Campo adicional para segmentação custom_field_14: anyOf: - type: string - type: 'null' title: Custom Field 14 description: Campo adicional para segmentação custom_field_15: anyOf: - type: string - type: 'null' title: Custom Field 15 description: Campo adicional para segmentação custom_field_16: anyOf: - type: string - type: 'null' title: Custom Field 16 description: Campo adicional para segmentação custom_field_17: anyOf: - type: string - type: 'null' title: Custom Field 17 description: Campo adicional para segmentação custom_field_18: anyOf: - type: string - type: 'null' title: Custom Field 18 description: Campo adicional para segmentação custom_field_19: anyOf: - type: string - type: 'null' title: Custom Field 19 description: Campo adicional para segmentação custom_field_20: anyOf: - type: string - type: 'null' title: Custom Field 20 description: Campo adicional para segmentação custom_field_21: anyOf: - type: string - type: 'null' title: Custom Field 21 description: Campo adicional para segmentação custom_field_22: anyOf: - type: string - type: 'null' title: Custom Field 22 description: Campo adicional para segmentação custom_field_23: anyOf: - type: string - type: 'null' title: Custom Field 23 description: Campo adicional para segmentação custom_field_24: anyOf: - type: string - type: 'null' title: Custom Field 24 description: Campo adicional para segmentação custom_field_25: anyOf: - type: string - type: 'null' title: Custom Field 25 description: Campo adicional para segmentação custom_field_26: anyOf: - type: string - type: 'null' title: Custom Field 26 description: Campo adicional para segmentação custom_field_27: anyOf: - type: string - type: 'null' title: Custom Field 27 description: Campo adicional para segmentação custom_field_28: anyOf: - type: string - type: 'null' title: Custom Field 28 description: Campo adicional para segmentação custom_field_29: anyOf: - type: string - type: 'null' title: Custom Field 29 description: Campo adicional para segmentação custom_field_30: anyOf: - type: string - type: 'null' title: Custom Field 30 description: Campo adicional para segmentação custom_field_31: anyOf: - type: string - type: 'null' title: Custom Field 31 description: Campo adicional para segmentação custom_field_32: anyOf: - type: string - type: 'null' title: Custom Field 32 description: Campo adicional para segmentação custom_field_33: anyOf: - type: string - type: 'null' title: Custom Field 33 description: Campo adicional para segmentação custom_field_34: anyOf: - type: string - type: 'null' title: Custom Field 34 description: Campo adicional para segmentação custom_field_35: anyOf: - type: string - type: 'null' title: Custom Field 35 description: Campo adicional para segmentação custom_field_36: anyOf: - type: string - type: 'null' title: Custom Field 36 description: Campo adicional para segmentação custom_field_37: anyOf: - type: string - type: 'null' title: Custom Field 37 description: Campo adicional para segmentação custom_field_38: anyOf: - type: string - type: 'null' title: Custom Field 38 description: Campo adicional para segmentação custom_field_39: anyOf: - type: string - type: 'null' title: Custom Field 39 description: Campo adicional para segmentação custom_field_40: anyOf: - type: string - type: 'null' title: Custom Field 40 description: Campo adicional para segmentação custom_field_41: anyOf: - type: string - type: 'null' title: Custom Field 41 description: Campo adicional para segmentação custom_field_42: anyOf: - type: string - type: 'null' title: Custom Field 42 description: Campo adicional para segmentação custom_field_43: anyOf: - type: string - type: 'null' title: Custom Field 43 description: Campo adicional para segmentação custom_field_44: anyOf: - type: string - type: 'null' title: Custom Field 44 description: Campo adicional para segmentação custom_field_45: anyOf: - type: string - type: 'null' title: Custom Field 45 description: Campo adicional para segmentação custom_field_46: anyOf: - type: string - type: 'null' title: Custom Field 46 description: Campo adicional para segmentação custom_field_47: anyOf: - type: string - type: 'null' title: Custom Field 47 description: Campo adicional para segmentação custom_field_48: anyOf: - type: string - type: 'null' title: Custom Field 48 description: Campo adicional para segmentação custom_field_49: anyOf: - type: string - type: 'null' title: Custom Field 49 description: Campo adicional para segmentação custom_field_50: anyOf: - type: string - type: 'null' title: Custom Field 50 description: Campo adicional para segmentação type: object required: - customer_id - create_date title: Customer securitySchemes: HTTPBearer: type: http scheme: bearer description: "Você deverá enviar sua chave privada\nno cabeçalho HTTP `Authorization`, com o padrão `Bearer `. Exemplo:\n\n```\nGET / HTTP/1.1\nHost: data-api.otocrm.com.br\nAuthorization: Bearer abcdef123456\n```\n "