Record acceptance of every active legal document
curl --request POST \
--url http://localhost:3051/api/v1/me/terms/accept \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"<string>"
]
}
'import requests
url = "http://localhost:3051/api/v1/me/terms/accept"
payload = { "document_ids": ["<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_ids: ['<string>']})
};
fetch('http://localhost:3051/api/v1/me/terms/accept', 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 => "3051",
CURLOPT_URL => "http://localhost:3051/api/v1/me/terms/accept",
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_ids' => [
'<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 := "http://localhost:3051/api/v1/me/terms/accept"
payload := strings.NewReader("{\n \"document_ids\": [\n \"<string>\"\n ]\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("http://localhost:3051/api/v1/me/terms/accept")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3051/api/v1/me/terms/accept")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"accepted_at": "2023-11-07T05:31:56Z",
"documents": [
{
"document_id": "<string>",
"document_key": "<string>",
"version": 123,
"accepted_at": "2023-11-07T05:31:56Z"
}
]
}Account
Accept legal documents
Records that the authenticated user accepts the given document versions. document_ids must match the currently active set exactly. A missing or superseded id is rejected so a stale client cannot accept the wrong documents. Writes one ledger row per document, all sharing a timestamp, IP and user-agent. Idempotent: re-accepting a document keeps its original acceptance date.
POST
/
api
/
v1
/
me
/
terms
/
accept
Record acceptance of every active legal document
curl --request POST \
--url http://localhost:3051/api/v1/me/terms/accept \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"<string>"
]
}
'import requests
url = "http://localhost:3051/api/v1/me/terms/accept"
payload = { "document_ids": ["<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_ids: ['<string>']})
};
fetch('http://localhost:3051/api/v1/me/terms/accept', 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 => "3051",
CURLOPT_URL => "http://localhost:3051/api/v1/me/terms/accept",
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_ids' => [
'<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 := "http://localhost:3051/api/v1/me/terms/accept"
payload := strings.NewReader("{\n \"document_ids\": [\n \"<string>\"\n ]\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("http://localhost:3051/api/v1/me/terms/accept")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3051/api/v1/me/terms/accept")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"accepted_at": "2023-11-07T05:31:56Z",
"documents": [
{
"document_id": "<string>",
"document_key": "<string>",
"version": 123,
"accepted_at": "2023-11-07T05:31:56Z"
}
]
}Records the authenticated user’s acceptance of the legal documents currently in force.
document_ids must match the active set exactly. A missing id, or one that has since been superseded, is rejected with a 400. This stops a page that was loaded before a new version went live from recording an acceptance of the wrong documents. Re-fetch the document list and submit every document_id it returns.
One ledger row is written per document, all sharing a timestamp, IP address and user-agent. Accepting is idempotent: a document the user already agreed to keeps its original acceptance date.
Session auth only. This endpoint is not usable with an API key.Authorizations
API key from the Omnifence dashboard
Body
application/json
Minimum array length:
1Minimum string length:
1