Docs
Templates

Update a template

PATCH
/v1/templates/{id}

Authorization

BearerAuth
AuthorizationBearer <token>

API key (csk_live_…)

In: header

Path Parameters

id*string

Template ID or slug

Request Body

application/json

name?string

Human-readable template name

Length1 <= length <= 100
description?|

Template description (null to clear)

envVars?

Environment variables (KEY=value pairs)

guardrails?

Default guardrails for runs using this template

egressDomains?array<>

Allowed egress domains for network access

Itemsitems <= 20

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.cospec.io/v1/templates/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "template": {
    "id": "string",
    "slug": "string",
    "name": "string",
    "description": "string",
    "baseImage": "node-22",
    "envVars": {
      "property1": "string",
      "property2": "string"
    },
    "guardrails": {
      "maxTurns": 0,
      "maxCostUsd": 0,
      "timeoutMinutes": 0
    },
    "egressDomains": [
      "string"
    ],
    "isSystem": true,
    "createdBy": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "requestId": "string"
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "requestId": "string"
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "requestId": "string"
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "requestId": "string"
}