curl --request POST \
--url https://api.truthlocks.com/v1/attestations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '550e8400-e29b-41d4-a716-446655440000',
kid: 'es256-key-1',
schema: 'verifiable-id',
claims: {full_name: 'Example recipient', employee_id: 'QA-001'}
})
};
fetch('https://api.truthlocks.com/v1/attestations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/attestations"
payload = {
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/attestations"
payload := strings.NewReader("{\n \"issuer_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"kid\": \"es256-key-1\",\n \"schema\": \"verifiable-id\",\n \"claims\": {\n \"full_name\": \"Example recipient\",\n \"employee_id\": \"QA-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kid": "<string>",
"status": "VALID",
"payload": {},
"signature": "<string>",
"log_index": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Mint through the collection route
Mint Attestation
curl --request POST \
--url https://api.truthlocks.com/v1/attestations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '550e8400-e29b-41d4-a716-446655440000',
kid: 'es256-key-1',
schema: 'verifiable-id',
claims: {full_name: 'Example recipient', employee_id: 'QA-001'}
})
};
fetch('https://api.truthlocks.com/v1/attestations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/attestations"
payload = {
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/attestations"
payload := strings.NewReader("{\n \"issuer_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"kid\": \"es256-key-1\",\n \"schema\": \"verifiable-id\",\n \"claims\": {\n \"full_name\": \"Example recipient\",\n \"employee_id\": \"QA-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kid": "<string>",
"status": "VALID",
"payload": {},
"signature": "<string>",
"log_index": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Authorizations
API key for machine-to-machine authentication
Headers
Body
- Structured record
- Encoded payload
Choose Structured record to select a record type and enter claims, or Encoded payload to sign existing bytes. Never combine both input formats.
Must match the selected issuer signing key.
Ed25519, ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384, PS512 The UUID of the issuer creating the attestation
"550e8400-e29b-41d4-a716-446655440000"
Key identifier for the signing key
"es256-key-1"
Record type for structured input. Provide claims and omit payload_b64url. This label does not independently validate the truth of claims.
verifiable-id, passport, drivers-license, government-id, self-sovereign-id, employment-verification, professional-role, membership-card, professional-certification, license, accreditation, degree, completion-cert, course-credit, transcript, micro-credential, training-completion, medical-license, dea-registration, board-certification, health-credential, vaccination-record, aml-kyc, security-clearance, sam-gov, jurisdiction-approval, attestation-of-will, bank-verification, credit-attestation, income-verification, skill-badge, competency, industry-cert, product-authenticity, chain-of-custody, origin-verification, custom, attestation "verifiable-id"
Structured record fields. Required with schema; cannot be combined with payload_b64url.
{
"full_name": "Example recipient",
"employee_id": "QA-001"
}
MIME type of the original bytes, such as application/json, application/pdf or image/png. Structured schema/claims input requires application/json.
"application/json"
Optional hexadecimal SHA-256 document hash. An embedded claims.document.sha256 takes precedence; otherwise this field is used, then the decoded payload hash.
Optional workspace verification-pack UUID. Use List verification packs with the same API key to select an existing active pack; omit for a standalone record.
Optional future Unix timestamp in seconds for structured schema/claims input. It is included in the signed JSON payload. For payload_b64url input, omit this request field and embed expires_at_unix at the root of the exact JSON payload instead. Expiry cannot be changed in place.
1 <= x <= 253402300799Optional recipient for asynchronous notification after minting. A successful mint response does not confirm delivery.

