Overview

Updates the properties of an existing stack. You can modify the stack name and/or configuration. This endpoint supports partial updates - you only need to include the fields you want to change.

Endpoint

PUT https://api.toolrouter.ai/v1/stacks/{stack_id}

Authentication

This endpoint requires an API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Path Parameters

stack_id
string
required
The unique identifier of the stack to update

Request Body

stack_name
string
New name for the stack (optional)
configuration
object
Stack configuration settings to update (optional)
All request body fields are optional. Include only the fields you want to update.

Response

stack_id
string
Unique identifier for the updated stack
stack_name
string
Name of the updated stack
configuration
object
Updated stack configuration settings
servers
array
Array of servers (not populated in update response)
created_at
string
ISO timestamp when the stack was originally created
updated_at
string
ISO timestamp when the stack was last updated

Example Request

Update Stack Name

curl -X PUT "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stack_name": "Updated Stack Name"
  }'

Update Configuration Only

curl -X PUT "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "configuration": {
      "analytics_enabled": false
    }
  }'

Update Both Name and Configuration

curl -X PUT "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stack_name": "Production Environment",
    "configuration": {
      "analytics_enabled": true
    }
  }'

Example Response

{
  "stack_id": "stack_123e4567-e89b-12d3-a456-426614174000",
  "stack_name": "Production Environment",
  "configuration": {
    "analytics_enabled": true
  },
  "servers": [],
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-25T15:45:00Z"
}

Error Responses

400 Bad Request
Invalid request data
{
  "detail": "Invalid configuration parameters"
}
401 Unauthorized
Invalid or missing API key
{
  "detail": "Unauthorized"
}
404 Not Found
Stack not found
{
  "detail": "Stack not found"
}
429 Too Many Requests
Rate limit exceeded
{
  "detail": "Too many requests"
}
500 Internal Server Error
Server error occurred
{
  "detail": "Failed to update stack"
}