Create a public key
POST
/v1/public_keys
const url = 'http://api.disclosebot.localdev:3000/v1/public_keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":{"type":"public_key","attributes":{"name":"example","short_description":"example","public_key":"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 http://api.disclosebot.localdev:3000/v1/public_keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": { "type": "public_key", "attributes": { "name": "example", "short_description": "example", "public_key": "example" } } }'Adds a public key. An X25519 key, base64 of the 32 raw bytes, can be used by transmit steps and Cloak Mode; other kinds (a PGP key) are stored for reference.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
data
required
object
type
required
string
attributes
required
object
name
required
string
short_description
string
public_key
required
string
Responses
Section titled “ Responses ”A PGP key, stored for reference
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" }}Unauthorized
Blank name or key