curl --request PUT \
--url https://www.consentfly.com.br/api/v1/policies/{policyId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Política de Privacidade — Acme",
"content": "Versão revisada da política de privacidade da Acme...\n"
}
'import requests
url = "https://www.consentfly.com.br/api/v1/policies/{policyId}"
payload = {
"name": "Política de Privacidade — Acme",
"content": "Versão revisada da política de privacidade da Acme...
"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Política de Privacidade — Acme',
content: 'Versão revisada da política de privacidade da Acme...\n'
})
};
fetch('https://www.consentfly.com.br/api/v1/policies/{policyId}', 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://www.consentfly.com.br/api/v1/policies/{policyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Política de Privacidade — Acme',
'content' => 'Versão revisada da política de privacidade da Acme...
'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://www.consentfly.com.br/api/v1/policies/{policyId}"
payload := strings.NewReader("{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://www.consentfly.com.br/api/v1/policies/{policyId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.consentfly.com.br/api/v1/policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6b8b4567-327a-4d10-92a5-9e8c4f5a7d12",
"user_id": "9e8c4f5a-7d12-4d10-92a5-6b8b4567327a",
"name": "Política de Privacidade — Acme",
"content": "Esta política descreve como a Acme trata dados pessoais...",
"version": 3,
"created_at": "2026-01-15T12:34:56Z",
"updated_at": "2026-05-08T09:20:00Z"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}Update policy
Atualiza nome/conteúdo. Cada atualização publica uma nova versão (o número de versão é incrementado no servidor).
curl --request PUT \
--url https://www.consentfly.com.br/api/v1/policies/{policyId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Política de Privacidade — Acme",
"content": "Versão revisada da política de privacidade da Acme...\n"
}
'import requests
url = "https://www.consentfly.com.br/api/v1/policies/{policyId}"
payload = {
"name": "Política de Privacidade — Acme",
"content": "Versão revisada da política de privacidade da Acme...
"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Política de Privacidade — Acme',
content: 'Versão revisada da política de privacidade da Acme...\n'
})
};
fetch('https://www.consentfly.com.br/api/v1/policies/{policyId}', 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://www.consentfly.com.br/api/v1/policies/{policyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Política de Privacidade — Acme',
'content' => 'Versão revisada da política de privacidade da Acme...
'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://www.consentfly.com.br/api/v1/policies/{policyId}"
payload := strings.NewReader("{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://www.consentfly.com.br/api/v1/policies/{policyId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.consentfly.com.br/api/v1/policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Política de Privacidade — Acme\",\n \"content\": \"Versão revisada da política de privacidade da Acme...\\n\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6b8b4567-327a-4d10-92a5-9e8c4f5a7d12",
"user_id": "9e8c4f5a-7d12-4d10-92a5-6b8b4567327a",
"name": "Política de Privacidade — Acme",
"content": "Esta política descreve como a Acme trata dados pessoais...",
"version": 3,
"created_at": "2026-01-15T12:34:56Z",
"updated_at": "2026-05-08T09:20:00Z"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}Authorizations
Autenticação por API Key no formato Authorization: Bearer sk-...
(sempre inclua o prefixo Bearer).
Gere sua chave em /dashboard/api-keys após criar a conta e
verificar o e-mail. A chave é exibida uma única vez no momento
da criação — armazene em variável de ambiente no seu backend.
Nunca exponha em código client-side.
Path Parameters
UUID da política.
Body
Corpo para atualizar uma política. Cada atualização publica uma nova versão (o servidor incrementa version).
Response
OK
"6b8b4567-327a-4d10-92a5-9e8c4f5a7d12"
"9e8c4f5a-7d12-4d10-92a5-6b8b4567327a"
"Política de Privacidade — Acme"
"Esta política descreve como a Acme trata dados pessoais..."
Incrementa a cada atualização (começa em 1).
3
"2026-01-15T12:34:56Z"
"2026-05-08T09:20:00Z"
