Home
/
API
/
Parameters

Parameters

Get parameters

Code samples

# Example request using curl
curl -X GET http://coder-server:8080/api/v2/parameters/{scope}/{id} \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

GET /parameters/{scope}/{id}

Parameters

NameInTypeRequiredDescription
scopepathstringtrueScope
idpathstring(uuid)trueID

Enumerated Values

ParameterValue
scopetemplate
scopeworkspace
scopeimport_job

Example responses

200 Response

[
  {
    "created_at": "2019-08-24T14:15:22Z",
    "destination_scheme": "none",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "scope": "template",
    "scope_id": "5d3fe357-12dd-4f62-b004-6d1fb3b8454f",
    "source_scheme": "none",
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Responses

StatusMeaningDescriptionSchema
200OKOKarray of codersdk.Parameter

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
[array item]arrayfalse[Parameter represents a set value for the scope.]
» created_atstring(date-time)false
» destination_schemecodersdk.ParameterDestinationSchemefalse
» idstring(uuid)false
» namestringfalse
» scopecodersdk.ParameterScopefalse
» scope_idstring(uuid)false
» source_schemecodersdk.ParameterSourceSchemefalse
» updated_atstring(date-time)false

Enumerated Values

PropertyValue
destination_schemenone
destination_schemeenvironment_variable
destination_schemeprovisioner_variable
scopetemplate
scopeworkspace
scopeimport_job
source_schemenone
source_schemedata

To perform this operation, you must be authenticated. Learn more.

Create parameter

Code samples

# Example request using curl
curl -X POST http://coder-server:8080/api/v2/parameters/{scope}/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

POST /parameters/{scope}/{id}

Body parameter

{
  "copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
  "destination_scheme": "none",
  "name": "string",
  "source_scheme": "none",
  "source_value": "string"
}

Parameters

NameInTypeRequiredDescription
scopepathstringtrueScope
idpathstring(uuid)trueID
bodybodycodersdk.CreateParameterRequesttrueParameter request

Enumerated Values

ParameterValue
scopetemplate
scopeworkspace
scopeimport_job

Example responses

201 Response

{
  "created_at": "2019-08-24T14:15:22Z",
  "destination_scheme": "none",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "scope": "template",
  "scope_id": "5d3fe357-12dd-4f62-b004-6d1fb3b8454f",
  "source_scheme": "none",
  "updated_at": "2019-08-24T14:15:22Z"
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreatedcodersdk.Parameter

To perform this operation, you must be authenticated. Learn more.

Delete parameter

Code samples

# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/parameters/{scope}/{id}/{name} \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

DELETE /parameters/{scope}/{id}/{name}

Parameters

NameInTypeRequiredDescription
scopepathstringtrueScope
idpathstring(uuid)trueID
namepathstringtrueName

Enumerated Values

ParameterValue
scopetemplate
scopeworkspace
scopeimport_job

Example responses

200 Response

{
  "detail": "string",
  "message": "string",
  "validations": [
    {
      "detail": "string",
      "field": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.Response

To perform this operation, you must be authenticated. Learn more.

See an opportunity to improve our docs? Make an edit.