Import user secrets from a file
POST
CoderSessionTokenheader
Coder-Session-Token<token>user*stringUser ID, username, or me
Import secrets request
application/json- body
content*stringformat*codersdk.SecretsFileFormatValue in
"env""json""yaml"Created
application/json- response
[index: integer]?The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X POST \ "$CODER_URL/api/v2/users/{user}/secrets/batch" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": "string", "format": "env"}'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" }]