Add or change a person
const url = 'http://127.0.0.1:7700/api/people';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Rosa Delgado","role":"approver","title":"Controller","limitCents":5000000,"approvesFor":["Controller"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:7700/api/people \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Rosa Delgado", "role": "approver", "title": "Controller", "limitCents": 5000000, "approvesFor": [ "Controller" ] }'Preview. For an admin or the owner; only the owner adds or changes an owner. With the id of someone
who exists, the fields you send change and the rest stay. An approver needs limitCents.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Optional for a new person: made from the first name.
owner everything an admin may, plus the owner’s controls. admin people, the policy, pairing
phones and the kill switch. approver answers what the policy sends to them, up to limitCents.
requester starts tasks and sees their own requests. auditor reads everything and changes nothing.
The most this person may approve, in US cents. null for no limit.
Names the policy uses, such as Controller.
Example
{ "name": "Rosa Delgado", "role": "approver", "title": "Controller", "limitCents": 5000000, "approvesFor": [ "Controller" ]}Responses
Section titled “Responses”The person.
object
owner everything an admin may, plus the owner’s controls. admin people, the policy, pairing
phones and the kill switch. approver answers what the policy sends to them, up to limitCents.
requester starts tasks and sees their own requests. auditor reads everything and changes nothing.
The most this person may approve, in US cents. null for no limit.
The names in the policy this person approves for.
Their work address from a sign-in. Kept in the box’s state only
Example
{ "id": "rosa", "role": "owner"}A bad field, with the reason.
object
What went wrong
Example generated
{ "error": "example"}The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.
object
What went wrong
Example
{ "error": "only this computer's own screen or the owner's paired device can do this"}