{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Autenticação","description":"Documentação oficial, guias e referência da API Auvo v2.","siteUrl":"https://developers.auvo.com.br","lang":"pt-BR","keywords":"auvo, api, documentação, developers, field service, workforce","meta":[{"name":"og:site_name","content":"Auvo Developers"},{"name":"og:locale","content":"pt_BR"},{"name":"og:locale:alternate","content":"es_ES"},{"name":"og:locale:alternate","content":"en_US"},{"name":"twitter:card","content":"summary_large_image"},{"name":"twitter:site","content":"@auvoapp"}],"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"autenticação","__idx":0},"children":["Autenticação"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A API Auvo usa ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer JWT"]}," de 30 minutos emitido pelo endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /login"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"fluxo-básico","__idx":1},"children":["Fluxo básico"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Cliente chama ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /login"]}," com ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiToken"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["API responde com ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.accessToken"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.expiration"]}," (ISO-8601)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Cliente envia ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer <accessToken>"]}," em toda requisição."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Antes do ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiration"]},", repita ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /login"]}," para renovar."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"exemplo","__idx":2},"children":["Exemplo"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.auvo.com.br/v2/login \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"apiKey\":\"...\",\"apiToken\":\"...\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"boas-práticas","__idx":3},"children":["Boas práticas"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Guarde credenciais em um secret manager"]}," (AWS Secrets Manager, Doppler,"," ","1Password). Nunca no código."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Um token por aplicação"]},": evite compartilhar o mesmo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accessToken"]}," entre"," ","processos diferentes; cada worker deve renovar o seu."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Margem de segurança"]},": renove o token com 2 minutos de antecedência para"," ","cobrir clock skew."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rotação"]},": rode ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /login"]}," em falhas 401 e reexecute a chamada original"," ","apenas uma vez para evitar laço infinito."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Evite ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /login"]}]}," em produção — credenciais aparecem em logs de URL."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"erros-comuns","__idx":4},"children":["Erros comuns"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Código"},"children":["Código"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Causa"},"children":["Causa"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ação"},"children":["Ação"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}," ou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiToken"]}," vazios"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Revise o body/query."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["401"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token expirado"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Renove com ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /login"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["403"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rate limit excedido"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aguardar 60s ou aplicar backoff."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Credenciais incorretas"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Confirmar em ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Menu > Integração"]},"."]}]}]}]}]}]},"headings":[{"value":"Autenticação","id":"autenticação","depth":1},{"value":"Fluxo básico","id":"fluxo-básico","depth":2},{"value":"Exemplo","id":"exemplo","depth":2},{"value":"Boas práticas","id":"boas-práticas","depth":2},{"value":"Erros comuns","id":"erros-comuns","depth":2}],"frontmatter":{"title":"Autenticação","description":"Fluxo de Bearer JWT, rotação de token e boas práticas.","seo":{"title":"Autenticação"}},"lastModified":"2026-04-24T13:01:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}