Set a variable
PUT
Sets it on the project, an environment or a service, replacing one of the same name in that scope. The narrowest scope wins at deploy. Takes effect at the next deployment.
bearerheader
AuthorizationBearer <token>An API key (opk_…) or a CLI token (opc_…).
projectId*stringname*stringLetters, digits and underscores, not starting with a digit.
application/json- body
value*stringLength
length <= 65536secret?booleanSealed and never shown again; only deploys use it.
environmentId?|Set it for one environment only.
serviceId?|Set it for one service only.
Set a variable
application/json- response
id*stringFormat
uuidprojectId*stringFormat
uuidenvironmentId*|nullserviceId*|nullname*stringsecret*booleanvalue*|Null for a secret: its value is never read back.
updatedAt*stringFormat
date-timecurl -X PUT "https://openpanel.sh/api/v1/projects/$PROJECT_ID/variables/$NAME" \ -H "Authorization: Bearer $OPENPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "value": "string"}'Example response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8", "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563", "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9", "name": "string", "secret": true, "value": "string", "updatedAt": "2019-08-24T14:15:22Z"}