v3

latestOpenAPI 3.0.0raw.githubusercontent.com2026-02-14107155281.0 KB

Create a secret

post/secrets/create

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](https://pkg.go.dev/github.com/moby/swarmkit/v2

Response

The request has succeeded.

Idstring required

The id of the newly created object.