Skip to main content
POST
Create or update a secret key

Authorizations

Authorization
string
header
required

A Fly API token with access to the requested organization or resource. Send it as Authorization: Bearer <Fly API token>.

Path Parameters

app_name
string
required

Fly App Name

secret_name
string
required

Secret key name

Body

application/json

Create secret key request

type
string

Type of the key: hs256, hs384, hs512, xaes256gcm, nacl_auth, nacl_box, nacl_secretbox, nacl_sign, or es256. Required.

value
string<byte>

Key material, base64-encoded. Ignored when generating a key.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$

Response

Created

Version
integer

Same value as version.

Deprecated: use version.

created_at
string

When the key was first set.

name
string

Name of the secret key.

public_key
string<byte>

Public key of asymmetric keys (nacl_box, nacl_sign, es256), base64-encoded.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
type
string

Type of the key: hs256, hs384, hs512, xaes256gcm, nacl_auth, nacl_box, nacl_secretbox, nacl_sign, or es256.

updated_at
string

When the key last changed.

version
integer

The app's secrets version after this change. Pass it as min_version to read the change back.