Skip to content
Skip to Content
Coder Docs

Get a user secret by name

GET
/api/v2/users/{user}/secrets/{name}

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID, username, or me

name*string

Secret name

Response Body

OK

application/json
  1. response
created_at?string
Formatdate-time
description?string
enabled?boolean

Enabled 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?string
file_path?string
id?string
Formatuuid
name?string
updated_at?string
Formatdate-time

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/users/{user}/secrets/{name}" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "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"}