Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --request POST \ --url https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "type": "<string>", "value": "aSDinaTvuI8gbWludGxpZnk=" } '
import requests url = "https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate" payload = { "type": "<string>", "value": "aSDinaTvuI8gbWludGxpZnk=" } headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text)
const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({type: '<string>', value: 'aSDinaTvuI8gbWludGxpZnk='}) }; fetch('https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'type' => '<string>', 'value' => 'aSDinaTvuI8gbWludGxpZnk=' ]), CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>", "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate" payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"value\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) }
HttpResponse<String> response = Unirest.post("https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .body("{\n \"type\": \"<string>\",\n \"value\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}") .asString();
require 'uri' require 'net/http' url = URI("https://api.machines.dev/v1/apps/{app_name}/secretkeys/{secret_name}/generate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer <token>' request["Content-Type"] = 'application/json' request.body = "{\n \"type\": \"<string>\",\n \"value\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}" response = http.request(request) puts response.read_body
{ "Version": 123, "created_at": "<string>", "name": "<string>", "public_key": "aSDinaTvuI8gbWludGxpZnk=", "type": "<string>", "updated_at": "<string>", "version": 123 }
{ "details": {}, "error": "<string>", "status": "<unknown>" }
A Fly API token with access to the requested organization or resource. Send it as Authorization: Bearer <Fly API token>.
Authorization: Bearer <Fly API token>
Fly App Name
Secret key name
generate secret key request
Type of the key: hs256, hs384, hs512, xaes256gcm, nacl_auth, nacl_box, nacl_secretbox, nacl_sign, or es256. Required.
hs256
hs384
hs512
xaes256gcm
nacl_auth
nacl_box
nacl_secretbox
nacl_sign
es256
Key material, base64-encoded. Ignored when generating a key.
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
Created
Same value as version.
version
Deprecated: use version.
When the key was first set.
Name of the secret key.
Public key of asymmetric keys (nacl_box, nacl_sign, es256), base64-encoded.
Type of the key: hs256, hs384, hs512, xaes256gcm, nacl_auth, nacl_box, nacl_secretbox, nacl_sign, or es256.
When the key last changed.
The app's secrets version after this change. Pass it as min_version to read the change back.
min_version