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

# Project tools

> Exact request and response contracts for project tools.

Generated from the application OpenAPI contract. Do not edit endpoint examples independently.

Read the [agent guide](https://docs.springwinter.dev/api-reference/agents.md) before automating deployments. Fetch the complete schema with `GET /api/openapi.json` and your bearer token. The interactive reference is [in the app](https://springwinter.dev/docs/api).

Authenticated operations accept `Authorization: Bearer $SPRINGWINTER_TOKEN`. Cookie mutations require a CSRF token. Signed webhooks use their own signature checks. Read each operation's security setting.

## GET `/api/projects/{project_id}/architecture`

Read the cached AWS architecture map

Returns a sanitized project-scoped snapshot and schedules discovery when stale or absent. Partial sections retain individual observation times. No AWS infrastructure is changed.

```json theme={null}
{
  "tags": [
    "Projects"
  ],
  "summary": "Read the cached AWS architecture map",
  "description": "Returns a sanitized project-scoped snapshot and schedules discovery when stale or absent. Partial sections retain individual observation times. No AWS infrastructure is changed.",
  "responses": {
    "200": {
      "description": "Cached snapshot and refresh state. Accepted refresh does not mean discovery is complete.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProjectArchitecturePage"
          }
        }
      }
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    }
  },
  "operationId": "getProjectArchitecture",
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## POST `/api/projects/{project_id}/architecture`

Refresh the AWS architecture map

Schedules read-only AWS discovery. Concurrent refreshes are coalesced. Manual requests have a 30-second cooldown. Cookie authentication requires X-CSRF-Token.

```json theme={null}
{
  "tags": [
    "Projects"
  ],
  "summary": "Refresh the AWS architecture map",
  "description": "Schedules read-only AWS discovery. Concurrent refreshes are coalesced. Manual requests have a 30-second cooldown. Cookie authentication requires X-CSRF-Token.",
  "responses": {
    "202": {
      "description": "Cached snapshot and refresh state. Accepted refresh does not mean discovery is complete.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProjectArchitecturePage"
          }
        }
      }
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "422": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    }
  },
  "operationId": "refreshProjectArchitecture",
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## GET `/api/projects/{project_id}/chat`

Read your project chat

Returns the latest 20 turns for this user and project, oldest first. Poll this endpoint for pending or running answers. Stale active turns appear failed with interrupted.

```json theme={null}
{
  "tags": [
    "Projects"
  ],
  "operationId": "getProjectChat",
  "summary": "Read your project chat",
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    },
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "provider": {
                "type": "string"
              },
              "turns": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProjectChatTurn"
                },
                "maxItems": 20
              }
            },
            "required": [
              "configured",
              "provider",
              "turns"
            ]
          }
        }
      }
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "description": "Returns the latest 20 turns for this user and project, oldest first. Poll this endpoint for pending or running answers. Stale active turns appear failed with interrupted."
}
```

## POST `/api/projects/{project_id}/chat`

Submit a project question

One active turn per user and project. Limit 20 submissions per user per hour. Reusing the same request\_id and identical question returns the existing turn; a changed question is rejected. No automatic retry of paid generation.

```json theme={null}
{
  "tags": [
    "Projects"
  ],
  "operationId": "createProjectChatTurn",
  "summary": "Submit a project question",
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    },
    "202": {
      "description": "Turn accepted. Poll GET chat until completed or failed.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "turn": {
                "$ref": "#/components/schemas/ProjectChatTurn"
              }
            },
            "required": [
              "turn"
            ]
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/InvalidParameters"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "chat_busy"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "invalid_chat_message",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "429": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "chat_rate_limited"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "503": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "chat_unavailable"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "description": "One active turn per user and project. Limit 20 submissions per user per hour. Reusing the same request_id and identical question returns the existing turn; a changed question is rejected. No automatic retry of paid generation.",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "chat": {
              "type": "object",
              "properties": {
                "question": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4000
                },
                "request_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{8,64}$"
                }
              },
              "required": [
                "question",
                "request_id"
              ]
            }
          },
          "required": [
            "chat"
          ]
        }
      }
    }
  }
}
```

## DELETE `/api/projects/{project_id}/chat`

Clear your project chat

Clears only this user’s turns for the project. An active non-stale turn blocks restart.

```json theme={null}
{
  "tags": [
    "Projects"
  ],
  "operationId": "restartProjectChat",
  "summary": "Clear your project chat",
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    },
    "204": {
      "description": "Chat turns soft-deleted. Empty response body."
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "chat_busy"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "Request rejected",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "description": "Clears only this user’s turns for the project. An active non-stale turn blocks restart."
}
```

## GET `/api/projects/{project_id}/gateway`

GET /api/projects/{project_id}/gateway

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "GET /api/projects/{project_id}/gateway",
  "operationId": "getApiProjectsProjectIdGateway",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountDataGateway"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "project_not_found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "project_not_found"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "missing_aws_account; missing_permissions; gateway_failed",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions",
                  "gateway_failed"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## POST `/api/projects/{project_id}/gateway`

POST /api/projects/{project_id}/gateway

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "POST /api/projects/{project_id}/gateway",
  "operationId": "postApiProjectsProjectIdGateway",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountDataGateway"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "project_not_found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "project_not_found"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "missing_aws_account; missing_permissions; gateway_failed; network_not_ready; invalid_csrf_token",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions",
                  "gateway_failed",
                  "network_not_ready",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## DELETE `/api/projects/{project_id}/gateway`

DELETE /api/projects/{project_id}/gateway

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "DELETE /api/projects/{project_id}/gateway",
  "operationId": "deleteApiProjectsProjectIdGateway",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountDataGateway"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "project_not_found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "project_not_found"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "missing_aws_account; missing_permissions; gateway_failed; invalid_csrf_token",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions",
                  "gateway_failed",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## POST `/api/projects/{project_id}/gateway/connect`

POST /api/projects/{project_id}/gateway/connect

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "POST /api/projects/{project_id}/gateway/connect",
  "operationId": "postApiProjectsProjectIdGatewayConnect",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountDataGateway"
          }
        }
      }
    },
    "409": {
      "description": "Gateway absent or starting; no tunnel session yet",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AccountDataGateway"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "project_not_found; resource_not_found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "project_not_found",
                  "resource_not_found"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "422": {
      "description": "missing_aws_account; network_not_ready; not_connectable; missing_permissions; gateway_failed; invalid_csrf_token",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "network_not_ready",
                  "not_connectable",
                  "missing_permissions",
                  "gateway_failed",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "resource_id": {
              "type": "string"
            },
            "node_id": {
              "type": "string"
            }
          },
          "required": [
            "resource_id"
          ]
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## GET `/api/projects/{project_id}/security`

GET /api/projects/{project_id}/security

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "GET /api/projects/{project_id}/security",
  "operationId": "getApiProjectsProjectIdSecurity",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "enabled_at": {
                "type": "string"
              },
              "range": {
                "type": "string",
                "enum": [
                  "1h",
                  "24h"
                ]
              },
              "sql": {
                "type": "boolean"
              },
              "unsupported_sql_audit": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "client",
                    "count"
                  ]
                }
              },
              "requests": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "host",
                    "path",
                    "status"
                  ]
                }
              },
              "connections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "database": {
                      "type": "string"
                    },
                    "resource": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "user",
                    "database",
                    "resource"
                  ]
                }
              }
            },
            "required": [
              "enabled",
              "sql",
              "sources",
              "requests",
              "connections"
            ]
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "Project not found (empty body)"
    },
    "422": {
      "description": "missing_aws_account; missing_permissions",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "range",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "1h",
          "24h"
        ],
        "default": "1h"
      }
    },
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## POST `/api/projects/{project_id}/security`

POST /api/projects/{project_id}/security

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "POST /api/projects/{project_id}/security",
  "operationId": "postApiProjectsProjectIdSecurity",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "enabled_at": {
                "type": "string"
              },
              "range": {
                "type": "string",
                "enum": [
                  "1h",
                  "24h"
                ]
              },
              "sql": {
                "type": "boolean"
              },
              "unsupported_sql_audit": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "client",
                    "count"
                  ]
                }
              },
              "requests": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "host",
                    "path",
                    "status"
                  ]
                }
              },
              "connections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "database": {
                      "type": "string"
                    },
                    "resource": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "user",
                    "database",
                    "resource"
                  ]
                }
              }
            },
            "required": [
              "enabled",
              "sql",
              "sources",
              "requests",
              "connections"
            ]
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "Project not found (empty body)"
    },
    "422": {
      "description": "missing_aws_account; missing_permissions; missing_load_balancer; invalid_csrf_token",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions",
                  "missing_load_balancer",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## DELETE `/api/projects/{project_id}/security`

DELETE /api/projects/{project_id}/security

```json theme={null}
{
  "tags": [
    "Data"
  ],
  "summary": "DELETE /api/projects/{project_id}/security",
  "operationId": "deleteApiProjectsProjectIdSecurity",
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "enabled_at": {
                "type": "string"
              },
              "range": {
                "type": "string",
                "enum": [
                  "1h",
                  "24h"
                ]
              },
              "sql": {
                "type": "boolean"
              },
              "unsupported_sql_audit": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "client": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "client",
                    "count"
                  ]
                }
              },
              "requests": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "host",
                    "path",
                    "status"
                  ]
                }
              },
              "connections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "database": {
                      "type": "string"
                    },
                    "resource": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "at",
                    "client",
                    "user",
                    "database",
                    "resource"
                  ]
                }
              }
            },
            "required": [
              "enabled",
              "sql",
              "sources",
              "requests",
              "connections"
            ]
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "unauthenticated"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "404": {
      "description": "Project not found (empty body)"
    },
    "422": {
      "description": "missing_aws_account; missing_permissions; invalid_csrf_token",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "missing_aws_account",
                  "missing_permissions",
                  "invalid_csrf_token"
                ]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ]
}
```

## Referenced definitions

These keys resolve the local references in the operations above.

```json theme={null}
{
  "#/components/responses/InvalidParameters": {
    "description": "Missing or malformed JSON parameters",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        },
        "example": {
          "error": "invalid_parameters"
        }
      }
    }
  },
  "#/components/responses/NotFound": {
    "description": "Record not found in the current organization. Empty response body."
  },
  "#/components/responses/Unauthenticated": {
    "description": "No session cookie",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        },
        "example": {
          "error": "unauthenticated"
        }
      }
    }
  },
  "#/components/schemas/AccountDataGateway": {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "enum": [
          "absent",
          "starting",
          "active"
        ]
      },
      "target": {
        "type": "string"
      },
      "local_port": {
        "type": "integer"
      },
      "remote_host": {
        "type": "string"
      },
      "tls_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "command": {
        "type": "string"
      }
    },
    "required": [
      "status"
    ]
  },
  "#/components/schemas/Error": {
    "type": "object",
    "required": [
      "error"
    ],
    "properties": {
      "error": {
        "type": "string"
      },
      "actions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  },
  "#/components/schemas/ProjectArchitecturePage": {
    "type": "object",
    "properties": {
      "snapshot": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "integer",
                "const": 1
              },
              "observedFrom": {
                "type": "string",
                "format": "date-time"
              },
              "observedThrough": {
                "type": "string",
                "format": "date-time"
              },
              "completeness": {
                "type": "string",
                "enum": [
                  "complete",
                  "partial"
                ]
              },
              "nodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "layer": {
                      "type": "string"
                    },
                    "section": {
                      "type": "string"
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resourceId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resourceKind": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "observation": {
                      "type": "string",
                      "enum": [
                        "current",
                        "stale"
                      ]
                    },
                    "properties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "name",
                    "parentId",
                    "resourceId",
                    "resourceKind",
                    "layer",
                    "status",
                    "section",
                    "observation",
                    "properties"
                  ]
                },
                "maxItems": 500
              },
              "edges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "section": {
                      "type": "string"
                    },
                    "evidence": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "string",
                      "const": "stale"
                    }
                  },
                  "required": [
                    "id",
                    "source",
                    "target",
                    "type",
                    "label",
                    "section",
                    "evidence"
                  ]
                }
              },
              "sections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "parentSection": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "current",
                        "stale",
                        "unknown"
                      ]
                    },
                    "checkedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "attemptedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "limit_reached",
                        "network_error",
                        "access_denied",
                        "not_found",
                        "aws_unavailable",
                        "parent_unavailable"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "checkedAt"
                  ]
                }
              }
            },
            "required": [
              "schemaVersion",
              "observedFrom",
              "observedThrough",
              "completeness",
              "nodes",
              "edges",
              "sections"
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "refresh": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed",
              "unavailable"
            ]
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "string",
            "enum": [
              "missing_aws_account",
              "refresh_interrupted",
              "discovery_failed"
            ]
          }
        }
      },
      "stale": {
        "type": "boolean"
      }
    },
    "required": [
      "snapshot",
      "refresh",
      "stale"
    ]
  },
  "#/components/schemas/ProjectChatTurn": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "request_id": {
        "type": "string"
      },
      "question": {
        "type": "string"
      },
      "answer": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "completed",
          "failed"
        ]
      },
      "error_code": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          null,
          "interrupted",
          "context_changed",
          "empty_answer",
          "answer_timeout",
          "answer_failed",
          "request_limit",
          "tool_limit",
          "response_limit",
          "output_limit"
        ]
      },
      "sources": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "url": {
              "type": [
                "string",
                "null"
              ]
            },
            "fetched_at": {
              "type": "string",
              "format": "date-time"
            },
            "kind": {
              "type": "string",
              "const": "aws_documentation"
            },
            "tool": {
              "type": "string",
              "enum": [
                "overview",
                "aws_resources",
                "aws_resource",
                "costs",
                "metrics",
                "documentation",
                "deployments"
              ]
            },
            "card": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "resources",
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "type",
                    "items",
                    "truncated"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "costs",
                      "type": "string"
                    },
                    "unavailable": {
                      "type": "boolean"
                    },
                    "total": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "covers_through": {
                      "type": "string"
                    },
                    "estimated": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "name",
                          "amount"
                        ]
                      }
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "metrics",
                      "type": "string"
                    },
                    "unavailable": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "range": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "unit": {
                            "type": "string"
                          },
                          "stat": {
                            "type": "string"
                          },
                          "latest_at": {
                            "type": "string"
                          },
                          "average": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "minimum": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "maximum": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "title",
                          "unit",
                          "stat",
                          "latest_at",
                          "average",
                          "minimum",
                          "maximum",
                          "truncated"
                        ]
                      }
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "source",
            "url",
            "fetched_at",
            "tool"
          ]
        }
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    },
    "required": [
      "id",
      "request_id",
      "question",
      "answer",
      "status",
      "error_code",
      "sources",
      "created_at"
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.