Secret
post/secrets/create

Request

  • Base URL
    /v1.57 (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    none declared

Request body

Namestring

User-defined name of the secret.

Labelsobject

User-defined key/value metadata.

Datastring

Data is the data to store as a secret, formatted as a standard base64-encoded (RFC 4648) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, as defined in MaxSecretSize.

This field is only used to create a secret, and is not returned by other endpoints.

Example request

{
  "Name": "app-key.crt",
  "Labels": {
    "foo": "bar"
  },
  "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
  "Driver": {
    "Name": "secret-bucket",
    "Options": {
      "OptionA": "value for driver option A",
      "OptionB": "value for driver option B"
    }
  }
}

Response

no error

Idstring required

The id of the newly created object.

Changes

    • breaking

      removed the request body

    • breaking

      removed the success response with the status

    • info

      api tag Secret added

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status

    • breaking

      request body became required

    • breaking

      the request's body type changed from no type to object

    • breaking

      removed the success response with the status

    • warning

      removed subschema #2 from the request body allOf list

    • info

      api tag Secret removed

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the success response with the status