policies_submit
POST
/policies
const url = 'https://example.com/policies';const options = {method: 'POST', headers: {'Content-Type': 'text/plain'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/policies \ --header 'Content-Type: text/plain' \ --data exampleCompile, validate, and store a policy from its source.
The compiled policy is content-addressed by the SHA-256 hash of its compiled bytecode; submitting the same source twice returns the same ID.
Request Body required
Section titled “Request Body required ” Media type text/plain
string
Responses
Section titled “ Responses ”Policy created
Media type application/json
Base58-encoded SHA-256 hash digest (32 bytes)
string
Example generated
exampleCompilation 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"}