Create consent by user token
curl --request POST \
--url http://localhost:3000/v1/consent/token/{token}/{brief} \
--header 'Content-Type: application/json' \
--header 'X-Bunker-Token: <api-key>' \
--data '
{
"message": "Optional long text here"
}
'import requests
url = "http://localhost:3000/v1/consent/token/{token}/{brief}"
payload = { "message": "Optional long text here" }
headers = {
"X-Bunker-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Bunker-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Optional long text here'})
};
fetch('http://localhost:3000/v1/consent/token/{token}/{brief}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/consent/token/{token}/{brief}",
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([
'message' => 'Optional long text here'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Bunker-Token: <api-key>"
],
]);
$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 := "http://localhost:3000/v1/consent/token/{token}/{brief}"
payload := strings.NewReader("{\n \"message\": \"Optional long text here\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Bunker-Token", "<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.post("http://localhost:3000/v1/consent/token/{token}/{brief}")
.header("X-Bunker-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Optional long text here\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/consent/token/{token}/{brief}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Bunker-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Optional long text here\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"status": "error",
"message": "user with this email already exists"
}{
"status": "error",
"message": "missing X-Bunker-Token header"
}{
"status": "error",
"message": "user not found"
}Consent
Create consent by user token
Stores user consent. The brief parameter is a unique consent identifier per user.
Allowed characters: [a-z0-9-], max 64 characters.
POST
/
v1
/
consent
/
token
/
{token}
/
{brief}
Create consent by user token
curl --request POST \
--url http://localhost:3000/v1/consent/token/{token}/{brief} \
--header 'Content-Type: application/json' \
--header 'X-Bunker-Token: <api-key>' \
--data '
{
"message": "Optional long text here"
}
'import requests
url = "http://localhost:3000/v1/consent/token/{token}/{brief}"
payload = { "message": "Optional long text here" }
headers = {
"X-Bunker-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Bunker-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Optional long text here'})
};
fetch('http://localhost:3000/v1/consent/token/{token}/{brief}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/consent/token/{token}/{brief}",
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([
'message' => 'Optional long text here'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Bunker-Token: <api-key>"
],
]);
$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 := "http://localhost:3000/v1/consent/token/{token}/{brief}"
payload := strings.NewReader("{\n \"message\": \"Optional long text here\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Bunker-Token", "<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.post("http://localhost:3000/v1/consent/token/{token}/{brief}")
.header("X-Bunker-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Optional long text here\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/consent/token/{token}/{brief}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Bunker-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Optional long text here\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"status": "error",
"message": "user with this email already exists"
}{
"status": "error",
"message": "missing X-Bunker-Token header"
}{
"status": "error",
"message": "user not found"
}Authorizations
Root access token for Databunker API
Path Parameters
User token (UUID)
Consent brief (unique identifier, max 64 chars)
Maximum string length:
64Pattern:
^[a-z0-9-]+$Body
application/jsonapplication/x-www-form-urlencoded
Consent status
Available options:
accept, cancel Text message describing consent
Free text for internal usage
Date & time to automatically enable consent (Unix time or duration like '10d')
Consent expiration date (Unix time or duration like '1m')
Legal basis for processing
Available options:
consent, contract-agreement, legal-obligations Module type (e.g., phone-consent, contract, app-consent, web-consent, email-consent)
Internal document or contract ID
Name of person who last modified this record
Response
Consent created successfully
Available options:
ok Example:
"ok"