Overview

Creates a new stack with the specified name and configuration. A stack is a collection of servers and tools that work together for your specific use case.

Endpoint

POST https://api.toolrouter.ai/v1/stacks

Authentication

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

Request Body

stack_name
string
required
Name of the new stack. Must be unique within your account.
configuration
object
Stack configuration settings

Response

stack_id
string
Unique identifier for the newly created stack
stack_name
string
Name of the created stack
configuration
object
Stack configuration settings
servers
array
Array of servers (empty for newly created stacks)
created_at
string
ISO timestamp when the stack was created
updated_at
string
ISO timestamp when the stack was last updated

Example Request

curl -X POST "https://api.toolrouter.ai/v1/stacks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stack_name": "My New Stack",
    "configuration": {
      "analytics_enabled": true
    }
  }'

Example Response

{
  "stack_id": "stack_456a7890-b12c-34d5-e678-426614174002",
  "stack_name": "My New Stack",
  "configuration": {
    "analytics_enabled": true
  },
  "servers": [],
  "created_at": "2024-01-25T12:30:00Z",
  "updated_at": "2024-01-25T12:30:00Z"
}

Minimal Request Example

You can create a stack with just a name, and default configuration will be applied:
curl -X POST "https://api.toolrouter.ai/v1/stacks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stack_name": "Simple Stack"
  }'

Error Responses

400 Bad Request
Invalid request data
{
  "detail": "Stack name is required"
}
401 Unauthorized
Invalid or missing API key
{
  "detail": "Unauthorized"
}
429 Too Many Requests
Rate limit exceeded
{
  "detail": "Too many requests"
}
500 Internal Server Error
Server error occurred
{
  "detail": "Failed to create stack"
}