> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Survey Template

> Update a survey template's configuration

# Update Survey Template

Update an existing survey template. Only provided fields are updated. When `config` is updated, the template `version` auto-increments.

<Note>
  **Live Editing**: Updating a template affects all future survey responses. Employees who open the survey link after the update will see the new configuration. Existing responses are not affected.
</Note>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID
</ParamField>

### Path Parameters

<ParamField path="template_id" type="string" required>
  The UUID of the survey template
</ParamField>

### Body Parameters

All fields are optional. Only include fields you want to update.

<ParamField body="name" type="string">
  Updated template name (1-255 characters)
</ParamField>

<ParamField body="description" type="string">
  Updated description (max 1000 characters)
</ParamField>

<ParamField body="config" type="object">
  Updated template configuration. Must include all steps (not just changed ones).
</ParamField>

<ParamField body="status" type="string">
  **Available values:** `draft`, `active`, `archived`
</ParamField>

<ParamField body="is_default" type="boolean">
  Set as organization default (clears previous default)
</ParamField>

## Response

Returns the updated template object.

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Updated Survey Name",
    "version": 4,
    "config": { "..." : "..." },
    "updated_at": "2024-07-15T12:00:00Z"
  }
  ```
</ResponseExample>
