chore: correct template API docs (#19228)

This commit is contained in:
Phorcys
2025-08-19 15:14:25 +00:00
committed by GitHub
parent 655377165b
commit b6abcba942
5 changed files with 312 additions and 17 deletions
+45 -5
View File
@@ -955,7 +955,7 @@ Status Code **200**
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get template metadata by ID
## Get template settings by ID
### Code samples
@@ -1086,24 +1086,64 @@ curl -X DELETE http://coder-server:8080/api/v2/templates/{template} \
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Update template metadata by ID
## Update template settings by ID
### Code samples
```shell
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`PATCH /templates/{template}`
> Body parameter
```json
{
"activity_bump_ms": 0,
"allow_user_autostart": true,
"allow_user_autostop": true,
"allow_user_cancel_workspace_jobs": true,
"autostart_requirement": {
"days_of_week": [
"monday"
]
},
"autostop_requirement": {
"days_of_week": [
"monday"
],
"weeks": 0
},
"cors_behavior": "simple",
"default_ttl_ms": 0,
"deprecation_message": "string",
"description": "string",
"disable_everyone_group_access": true,
"display_name": "string",
"failure_ttl_ms": 0,
"icon": "string",
"max_port_share_level": "owner",
"name": "string",
"require_active_version": true,
"time_til_dormant_autodelete_ms": 0,
"time_til_dormant_ms": 0,
"update_workspace_dormant_at": true,
"update_workspace_last_used_at": true,
"use_classic_parameter_flow": true
}
```
### Parameters
| Name | In | Type | Required | Description |
|------------|------|--------------|----------|-------------|
| `template` | path | string(uuid) | true | Template ID |
| Name | In | Type | Required | Description |
|------------|------|----------------------------------------------------------------------|----------|---------------------------------|
| `template` | path | string(uuid) | true | Template ID |
| `body` | body | [codersdk.UpdateTemplateMeta](schemas.md#codersdkupdatetemplatemeta) | true | Patch template settings request |
### Example responses