Secrets

Core Instance Secrets

Secrets from a core instance with backward pagination.

GEThttps://cloud-api.calyptia.com/v1/core_instances/{coreInstanceID}/secrets
Authorization
Path parameters
coreInstanceID*string (uuid)
Query parameters
Response

OK

Body
items*array of CoreInstanceSecret (object)
endCursor*nullable string
count*integer (int32)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/core_instances/{coreInstanceID}/secrets', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "coreInstanceID": "123e4567-e89b-12d3-a456-426614174000",
      "key": "mysecret",
      "value": "Ynl0ZXM=",
      "createdAt": "2024-10-06T10:36:25.674Z",
      "updatedAt": "2024-10-06T10:36:25.674Z"
    }
  ],
  "endCursor": "text"
}

Create Core Instance Secret

Create a new secret within a core instance. The secret will be created with the given name and content. If encypted is set to true, the secret will be encrypted using the core instance's encryption key. The name must be unique among all secrets within the core instance.

POSThttps://cloud-api.calyptia.com/v1/core_instances/{coreInstanceID}/secrets
Authorization
Path parameters
coreInstanceID*string (uuid)
Body
key*string
Example: "mysecret"
value*string (byte)

The value of the secret in base 64 format.

Response

Created

Body
id*string (uuid)
createdAt*string (date-time)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/core_instances/{coreInstanceID}/secrets', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "key": "mysecret",
      "value": "Ynl0ZXM="
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2024-10-06T10:36:25.674Z"
}