Run the format's checks on a template's source as your workspace's own, storing nothing: every problem, and how each of its tests went
POST
/v1/buyer/templates/validate
const url = 'https://example.com/v1/buyer/templates/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source":"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/v1/buyer/templates/validate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source": "example" }'Who: a workspace’s member, staff under its support access, or its key. API keys with the buyer:read or buyer:write scope.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
source
required
string
Example generated
{ "source": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
problems
required
Array<object>
object
message
required
string
path
required
string
step
required
string | null
sha256
required
string
tests
required
Array<object>
object
failures
required
Array<string>
kind
required
string
name
required
string
passed
required
boolean
path
required
string
valid
required
boolean
Example
{ "problems": [ { "step": "parse" } ]}default
Section titled “default”An error, as go-commons apperr maps it
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
Example generated
{ "error": { "code": "example", "fields": { "additionalProperty": "example" }, "message": "example" }}