Generate a new signing key pair
const url = 'https://example.com/api/signing-keys?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"algo":"RSA-4096","name":"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?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "algo": "RSA-4096", "name": "example" }'Generate an asymmetric key pair and persist the public side.
The private key is returned exactly once in the response body as
private_key_pem. It is never stored server-side — if lost, a new
key pair must be generated. Only RSA-4096 and ECDSA-P256 are accepted:
mender-artifact/the device agent cannot use P-384 keys.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “ Query Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”Request body for creating (generating) a new signing key pair.
The server generates the key pair; only the public half is persisted.
The private key is returned once in SigningKeyCreateResponse.
ECDSA-P384 is still parsed so the endpoint can answer with a clear
deprecation error instead of a generic schema error.
object
Key algorithm - RSA-4096 or ECDSA-P256 (ECDSA-P384 is rejected)
Human-readable key name
Responses
Section titled “ Responses ”Successful Response
Response returned once when a new key pair is generated.
Includes the PEM-encoded private key — this is the only time it is returned. The server does not persist private key material.
object
False for legacy ECDSA-P384 keys, which cannot sign installable artifacts.
PEM-encoded private key — store securely; not recoverable after this response
Example
{ "origin": "generated"}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}