API ReferenceEndpoints

Secret

Secret management API

MethodPathDescription
GET/api/v1/secrets/{workspace}/{secretId}/valueGet secret value
PUT/api/v1/secrets/{workspace}/{secretId}/valueSet secret value
POST/api/v1/secrets/{workspace}/pubkeyGet encryption public key
GET/api/v1/secrets/{workspace}List secrets
GET/api/v1/secrets/{workspace}/{secretId}Get secret

Get secret value

GET /api/v1/secrets/{workspace}/{secretId}/value

Get a secret's encrypted value. Client provides ephemeral public key for E2E encryption. Rate limited to 100 requests per user per workspace per hour.

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
secretIdYesSecret ID

Query Parameters

NameRequiredTypeDescription
X-Ephemeral-PubkeyYesstringBase64-encoded X25519 ephemeral public key (32 bytes)

Responses

StatusDescription
200Secret value retrieved successfully (E2E encrypted)
400Invalid or missing ephemeral public key
403Not authorized to read secret
404Secret not found or has no value
429Rate limit exceeded

Response Shape

FieldTypeDescription
encryptedValuestringBase64-encoded encrypted value (XChaCha20-Poly1305 ciphertext)
noncestringBase64-encoded 24-byte nonce used for encryption
serverPublicKeystringBase64-encoded server ephemeral X25519 public key
algorithmstringEncryption algorithm identifier

Example Response

{
  "success": true,
  "data": {
    "encryptedValue": "string",
    "nonce": "string",
    "serverPublicKey": "string",
    "algorithm": "string"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/secrets/my-workspace/<secretId>/value" \
  -H "Authorization: Bearer <your-token>"

Set secret value

PUT /api/v1/secrets/{workspace}/{secretId}/value

Set or update a secret's value using E2E encryption

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
secretIdYesSecret ID

Request Body

Content-Type: application/json

FieldTypeDescription
encryptedValuestringBase64-encoded encrypted value (XChaCha20-Poly1305 ciphertext)
noncestringBase64-encoded 24-byte nonce used for encryption
clientPublicKeystringBase64-encoded client ephemeral X25519 public key (32 bytes)
keyIdstringKey ID from /pubkey response to retrieve server's private key

Responses

StatusDescription
204Secret value set successfully
400Invalid request
403Not authorized to write secret
404Secret not found

Example

curl -X PUT "https://poliglot.io/api/v1/secrets/my-workspace/<secretId>/value" \
  -H "Authorization: Bearer <your-token>"
  -H "Content-Type: application/json" \
  -d '{}'

Get encryption public key

POST /api/v1/secrets/{workspace}/pubkey

Get server's ephemeral public key for E2E encrypting secret values. Key expires after 5 minutes.

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Responses

StatusDescription
200Public key generated successfully
404Workspace not found

Response Shape

FieldTypeDescription
serverPublicKeystringBase64-encoded server ephemeral X25519 public key (32 bytes)
keyIdstringUnique identifier to reference this key in subsequent requests
algorithmstringEncryption algorithm identifier
expiresAtstring (date-time)ISO 8601 timestamp when this key expires

Example Response

{
  "success": true,
  "data": {
    "serverPublicKey": "string",
    "keyId": "string",
    "algorithm": "string",
    "expiresAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X POST "https://poliglot.io/api/v1/secrets/my-workspace/pubkey" \
  -H "Authorization: Bearer <your-token>"

List secrets

GET /api/v1/secrets/{workspace}

List all secrets in a workspace, optionally filtered by URI prefix

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Query Parameters

NameRequiredTypeDescription
prefixNostringOptional URI prefix to filter secrets
pageNointeger(int32)Page number (0-indexed)
sizeNointeger(int32)Page size (max 100)

Responses

StatusDescription
200Secrets retrieved successfully
403Not authorized to read workspace
404Workspace not found

Response Shape

FieldTypeDescription
idstring (uuid)Secret ID
uristringSecret URI identifier
descriptionstringHuman-readable description of the secret
hasValuebooleanWhether the secret has a value set
createdAtstring (date-time)When the secret was created
updatedAtstring (date-time)When the secret was last updated
lastAccessedAtstring (date-time)When the secret value was last accessed
accessCountinteger (int64)Number of times the secret value has been accessed
matrixMatrixResponseResponse object containing complete matrix metadata

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "description": "string",
    "hasValue": true,
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z",
    "lastAccessedAt": "2025-03-28T14:22:03Z",
    "accessCount": 0,
    "matrix": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "uri": "string",
      "name": "string",
      "description": "string",
      "repositoryUrl": "string",
      "imports": [
        {
          "id": null,
          "uri": null,
          "name": null
        }
      ],
      "importedBy": [
        {
          "id": null,
          "uri": null,
          "name": null
        }
      ],
      "packageInfo": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "string",
        "currentVersion": "string"
      },
      "createdAt": "2025-03-28T14:22:03Z",
      "updatedAt": "2025-03-28T14:22:03Z",
      "prefixDeclarations": [
        {
          "prefix": null,
          "namespaceUri": null
        }
      ]
    }
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/secrets/my-workspace" \
  -H "Authorization: Bearer <your-token>"

Get secret

GET /api/v1/secrets/{workspace}/{secretId}

Get a secret's metadata by ID

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
secretIdYesSecret ID

Responses

StatusDescription
200Secret retrieved successfully
403Not authorized to read secret
404Secret not found

Response Shape

FieldTypeDescription
idstring (uuid)Secret ID
uristringSecret URI identifier
descriptionstringHuman-readable description of the secret
hasValuebooleanWhether the secret has a value set
createdAtstring (date-time)When the secret was created
updatedAtstring (date-time)When the secret was last updated
lastAccessedAtstring (date-time)When the secret value was last accessed
accessCountinteger (int64)Number of times the secret value has been accessed
matrixMatrixResponseResponse object containing complete matrix metadata

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "description": "string",
    "hasValue": true,
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z",
    "lastAccessedAt": "2025-03-28T14:22:03Z",
    "accessCount": 0,
    "matrix": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "uri": "string",
      "name": "string",
      "description": "string",
      "repositoryUrl": "string",
      "imports": [
        {
          "id": null,
          "uri": null,
          "name": null
        }
      ],
      "importedBy": [
        {
          "id": null,
          "uri": null,
          "name": null
        }
      ],
      "packageInfo": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "string",
        "currentVersion": "string"
      },
      "createdAt": "2025-03-28T14:22:03Z",
      "updatedAt": "2025-03-28T14:22:03Z",
      "prefixDeclarations": [
        {
          "prefix": null,
          "namespaceUri": null
        }
      ]
    }
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/secrets/my-workspace/<secretId>" \
  -H "Authorization: Bearer <your-token>"

On this page