Create a new user secret
POST
CoderSessionTokenheader
Coder-Session-Token<token>user*stringUser ID, username, or me
Create secret request
application/json- body
description?stringenabled?booleanenv_name?stringfile_path?stringname?stringvalue?stringCreated
application/json- response
created_at?stringFormat
date-timedescription?stringenabled?booleanEnabled controls whether the secret is injected into workspaces. Disabled secrets remain visible and editable, but are not added to the agent manifest, so they are not exposed as environment variables or written to secret files.
env_name?stringfile_path?stringid?stringFormat
uuidname?stringupdated_at?stringFormat
date-timeThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X POST \ "$CODER_URL/api/v2/users/{user}/secrets" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "description": "string", "enabled": true, "env_name": "string"}'Example Response
{ "created_at": "2019-08-24T14:15:22Z", "description": "string", "enabled": true, "env_name": "string", "file_path": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "updated_at": "2019-08-24T14:15:22Z"}