Create a Secret

Creates a new secret for the specified project. Secrets are encrypted and stored securely.

post/v1/projects/secrets

Request

  • Base URL
    https://api.tryhamsa.com
  • URL
    https://api.tryhamsa.com/v1/projects/secrets
  • Auth
    • API key in header Authorization
    • or API key in header Authorization

Request body

namestring required

The name of the secret.

valuestring required

The secret value to store.

descriptionstring

An optional description of the secret.

tagsstring[]

Optional tags to categorize the secret.

Example request

{
  "name": "API_KEY",
  "value": "super-secret-value",
  "description": "Production API key",
  "tags": [
    "production",
    "api"
  ]
}

Response

Secret created successfully

successboolean
messagestring

Example response

{
  "success": true,
  "message": "success",
  "data": {
    "id": "ed9b5601-f731-441a-8500-d9fc7610ef8f",
    "name": "API_KEY",
    "description": "Production API key",
    "tags": [
      "production",
      "api"
    ],
    "createdAt": "2024-12-15T00:00:00.000Z",
    "updatedAt": "2024-12-15T00:00:00.000Z"
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.