Create record
curl --request POST \
--url https://yys-sqr-render-bsbe.onrender.com/api/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file'import requests
url = "https://yys-sqr-render-bsbe.onrender.com/api/records"
files = { "image": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://yys-sqr-render-bsbe.onrender.com/api/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"watermark_id": "SQR-A1B2C",
"card": {
"watermark_id": "SQR-A1B2C",
"template_id": "pharma",
"claim_status": "unclaimed",
"description": "<string>",
"record_metadata": {
"product_name": "Aspirin",
"dosage": "100mg"
},
"image_url": "<string>",
"watermarked_image_url": "<string>",
"scan_count": 0,
"nft_token_id": 123,
"mint_transaction_hash": "<string>",
"owner_address": "<string>",
"claimed_by": "<string>",
"claim_transaction_hash": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"minted_at": "2023-11-07T05:31:56Z",
"claimed_at": "2023-11-07T05:31:56Z"
},
"watermarked_image": "<string>"
}{
"error": "Not found"
}Records
Create record
Create a new digital twin record with image upload. The image is automatically watermarked with a unique ID. Supports both multipart form upload and JSON with base64 image.
POST
/
api
/
records
Create record
curl --request POST \
--url https://yys-sqr-render-bsbe.onrender.com/api/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file'import requests
url = "https://yys-sqr-render-bsbe.onrender.com/api/records"
files = { "image": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://yys-sqr-render-bsbe.onrender.com/api/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"watermark_id": "SQR-A1B2C",
"card": {
"watermark_id": "SQR-A1B2C",
"template_id": "pharma",
"claim_status": "unclaimed",
"description": "<string>",
"record_metadata": {
"product_name": "Aspirin",
"dosage": "100mg"
},
"image_url": "<string>",
"watermarked_image_url": "<string>",
"scan_count": 0,
"nft_token_id": 123,
"mint_transaction_hash": "<string>",
"owner_address": "<string>",
"claimed_by": "<string>",
"claim_transaction_hash": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"minted_at": "2023-11-07T05:31:56Z",
"claimed_at": "2023-11-07T05:31:56Z"
},
"watermarked_image": "<string>"
}{
"error": "Not found"
}Authorizations
Pass a Supabase JWT or a 48-character hex API key as a Bearer token.
Body
multipart/form-dataapplication/json

