Skip to content

templates_submit

POST
/templates
curl --request POST \
--url https://example.com/templates \
--header 'Content-Type: text/plain' \
--data example

Compile, validate, and store a template from its source.

The compiled template is content-addressed by its SHA-256 hash, so submitting the same source twice returns the same template ID.

Media type text/plain
string

Template created

Media type application/json

Response returned when a template is successfully created.

object
template_id
required

Content-addressed ID of the stored template (base58-encoded SHA-256 of the compiled template bytes).

string
Example generated
{
"template_id": "example"
}

Compilation error

Media type application/json
object
message
required
string
Example generated
{
"message": "example"
}

Internal error

Media type application/json
object
message
required
string
Example generated
{
"message": "example"
}