Share feedback
Answers are generated based on the documentation.

Experimental

UpdateSecret replaces secret metadata and material.

PUT/v1/secrets/{secret}

UpdateSecret replaces secret metadata and material.

Returns unimplemented when this operation is unavailable. Support does not grant permission.

Connection and access

API connection and authentication guidance

https://connect.docker.com/sandboxes — The API base URL. Append the /v1 paths while preserving this URL's path prefix.

Use one of these alternatives. Requirements within an alternative apply together.

  • bearer

Parameters

secret path Required

The secret id.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

Idempotency-Key header

Replay key. Reusing it with a different payload fails with failedPrecondition; accepted keys are retained for at least 24 hours.

Type: string

Idempotency key. A replay returns the first result; the same key with a different payload fails with FAILED_PRECONDITION; retained at least 24 hours.
All schema constraints and annotations
{
  "description": "Idempotency key. A replay returns the first result; the same key with a different payload fails with FAILED_PRECONDITION; retained at least 24 hours.",
  "title": "Idempotency-Key",
  "type": "string"
}

If-Match header Required

The complete quoted strong entity-tag observed on the resource, including its quotes. Every mutation of an existing resource requires it: an absent value answers 428 and a stale one 412, each carrying failedPrecondition in the body.

Type: string

etag is the required precondition, the value the target's last read returned. An absent one refuses etag_required and a stale one etag_mismatch.
All schema constraints and annotations
{
  "description": "etag is the required precondition, the value the target's last read returned.\nAn absent one refuses etag_required and a stale one etag_mismatch.",
  "title": "If-Match",
  "type": "string"
}

Request and responses

Request

application/json

Schema: UpdateSecretBody

Response 200

Success

application/json

Headers

ETag

The etag of the resource this response carries, which the next mutation of it sends as If-Match.

{
  "description": "The etag of the resource this response carries, which the next mutation of it sends as If-Match.",
  "schema": {
    "type": "string"
  }
}

Schema: Secret

Response 409

The Idempotency-Key was already used with a different payload.

application/json

Schema: Error

failedPrecondition

{
  "code": "failedPrecondition",
  "message": "The Idempotency-Key was already used with a different payload."
}

Response 412

The precondition is not the resource's current etag. The body carries failedPrecondition naming etag_mismatch and an EtagMismatch detail with the current value.

application/json

Schema: Error

etag_mismatch

{
  "code": "failedPrecondition",
  "details": [
    {
      "@type": "type.googleapis.com/docker.sandboxes.v1.EtagMismatch",
      "currentEtag": "v2"
    }
  ],
  "message": "etag_mismatch: The precondition is not the resource's current etag. The body carries failedPrecondition naming etag_mismatch and an EtagMismatch detail with the current value."
}

Response 428

No precondition was sent. The body carries failedPrecondition naming etag_required.

application/json

Schema: Error

etag_required

{
  "code": "failedPrecondition",
  "message": "etag_required: No precondition was sent. The body carries failedPrecondition naming etag_required."
}

Response 501

This operation is not available on this service.

application/json

Schema: Error

unimplemented

{
  "code": "unimplemented",
  "message": "This operation is not available on this service."
}

Response default

The structured Error body identifies the failure with a stable code and optional typed details.

application/json

Schema: Error

Schema example

{
  "code": "notFound",
  "details": [],
  "message": "sandbox not found"
}

Referenced schemas

#/components/schemas/Error

#/components/schemas/Secret

#/components/schemas/UpdateSecretBody

Complete operation contract
{
  "description": "UpdateSecret replaces secret metadata and material.\n\nReturns unimplemented when this operation is unavailable. Support does not grant permission.",
  "operationId": "updateSecret",
  "parameters": [
    {
      "description": "The secret id.",
      "in": "path",
      "name": "secret",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Replay key. Reusing it with a different payload fails with failedPrecondition; accepted keys are retained for at least 24 hours.",
      "in": "header",
      "name": "Idempotency-Key",
      "schema": {
        "description": "Idempotency key. A replay returns the first result; the same key with a different payload fails with FAILED_PRECONDITION; retained at least 24 hours.",
        "title": "Idempotency-Key",
        "type": "string"
      }
    },
    {
      "description": "The complete quoted strong entity-tag observed on the resource, including its quotes. Every mutation of an existing resource requires it: an absent value answers 428 and a stale one 412, each carrying failedPrecondition in the body.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "description": "etag is the required precondition, the value the target's last read returned.\nAn absent one refuses etag_required and a stale one etag_mismatch.",
        "title": "If-Match",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UpdateSecretBody"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Secret"
          }
        }
      },
      "description": "Success",
      "headers": {
        "ETag": {
          "description": "The etag of the resource this response carries, which the next mutation of it sends as If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "409": {
      "content": {
        "application/json": {
          "examples": {
            "failedPrecondition": {
              "summary": "The Idempotency-Key was already used with a different payload.",
              "value": {
                "code": "failedPrecondition",
                "message": "The Idempotency-Key was already used with a different payload."
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The Idempotency-Key was already used with a different payload."
    },
    "412": {
      "content": {
        "application/json": {
          "examples": {
            "etag_mismatch": {
              "summary": "The precondition is not the resource's current etag. The body carries failedPrecondition naming etag_mismatch and an EtagMismatch detail with the current value.",
              "value": {
                "code": "failedPrecondition",
                "details": [
                  {
                    "@type": "type.googleapis.com/docker.sandboxes.v1.EtagMismatch",
                    "currentEtag": "v2"
                  }
                ],
                "message": "etag_mismatch: The precondition is not the resource's current etag. The body carries failedPrecondition naming etag_mismatch and an EtagMismatch detail with the current value."
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The precondition is not the resource's current etag. The body carries failedPrecondition naming etag_mismatch and an EtagMismatch detail with the current value."
    },
    "428": {
      "content": {
        "application/json": {
          "examples": {
            "etag_required": {
              "summary": "No precondition was sent. The body carries failedPrecondition naming etag_required.",
              "value": {
                "code": "failedPrecondition",
                "message": "etag_required: No precondition was sent. The body carries failedPrecondition naming etag_required."
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "No precondition was sent. The body carries failedPrecondition naming etag_required."
    },
    "501": {
      "content": {
        "application/json": {
          "examples": {
            "unimplemented": {
              "summary": "This operation is not available on this service.",
              "value": {
                "code": "unimplemented",
                "message": "This operation is not available on this service."
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "This operation is not available on this service."
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The structured Error body identifies the failure with a stable code and optional typed details."
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "summary": "UpdateSecret replaces secret metadata and material.",
  "tags": [
    "Secrets"
  ],
  "x-sbx-authenticated-only": false,
  "x-sbx-conditional-permissions": [],
  "x-sbx-error-responses": [
    {
      "code": "UNIMPLEMENTED",
      "description": "This operation is not available on this service."
    },
    {
      "code": "FAILED_PRECONDITION",
      "description": "The Idempotency-Key was already used with a different payload."
    }
  ],
  "x-sbx-plane": "control",
  "x-sbx-required-permissions": [
    "secretsWrite"
  ],
  "x-sbx-serving-surface": "management"
}