Skip to content

Replace a signing key with a newly imported public key

POST
/api/signing-keys/{key_id}/replace
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".

key_id
required
Key Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
Media type application/json
SigningKeyReplace

Request body for atomically replacing a key with a newly imported one.

object
confirm
Any of:
string
name
Any of:
string
>= 1 characters <= 255 characters
public_key_pem
required
Public Key Pem
string
<= 16384 characters
Example generated
{
"confirm": "example",
"name": "example",
"public_key_pem": "example"
}

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
default: generated
public_key_pem
required
Public Key Pem
string
revoked_at
Any of:
string format: date-time
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"
}
]
}