Enrol a node with a one-time enrolment code
POST
/api/v1/nodes/enroll
const url = 'https://deck.example.com/api/v1/nodes/enroll';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example","name":"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://deck.example.com/api/v1/nodes/enroll \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "name": "example" }'Authorizations
Section titled “Authorizations”- None
Request Bodyrequired
Section titled “Request Bodyrequired”quietdeck node enroll <code>.
Media typeapplication/json
quietdeck node enroll <code>.
object
code
required
string
name
required
The machine’s name on the deck: letters, digits, dots, dashes and underscores.
string
Example generated
{ "code": "example", "name": "example"}Responses
Section titled “Responses”Media typeapplication/json
object
node
required
string
token
required
Shown once. The node keeps it in a file only its user can read.
string
Example generated
{ "node": "example", "token": "example"}default
Section titled “default”An error, with its message.
Media typeapplication/json
Every error the REST API returns, with an HTTP status.
object
error
required
string
Example generated
{ "error": "example"}