Protect Content (Consumer Mint)
curl --request POST \
--url https://api.truthlocks.com/v1/consumer/mint \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content_hash": "<string>",
"title": "<string>",
"description": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"ai_metadata": {}
}
'import requests
url = "https://api.truthlocks.com/v1/consumer/mint"
payload = {
"content_hash": "<string>",
"title": "<string>",
"description": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"ai_metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content_hash: '<string>',
title: '<string>',
description: '<string>',
content_type: '<string>',
file_name: '<string>',
file_size: 123,
ai_metadata: {}
})
};
fetch('https://api.truthlocks.com/v1/consumer/mint', 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://api.truthlocks.com/v1/consumer/mint",
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([
'content_hash' => '<string>',
'title' => '<string>',
'description' => '<string>',
'content_type' => '<string>',
'file_name' => '<string>',
'file_size' => 123,
'ai_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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 := "https://api.truthlocks.com/v1/consumer/mint"
payload := strings.NewReader("{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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("https://api.truthlocks.com/v1/consumer/mint")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/consumer/mint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"protection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attestation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"verify_url": "<string>",
"share_url": "<string>",
"content_hash": "<string>",
"protected_at": "2023-11-07T05:31:56Z",
"status": "protected"
}Consumer (B2C)
Protect Content (Consumer Mint)
Mint a cryptographic attestation for content you want to protect. Your personal issuer and signing key are resolved automatically. Hash the content client-side (SHA-256) and submit the hash with file metadata.
POST
/
v1
/
consumer
/
mint
Protect Content (Consumer Mint)
curl --request POST \
--url https://api.truthlocks.com/v1/consumer/mint \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content_hash": "<string>",
"title": "<string>",
"description": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"ai_metadata": {}
}
'import requests
url = "https://api.truthlocks.com/v1/consumer/mint"
payload = {
"content_hash": "<string>",
"title": "<string>",
"description": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"ai_metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content_hash: '<string>',
title: '<string>',
description: '<string>',
content_type: '<string>',
file_name: '<string>',
file_size: 123,
ai_metadata: {}
})
};
fetch('https://api.truthlocks.com/v1/consumer/mint', 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://api.truthlocks.com/v1/consumer/mint",
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([
'content_hash' => '<string>',
'title' => '<string>',
'description' => '<string>',
'content_type' => '<string>',
'file_name' => '<string>',
'file_size' => 123,
'ai_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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 := "https://api.truthlocks.com/v1/consumer/mint"
payload := strings.NewReader("{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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("https://api.truthlocks.com/v1/consumer/mint")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/consumer/mint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_hash\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"content_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"ai_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"protection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attestation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"verify_url": "<string>",
"share_url": "<string>",
"content_hash": "<string>",
"protected_at": "2023-11-07T05:31:56Z",
"status": "protected"
}Mint a cryptographic attestation for a piece of content you want to protect. Your personal issuer and signing key are resolved automatically — you do not need to create an issuer or register a key.
Hash your content client-side with SHA-256 and submit the hash along with file metadata. The endpoint returns a protection record with a shareable proof URL you can use to demonstrate authorship.
Rate limits depend on your plan tier:
The response includes
| Plan | Protections per month |
|---|---|
| Free | 50 |
| Creator | 500 |
| Pro | Unlimited |
content_hash and protected_at so you can confirm which content was protected and the exact timestamp without making a follow-up call.
Parameters
string
required
SHA-256 hash of the file content, computed client-side before upload.
string
Human-readable title for the protection (e.g. the file name or a short description).
string
Optional description providing additional context about the protected content.
string
MIME type of the content (e.g.
image/png, application/pdf, text/x-python).string
Original file name including extension.
integer
File size in bytes.
string
Content category. One of
code, research, design, media, dataset, ai-output, writing, digital-art, or other. Defaults to other.object
Optional AI-extracted metadata object (e.g. from the AI metadata extraction flow).
string
Controls whether the protection appears on your public portfolio. Either
public or private. Defaults to private.Responses
Authorizations
APIKeyBearerAuth
API key for machine-to-machine authentication
Body
application/json
SHA-256 hash of the file content, computed client-side.
Human-readable title for the protection.
Optional description of the protected content.
MIME type of the content (e.g. image/png).
Original file name including extension.
File size in bytes.
Content category. Defaults to other.
Available options:
code, research, design, media, dataset, ai-output, writing, digital-art, other Optional AI-extracted metadata object.
Whether the protection appears on your public portfolio. Defaults to private.
Available options:
public, private Response
Content protected

