Skip to main content
PATCH
/
v1
/
projects
/
secrets
/
{id}
Update a Secret
curl --request PATCH \
  --url https://api.tryhamsa.com/v1/projects/secrets/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "API_KEY_UPDATED",
  "value": "new-super-secret-value",
  "description": "Updated production API key",
  "tags": [
    "production",
    "api",
    "updated"
  ]
}
'
{
  "success": true,
  "message": "success",
  "data": {
    "id": "ed9b5601-f731-441a-8500-d9fc7610ef8f",
    "name": "API_KEY_UPDATED",
    "description": "Updated production API key",
    "tags": [
      "production",
      "api",
      "updated"
    ],
    "lastAccessedAt": null,
    "createdAt": "2024-12-15T00:00:00.000Z",
    "updatedAt": "2024-12-15T00:00:00.000Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Path Parameters

id
string
required

The ID of the secret to update.

Example:

"ed9b5601-f731-441a-8500-d9fc7610ef8f"

Body

application/json

Request body containing the fields to update

name
string

The new name for the secret.

Example:

"API_KEY_UPDATED"

value
string

The new secret value.

Example:

"new-super-secret-value"

description
string

The new description for the secret.

Example:

"Updated production API key"

tags
string[]

The new tags for the secret.

Example:
["production", "api", "updated"]

Response

Secret updated successfully

success
boolean
Example:

true

message
string
Example:

"success"

data
object