Replace a signing key with a newly imported public key
POST
/api/signing-keys/{key_id}/replace
const url = 'https://example.com/api/signing-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/replace?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirm":"example","name":"example","public_key_pem":"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://example.com/api/signing-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/replace?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": "example", "name": "example", "public_key_pem": "example" }'Import the new key and revoke the old one in ONE transaction.
The new key is validated first, so a bad key leaves the old one active.
Requires confirm == "delete".
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” key_id
required
Key Id
string format: uuid
Query Parameters
Section titled “ Query Parameters ” organization_id
required
Organization Id
string format: uuid
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
SigningKeyReplace
Request body for atomically replacing a key with a newly imported one.
object
Example generated
{ "confirm": "example", "name": "example", "public_key_pem": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
SigningKeyResponse
Public representation of a signing key (no private material).
object
algo
required
Algo
string
artifact_compatible
required
Artifact Compatible
False for legacy ECDSA-P384 keys, which cannot sign installable artifacts.
boolean
created_at
required
Created At
string format: date-time
fingerprint
required
Fingerprint
string
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
name
required
Name
string
origin
Origin
string
public_key_pem
required
Public Key Pem
string
Example
{ "origin": "generated"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}