Skip to Content
kosemdocs
ReferenceAPISecrets

Update secret in project

Changes a secret's alias or description, or the projects an organization's secret is shared with.

PATCH
/v1/projects/{project}/secrets/{secret}

Changes a secret's alias or description, or the projects an organization's secret is shared with.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
secret*string

The secret's ID.

Match^sec_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
alias?string

What people and software call the secret; unique in its organization or project.

Match^[a-z][a-z0-9_]*(/[a-z0-9_]+)*$
Lengthlength <= 128
availability?

For an organization's secret: the projects it's shared with. Changing it also takes secrets.secrets.setAvailability. Projects it's newly shared with have it at once, but those with a secret of their own under its alias, which have it once theirs is deleted or renamed. Those it's no longer shared with lose it at once, and their agents lose their grants and bindings of it; sharing it again gives them a new one.

description?string

What the secret is for. A shared secret's is its source's, which it may only be sent back as.

Lengthlength <= 500
etag?string

The etag of the secret as read. With one, the update fails with aborted if the secret changed since.

Response Body

OK

application/json
  1. response
alias*string

What people and software call the secret, such as stripe/secret_key; unique in its organization or project.

availability*

For an organization's secret: the projects it's shared with, which have it at once, as a secret of their own that reads its versions; stopping sharing it with a project deletes it from the project, and from its agents. A project's secret is shared with none.

createTime*string

When the secret was created.

Formatdate-time
description*string

What the secret is for. A secret its organization shares with the project shows its source's.

etag*string

Changes with each update. Send it back when updating the secret; the update fails with aborted if the secret changed in between.

latestVersion*integer

The number of the newest enabled version, which latest names; 0 when no version is enabled. A secret its organization shares with the project shows its source's.

Formatint32
name*string

Resource name, organizations/{organization_id}/secrets/{secret_id} or projects/{project_id}/secrets/{secret_id}.

source*string

For a project's secret that its organization shares with it, the organization's secret, organizations/{organization_id}/secrets/{secret_id}, whose versions it reads; empty for any other secret. Set by kosem as the organization shares the secret, and never changed.

updateTime*string

When the secret, or its versions, last changed.

Formatdate-time
Example Request
curl -X PATCH 'https://api.kosem.ai/v1/projects/string/secrets/string' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "alias": "string",
  "availability": {
    "allProjects": true,
    "projects": [
      "string"
    ]
  },
  "createTime": "2019-08-24T14:15:22Z",
  "description": "string",
  "etag": "string",
  "latestVersion": 0,
  "name": "string",
  "source": "string",
  "updateTime": "2019-08-24T14:15:22Z"
}