Compute

Preview — pending review

This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.

Export key pair material as a downloadable PEM artifact

POST
/scopes/{scopeId}/compute/key-pairs/{keyPairId}/exports

Produces a downloadable PEM artifact for the selected key pair, backing the "Download .pem" button shown in the key pair creation form. The exportable artifact is the public key material (artifact: public-key-pem), returned inline as a KeyPairExport with the suggested fileName, contentType and PEM content. Private key material is NOT exportable through this endpoint: the private key is revealed exactly once in the create response (the UI downloads it client-side at generation time) and is never persisted by the platform, so artifact: private-key-pem is always rejected. Validation: scopeId must be accessible to the caller (404 when unknown); keyPairId must identify a key pair within that scope (404 NOT_FOUND); artifact must be one of public-key-pem | private-key-pem (422 VALIDATION_FAILED on unknown values); requests for private-key-pem map to 409 CONFLICT because the material is not retained server-side. Async & state: Synchronous command returning 200 with the export payload; requested data is returned without mutating the resource and no SSE frames are emitted. Errors: 401 unauthenticated; 403 caller lacks a read-capable role (owner|admin|contributor|reader) on the scope; 404 unknown scopeId/keyPairId; 409 private key material requested but not retained; 422 unknown artifact; 500 export rendering failure. Idempotency/Concurrency: This operation does not use Idempotency-Key; it may be omitted and a sent one is ignored. The export is derived purely from stored public material, so repeated calls return the identical payload and are inherently safe.

Authorization

bearerToken
headerAuthorizationBearer <token>

An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.

Path Parameters

scopeId*string

Opaque ownership+authorization scope resolving to tenant + subscription + project.

keyPairId*string

Identifier of the key pair within the active scope.

Request Body

application/json
  1. body

Selector for the key pair export artifact.

artifact*string

public-key-pem exports the stored public material; private-key-pem is always rejected with 409 because private keys are revealed once at creation and never retained.

Value in"public-key-pem""private-key-pem"

Response Body

PEM export of the key pair's public material (private keys are never exportable).

application/json
  1. response

Inline PEM export of key pair public material.

fileName*string

Suggested file name (e.g. "prod-key.pem").

contentType*string

MIME type of the exported artifact (application/x-pem-file).

content*string

PEM-encoded public key material.

curl -X POST "https://example.com/scopes/string/compute/key-pairs/string/exports" \  -H "Content-Type: application/json" \  -d '{    "artifact": "public-key-pem"  }'
{  "fileName": "string",  "contentType": "string",  "content": "string"}