Secrets /
Update secret
Required permission
Project > Secrets > General > Update
Path parameters
projectId
string requiredID of the project
secretId
string requiredID of the secret
Request body
- {object}
description
stringA description of the secret.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$priority
integerThe priority with which different secrets will be merged.
min0max100restrictions
{object}Restriction settings of the secret
restricted
booleanIs the secret restricted
nfObjects
[array]List of Northflank services & jobs the secret is restricted to
- {object}
id
string requiredID of the entity the secret is restricted to.
pattern^[A-Za-z0-9-]+$type
string requiredType of the entity the secret is restricted to.
one ofservice, jobaddonDependencies
[array]An array of addons to link to this secret group. If provided, this will overwrite any existing linked addons.
- {object}
An object containing data about the addon to link.
addonId
string requiredThe internal id of the addon to link.
pattern^[A-Za-z0-9-]+$keys
[array] requiredAn array of objects containing details about the keys to link to this secret group.
- {object}
Details about the key to link to this secret group.
keyName
string requiredThe name of the key to link.
aliases
[array]An array of aliases for the key.
- string
The name of the alias. Keys must only contain letters and numbers separated with underscores, may not start with a number
pattern^[a-zA-Z_][a-zA-Z0-9_]*$ secretType
stringThe type of the created secret
one ofenvironment-arguments, environment, argumentssecrets
{object}variables
{object}Secret variables as JSON object, encrypted at rest. Keys must only contain letters and numbers separated with underscores, may not start with a number
files
{object}Secret files as JSON object, encrypted at rest. File path must be absolute
Response body
- {object}
Response object.
data
{object} requiredResult data.
POST /v1/projects/{projectId}/secrets/{secretId}
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"description":"A description","priority":10,"restrictions":{"restricted":true,"nfObjects":[{"id":"example-service","type":"service"}]},"addonDependencies":[{"addonId":"example-addon","keys":[{"keyName":"username","aliases":["MONGO_USERNAME"]}]}],"secretType":"environment","secrets":{"variables":{"NODE_ENV":"production","MONGO_DB":"some_connection_string"},"files":{"/dir/fileName":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}}}}' \
http://api.northflank.com/v1/projects/{projectId}/secrets/{secretId}
Example response
200 OK
JSON
{
"data": {}
}