Update, retire, or reinstate a public key
PATCH
/v1/public_keys/{id}
const url = 'http://api.disclosebot.localdev:3000/v1/public_keys/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":{"type":"public_key","attributes":{"name":"example","short_description":"example","retired":true}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://api.disclosebot.localdev:3000/v1/public_keys/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": { "type": "public_key", "attributes": { "name": "example", "short_description": "example", "retired": true } } }'Renames the key or changes its description; retired: true retires it and retired: false reinstates it. Retiring is refused while a brief uses the key for Cloak Mode or an enabled channel encrypts with it. The key material cannot be changed over the API.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
data
required
object
type
required
string
attributes
required
object
name
string
short_description
string
retired
True retires the key, false reinstates it. The key material cannot be changed over the API.
boolean
Responses
Section titled “ Responses ”Reinstated and renamed; key material in the request is ignored
Media type application/json
object
data
required
object
id
required
string format: uuid
type
required
string
attributes
required
object
name
required
string
short_description
string
public_key
required
The key material. An X25519 key (base64 of the 32 raw bytes) can be used for encryption and cloaking; a PGP key is stored for reference.
string
retired
required
A retired key is not offered for new encryption or cloaking; what was encrypted to it keeps its link
boolean
retired_at
string format: date-time
created_at
required
string format: date-time
updated_at
required
string format: date-time
relationships
object
Example
{ "data": { "type": "public_key" }}The key is in use by an enabled channel