- Docs
- Api%2Freference%2Ftemplates%2FCreateTemplate
Create a template
Design a new kind of object: what it is called, what it carries, how it looks, what can be done with it and by whom. **What it carries.** `object.metadata` is the name and description people see. `object.custom` is your own data — seat numbers, tiers, expiry dates — and every object made from this template starts with these values and can change them later. **What can be done with it.** `actions` lists the moves this object allows, such as `mint`, `transfer`, `redeem` or `burn`, and each one says who may make it. Leave `actions` out and you get minting, transferring and burning, open to anyone. **How many, and when.** `factory.max_supply` caps how many objects can ever exist, and `start_time` and `end_time` open and close the window in which they can be created. A start time in the past means "from now". **What the public sees.** Templates are visible to everyone at `/public/templates`, but only the custom fields you name in `public_access.custom` are shown there. Everything else stays between you and the object's owner. Names have to be unique within your organization; reusing one comes back as `400`. Requires the `templates.create` permission.
The access token returned after a successful sign-in, sent as
Authorization: Bearer <access_token>.
It identifies the person and the organization they are working in, and
it lasts about fifteen minutes. When it runs out, use their refresh
token at POST /auth/refresh-token instead of asking them to sign in
again.
In: header
Request Body
application/json
The template to create.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.dual.network/templates" \ -H "Content-Type: application/json" \ -d '{ "name": "Summer Festival Ticket", "face_id": "665f1c2d4b1a2c3d4e5f6a50", "object": { "metadata": { "name": "Summer Festival 2026", "description": "Three days, four stages, one wristband." }, "custom": { "tier": "general", "seat": null } }, "factory": { "max_supply": 4000, "start_time": "2026-04-01T09:00:00Z", "end_time": "2026-07-31T23:59:59Z" }, "actions": [ { "name": "mint", "access": { "type": "private" } }, { "name": "transfer", "access": { "type": "public" } }, { "name": "redeem", "alias": "check-in", "access": { "type": "private" } } ], "public_access": { "custom": [ "tier" ] } }'{
"id": "665f1c2d4b1a2c3d4e5f6a7b"
}{
"code": 3,
"message": "already exists"
}{
"code": 16,
"message": "no auth provided"
}{
"code": 13,
"message": "internal error"
}