Create or replace a CI secret or variable
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/test-org/ci/values/DEPLOY_KEY';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"secret","value":"example","repo":"acme/web","branches":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://dashboard.quantcdn.io/api/v3/organizations/test-org/ci/values/DEPLOY_KEY \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "secret", "value": "example", "repo": "acme/web", "branches": [ "example" ] }'Sets one value for the organisation, or for one repository when repo is set. The value is write-only for a secret: the response never carries it. The backend validates the name, the value and the limits and answers 400 with a message. Needs the cloud:write scope and the delete_applications permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation ID
Example
test-orgThe name, such as DEPLOY_KEY
Example
DEPLOY_KEYRequest Bodyrequired
Section titled “Request Bodyrequired”object
Owner/name. Lower-cased by the server. Leave out for an organisation value.
Example
acme/webOnly jobs on these branches get the value. Leave out for every branch.
Responses
Section titled “Responses”The value is saved
object
Example
{ "name": "DEPLOY_KEY", "kind": "secret", "scope": "org", "repo": "acme/web"}The name, the value or a limit is not valid
object
Example
{ "message": "Name must match ^[A-Z_][A-Z0-9_]*$."}The organisation does not have CI runners
The request body has the wrong shape
The CI values service failed
object
Examplegenerated
{ "error": "example"}GitHub is unavailable, so the repository of a repository value could not be checked. Nothing was saved. Try again after Retry-After seconds.
object
Example
{ "error": "GitHub is unavailable, so Quant could not check the repository. Nothing was saved. Try again in a minute."}Headers
Section titled “Headers”Example
30Seconds to wait before a retry
