EmailSchema_get
const url = 'http://localhost:3000/api/emails/schema';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/emails/schema \ --header 'Authorization: Bearer <token>'Read the schema of the editor’s document: the node and mark types, the attributes each takes and
the values allowed. The structure comes from the editor itself; the attribute types and allowed
values are the rules the server checks, so a document that follows this is not refused. Write
the document as doc on a Template, Broadcast or Automation email step.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The request has succeeded.
The editor’s document format: what an agent writes as doc
object
Version of the editor whose export code renders a document
Node types by name. A document is {"type":"doc","content":[...nodes]}
object
One node or mark type of the editor’s document
object
The content expression: which child nodes the node holds; absent for a leaf and for a mark
The group a node belongs to (block, inline); absent for a mark
The attributes the type accepts, by name. Any other attribute is refused.
object
One attribute of a node or mark in the editor’s document
object
The value the editor gives the attribute when the document omits it
The kind of value: string, integer, url, css, alignment …
The only values accepted, when the attribute is a closed set
The rule the server checks, in words: required or optional, range, form of the value
Mark types by name (bold, link …), put in a text node’s marks
object
One node or mark type of the editor’s document
object
The content expression: which child nodes the node holds; absent for a leaf and for a mark
The group a node belongs to (block, inline); absent for a mark
The attributes the type accepts, by name. Any other attribute is refused.
object
One attribute of a node or mark in the editor’s document
object
The value the editor gives the attribute when the document omits it
The kind of value: string, integer, url, css, alignment …
The only values accepted, when the attribute is a closed set
The rule the server checks, in words: required or optional, range, form of the value
Rules that hold across the document, in words
A valid document to start from
object
Example generated
{ "editorVersion": "example", "nodes": { "additionalProperty": { "content": "example", "group": "example", "attrs": { "additionalProperty": { "default": "example", "type": "example", "allowed": [ "example" ], "rule": "example" } } } }, "marks": { "additionalProperty": { "content": "example", "group": "example", "attrs": { "additionalProperty": { "default": "example", "type": "example", "allowed": [ "example" ], "rule": "example" } } } }, "rules": [ "example" ], "example": { "additionalProperty": "example" }}RFC 7807 unauthorized response
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}RFC 7807 too many requests response: a rate limit was exceeded (ADR 0025)
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}Headers
Section titled “Headers”Seconds to wait before retrying
The request budget of the window that was exceeded
Requests left in the current window
Unix time at which the window resets