Solicitar Link Mágico
curl --request POST \
--url https://garu.com.br/api/public/minha-area/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": "<string>"
}
'import requests
url = "https://garu.com.br/api/public/minha-area/request"
payload = { "document": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({document: '<string>'})
};
fetch('https://garu.com.br/api/public/minha-area/request', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://garu.com.br/api/public/minha-area/request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/public/minha-area/request"
payload := strings.NewReader("{\n \"document\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/public/minha-area/request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/public/minha-area/request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPortal do Cliente
Solicitar Link Mágico
Envia um link de acesso ao /minha-area para o e-mail registrado do cliente
POST
/
api
/
public
/
minha-area
/
request
Solicitar Link Mágico
curl --request POST \
--url https://garu.com.br/api/public/minha-area/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": "<string>"
}
'import requests
url = "https://garu.com.br/api/public/minha-area/request"
payload = { "document": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({document: '<string>'})
};
fetch('https://garu.com.br/api/public/minha-area/request', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://garu.com.br/api/public/minha-area/request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/public/minha-area/request"
payload := strings.NewReader("{\n \"document\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/public/minha-area/request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/public/minha-area/request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyVisão Geral
Endpoint público (sem autenticação por API key). Sempre responde 200, commaskedEmail = null quando o CPF/CNPJ não corresponde a nenhum cliente — é assim por design, para evitar enumeração de CPFs cadastrados.
Quando há cliente correspondente, a Garu envia um e-mail com um link da forma https://garu.com.br/minha-area/<jwt>. O JWT tem TTL de 24h e é reutilizável dentro desse período.
Throttle
3 requisições por hora por IP. Excedente retorna 429 Too Many Requests.Exemplo de Requisição
curl -X POST https://garu.com.br/api/public/minha-area/request \
-H "Content-Type: application/json" \
-d '{ "document": "12345678901" }'
const response = await fetch(
'https://garu.com.br/api/public/minha-area/request',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ document: '12345678901' })
}
);
const { maskedEmail } = await response.json();
// maskedEmail: 'm***@gmail.com' ou null
import requests
response = requests.post(
"https://garu.com.br/api/public/minha-area/request",
json={"document": "12345678901"}
)
masked = response.json()["maskedEmail"] # 'm***@gmail.com' ou None
Parâmetros
string
required
CPF (11 dígitos) ou CNPJ (14 dígitos). Pontuação é removida no servidor.
Resposta
200 OK sempre, mesmo sem cliente correspondente:{ "maskedEmail": "m***@gmail.com" }
{ "maskedEmail": null }
Não tente inferir a existência do CPF pela resposta — o tempo de resposta é constante e o
maskedEmail = null cobre tanto “CPF inválido” quanto “CPF não cadastrado”.Erros
- 400 Bad Request — corpo inválido (ex:
documentausente). - 429 Too Many Requests — throttle de 3/hora/IP excedido.
Was this page helpful?
⌘I