Fly Io Secrets API

The Secrets API from Fly Io — 9 operation(s) for secrets.

Operations 14

GET /v1/apps/{app_name}/secretkeys List secret keys belonging to an app #
GET /v1/apps/{app_name}/secretkeys/{secret_name} Get an app's secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name} Create or update a secret key #
DELETE /v1/apps/{app_name}/secretkeys/{secret_name} Delete an app's secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name}/decrypt Decrypt with a secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name}/encrypt Encrypt with a secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name}/generate Generate a random secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name}/sign Sign with a secret key #
POST /v1/apps/{app_name}/secretkeys/{secret_name}/verify Verify with a secret key #
GET /v1/apps/{app_name}/secrets List app secrets belonging to an app #
POST /v1/apps/{app_name}/secrets Update app secrets belonging to an app #
GET /v1/apps/{app_name}/secrets/{secret_name} Get an app secret #
POST /v1/apps/{app_name}/secrets/{secret_name} Create or update Secret #
DELETE /v1/apps/{app_name}/secrets/{secret_name} Delete an app secret #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/fly-io:fly-io-secrets-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

fly-io-secrets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Machines Secrets API
  description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete Machines API docs for how to get started, more information about each endpoint, parameter descriptions, and examples.
  contact: {}
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
- url: https://api.machines.dev
security:
- FlyBearerAuth: []
tags:
- name: Secrets
paths:
  /v1/apps/{app_name}/secretkeys:
    get:
      tags:
      - Secrets
      summary: List secret keys belonging to an app
      operationId: Secretkeys_list
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      - name: types
        in: query
        description: Comma-seperated list of secret keys to list
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretKeys'
  /v1/apps/{app_name}/secretkeys/{secret_name}:
    get:
      tags:
      - Secrets
      summary: Get an app's secret key
      operationId: Secretkey_get
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretKey'
    post:
      tags:
      - Secrets
      summary: Create or update a secret key
      operationId: Secretkey_set
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      requestBody:
        description: Create secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetSecretkeyRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetSecretkeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
    delete:
      tags:
      - Secrets
      summary: Delete an app's secret key
      operationId: Secretkey_delete
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteSecretkeyResponse'
  /v1/apps/{app_name}/secretkeys/{secret_name}/decrypt:
    post:
      tags:
      - Secrets
      summary: Decrypt with a secret key
      operationId: Secretkey_decrypt
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      requestBody:
        description: Decrypt with secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecryptSecretkeyRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecryptSecretkeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secretkeys/{secret_name}/encrypt:
    post:
      tags:
      - Secrets
      summary: Encrypt with a secret key
      operationId: Secretkey_encrypt
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      requestBody:
        description: Encrypt with secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EncryptSecretkeyRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EncryptSecretkeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secretkeys/{secret_name}/generate:
    post:
      tags:
      - Secrets
      summary: Generate a random secret key
      operationId: Secretkey_generate
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      requestBody:
        description: generate secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetSecretkeyRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetSecretkeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secretkeys/{secret_name}/sign:
    post:
      tags:
      - Secrets
      summary: Sign with a secret key
      operationId: Secretkey_sign
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      requestBody:
        description: Sign with secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignSecretkeyRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignSecretkeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secretkeys/{secret_name}/verify:
    post:
      tags:
      - Secrets
      summary: Verify with a secret key
      operationId: Secretkey_verify
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: Secret key name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      requestBody:
        description: Verify with secret key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifySecretkeyRequest'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secrets:
    get:
      tags:
      - Secrets
      summary: List app secrets belonging to an app
      operationId: Secrets_list
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      - name: show_secrets
        in: query
        description: Show the secret values.
        schema:
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppSecrets'
    post:
      tags:
      - Secrets
      summary: Update app secrets belonging to an app
      description: 'Running Machines don''t pick up the change on their own: create or update Machines with `min_secrets_version` set to the returned `version` for them to see it.'
      operationId: Secrets_update
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      requestBody:
        description: Update app secret request, with values to set, or nil to unset
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppSecretsUpdateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppSecretsUpdateResp'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
  /v1/apps/{app_name}/secrets/{secret_name}:
    get:
      tags:
      - Secrets
      summary: Get an app secret
      operationId: Secret_get
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: App secret name
        required: true
        schema:
          type: string
      - name: min_version
        in: query
        description: Minimum secrets version to return. Returned when setting a new secret
        schema:
          type: string
      - name: show_secrets
        in: query
        description: Show the secret value.
        schema:
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppSecret'
    post:
      tags:
      - Secrets
      summary: Create or update Secret
      description: 'Running Machines don''t pick up the change on their own: create or update Machines with `min_secrets_version` set to the returned `version` for them to see it.'
      operationId: Secret_create
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: App secret name
        required: true
        schema:
          type: string
      requestBody:
        description: Create app secret request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetAppSecretRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetAppSecretResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codegen-request-body-name: request
    delete:
      tags:
      - Secrets
      summary: Delete an app secret
      description: 'Running Machines don''t pick up the change on their own: create or update Machines with `min_secrets_version` set to the returned `version` for them to see it.'
      operationId: Secret_delete
      parameters:
      - name: app_name
        in: path
        description: Fly App Name
        required: true
        schema:
          type: string
      - name: secret_name
        in: path
        description: App secret name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteAppSecretResponse'
components:
  schemas:
    AppSecretsUpdateResp:
      type: object
      properties:
        Version:
          type: integer
          description: DEPRECATED
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/AppSecret'
        version:
          type: integer
          description: 'The app''s secrets version after this change. Pass it as `min_secrets_version` when creating or

            updating Machines so that they are guaranteed to see the change.'
    SetAppSecretRequest:
      type: object
      properties:
        value:
          type: string
    DecryptSecretkeyRequest:
      type: object
      properties:
        associated_data:
          type: array
          items:
            type: integer
        ciphertext:
          type: array
          items:
            type: integer
    AppSecretsUpdateRequest:
      type: object
      properties:
        values:
          type: object
          additionalProperties:
            type: string
    EncryptSecretkeyResponse:
      type: object
      properties:
        ciphertext:
          type: array
          items:
            type: integer
    SetSecretkeyResponse:
      type: object
      properties:
        Version:
          type: integer
          description: DEPRECATED
        created_at:
          type: string
        name:
          type: string
        public_key:
          type: array
          items:
            type: integer
        type:
          type: string
        updated_at:
          type: string
        version:
          type: integer
    SetSecretkeyRequest:
      type: object
      properties:
        type:
          type: string
        value:
          type: array
          items:
            type: integer
    SignSecretkeyRequest:
      type: object
      properties:
        plaintext:
          type: array
          items:
            type: integer
    AppSecrets:
      type: object
      properties:
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/AppSecret'
    main.statusCode:
      type: string
      enum:
      - unknown
      - insufficient_capacity
      - volume_placement_capacity
      - name_taken
      x-enum-varnames:
      - unknown
      - capacityErr
      - volumePlacementCapacityErr
      - nameTakenErr
    SecretKeys:
      type: object
      properties:
        secret_keys:
          type: array
          items:
            $ref: '#/components/schemas/SecretKey'
    AppSecret:
      type: object
      properties:
        created_at:
          type: string
        digest:
          type: string
        name:
          type: string
        updated_at:
          type: string
        value:
          type: string
    ErrorResponse:
      type: object
      properties:
        details:
          type: object
          description: Deprecated
        error:
          type: string
        status:
          $ref: '#/components/schemas/main.statusCode'
    SetAppSecretResponse:
      type: object
      properties:
        Version:
          type: integer
          description: DEPRECATED
        created_at:
          type: string
        digest:
          type: string
        name:
          type: string
        updated_at:
          type: string
        value:
          type: string
        version:
          type: integer
          description: 'The app''s secrets version after this change. Pass it as `min_secrets_version` when creating or

            updating Machines so that they are guaranteed to see the change.'
    SignSecretkeyResponse:
      type: object
      properties:
        signature:
          type: array
          items:
            type: integer
    DeleteAppSecretResponse:
      type: object
      properties:
        Version:
          type: integer
          description: DEPRECATED
        version:
          type: integer
          description: 'The app''s secrets version after this change. Pass it as `min_secrets_version` when creating or

            updating Machines so that they are guaranteed to see the change.'
    DecryptSecretkeyResponse:
      type: object
      properties:
        plaintext:
          type: array
          items:
            type: integer
    SecretKey:
      type: object
      properties:
        created_at:
          type: string
        name:
          type: string
        public_key:
          type: array
          items:
            type: integer
        type:
          type: string
        updated_at:
          type: string
    DeleteSecretkeyResponse:
      type: object
      properties:
        Version:
          type: integer
          description: DEPRECATED
        version:
          type: integer
    EncryptSecretkeyRequest:
      type: object
      properties:
        associated_data:
          type: array
          items:
            type: integer
        plaintext:
          type: array
          items:
            type: integer
    VerifySecretkeyRequest:
      type: object
      properties:
        plaintext:
          type: array
          items:
            type: integer
        signature:
          type: array
          items:
            type: integer
  securitySchemes:
    FlyBearerAuth:
      type: http
      scheme: bearer
      description: 'A Fly API token with access to the requested organization or resource. Send it as `Authorization: Bearer <Fly API token>`.'
externalDocs:
  url: https://fly.io/docs/machines/working-with-machines/
x-original-swagger-version: '2.0'
x-provenance:
  method: harvested
  publisher: Fly Io
  source: https://fly.io/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)