{
  "openapi": "3.0.3",
  "info": {
    "title": "llm-api",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://llm-api.treasuredata.com"
    },
    {
      "url": "https://llm-api.eu01.treasuredata.com"
    },
    {
      "url": "https://llm-api.ap02.treasuredata.com"
    },
    {
      "url": "https://llm-api.treasuredata.co.jp"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "TD1"
      }
    }
  },
  "paths": {
    "/api/actions": {
      "get": {
        "summary": "index",
        "tags": [
          "Action"
        ],
        "responses": {
          "200": {
            "description": "List of actions filtered by UI tags",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              },
                              "chat": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "integrationId": {
                                "type": "string"
                              },
                              "promptId": {
                                "type": "string"
                              },
                              "chatWidgetType": {
                                "nullable": true,
                                "type": "string"
                              },
                              "chatWidgetLabel": {
                                "nullable": true,
                                "type": "string"
                              },
                              "webhookTextUrl": {
                                "type": "string",
                                "nullable": true
                              },
                              "slackRequestUrl": {
                                "type": "string",
                                "nullable": true
                              },
                              "uiTags": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "integrationId",
                              "promptId",
                              "chatWidgetType",
                              "chatWidgetLabel",
                              "webhookTextUrl",
                              "slackRequestUrl",
                              "uiTags"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        },
                        "next": {
                          "type": "string"
                        },
                        "prev": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "actions",
                      "links": {
                        "self": "http://www.example.com/api/actions/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "integrationId": "00000000-0000-0000-0000-000000000001",
                        "promptId": "00000000-0000-0000-0000-000000000001",
                        "chatWidgetType": null,
                        "chatWidgetLabel": null,
                        "webhookTextUrl": "http://localhost:3000/api/actions/00000000-0000-0000-0000-000000000001/text",
                        "slackRequestUrl": null,
                        "uiTags": []
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "actions",
                      "links": {
                        "self": "http://www.example.com/api/actions/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "integrationId": "00000000-0000-0000-0000-000000000001",
                        "promptId": "00000000-0000-0000-0000-000000000001",
                        "chatWidgetType": null,
                        "chatWidgetLabel": null,
                        "webhookTextUrl": "http://localhost:3000/api/actions/00000000-0000-0000-0000-000000000001/text",
                        "slackRequestUrl": null,
                        "uiTags": [
                          "lang:en"
                        ]
                      }
                    }
                  ],
                  "meta": {
                    "total": 45
                  },
                  "links": {
                    "first": "http://www.example.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=40",
                    "next": "http://www.example.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=40",
                    "prev": "http://www.example.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[parent_segment_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 0
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[prompt_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[service_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "HOGE_HOGE"
          },
          {
            "name": "filter[skip_managed]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "true",
                "false"
              ]
            },
            "example": "false"
          },
          {
            "name": "filter[ui_tags]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "lang:es"
          },
          {
            "name": "page[limit]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100
            },
            "example": 20
          }
        ]
      }
    },
    "/api/actions/{id}/slack": {
      "post": {
        "summary": "slack",
        "tags": [
          "Action"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Slack response containing either empty text for ephemeral mode or JSON for in-channel mode",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "Empty response for ephemeral slack_response_type"
                },
                "example": ""
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response_type": {
                      "type": "string",
                      "enum": [
                        "in_channel"
                      ],
                      "description": "Type of Slack response"
                    },
                    "text": {
                      "type": "string",
                      "description": "Response text (typically empty)"
                    }
                  },
                  "required": [
                    "response_type",
                    "text"
                  ]
                },
                "example": {
                  "response_type": "in_channel",
                  "text": ""
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid timestamp or signature",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - integration type is not slack or action not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "404",
                  "error": "Not Found"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limit exceeded",
            "headers": {
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Number of seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "429",
                  "error": "Rate limit exceeded"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "response_url": {
                    "type": "string",
                    "description": "Slack response URL for posting delayed responses"
                  },
                  "text": {
                    "type": "string",
                    "description": "User input text from Slack command"
                  },
                  "command": {
                    "type": "string",
                    "description": "The Slack slash command that triggered this action"
                  }
                },
                "required": [
                  "response_url",
                  "text",
                  "command"
                ]
              },
              "example": {
                "response_url": "https://hooks.slack.com/commands/T12345678/12345678/abcdef",
                "text": "user input text here",
                "command": "/mycommand"
              }
            }
          }
        }
      }
    },
    "/api/agent_schedules": {
      "get": {
        "summary": "index",
        "tags": [
          "AgentSchedule"
        ],
        "responses": {
          "200": {
            "description": "Empty result set when interface type filter does not match any resources values",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "formInterfaceId": {
                                "type": "string",
                                "nullable": true
                              },
                              "chatInterfaceId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "interfaceType": {
                                "type": "string",
                                "enum": [
                                  "form",
                                  "chat"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string",
                                "nullable": true
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "disabled"
                                ]
                              },
                              "repeatUnit": {
                                "type": "string",
                                "enum": [
                                  "no_repeat",
                                  "daily",
                                  "weekly",
                                  "monthly"
                                ]
                              },
                              "repeatFrequency": {
                                "type": "integer"
                              },
                              "repeatSubFrequency": {
                                "type": "array",
                                "items": {
                                  "type": "integer"
                                }
                              },
                              "timezone": {
                                "type": "string"
                              },
                              "startAt": {
                                "type": "string"
                              },
                              "endAt": {
                                "nullable": true,
                                "type": "string"
                              },
                              "parameterValues": {
                                "type": "object",
                                "properties": {
                                  "param1": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "param2": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "input": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                }
                              },
                              "sendEmailNotification": {
                                "type": "boolean"
                              },
                              "emailRecipients": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "textResourceId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "workflowProjectId": {
                                "type": "string",
                                "nullable": true
                              },
                              "workflowSessionId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "workflowAttemptId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "lastExecutedAt": {
                                "nullable": true,
                                "type": "string"
                              },
                              "executionCount": {
                                "type": "integer"
                              },
                              "lastRunStatus": {
                                "nullable": true,
                                "type": "string",
                                "enum": [
                                  "success",
                                  "failure"
                                ]
                              },
                              "lastRunErrorMessage": {
                                "nullable": true,
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "agentId",
                              "formInterfaceId",
                              "chatInterfaceId",
                              "interfaceType",
                              "name",
                              "description",
                              "status",
                              "repeatUnit",
                              "repeatFrequency",
                              "repeatSubFrequency",
                              "timezone",
                              "startAt",
                              "endAt",
                              "parameterValues",
                              "sendEmailNotification",
                              "emailRecipients",
                              "textResourceId",
                              "workflowProjectId",
                              "workflowSessionId",
                              "workflowAttemptId",
                              "lastExecutedAt",
                              "executionCount",
                              "lastRunStatus",
                              "lastRunErrorMessage"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "project": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "agent": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "formInterface": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "chatInterface": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ],
                            "nullable": true
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "updatedAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "nullable": true
                              },
                              "useRuntimeTextResource": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "useParentSegment": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "useWorkflowExecutor": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "managedType": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "promptTemplate": {
                                "type": "string"
                              },
                              "formJsonSchema": {
                                "type": "string"
                              },
                              "formUiSchema": {
                                "nullable": true
                              },
                              "useTextResource": {
                                "type": "boolean"
                              },
                              "starterMessage": {
                                "type": "string"
                              },
                              "textInputEnabled": {
                                "type": "boolean"
                              },
                              "textInputAgentId": {
                                "type": "string"
                              },
                              "chatInterfaceButtons": {
                                "type": "array",
                                "items": {}
                              }
                            },
                            "required": [
                              "name"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [],
                  "meta": {
                    "total": 0
                  },
                  "links": {
                    "first": "http://www.example.com/api/agent_schedules?filter%5BinterfaceType%5D=nonexistent&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/agent_schedules?filter%5BinterfaceType%5D=nonexistent&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "hsniqued",
                        "starterMessage": "",
                        "textInputEnabled": true,
                        "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "ijpodbmo",
                        "starterMessage": "",
                        "textInputEnabled": true,
                        "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[agentId]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[formInterfaceId]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[chatInterfaceId]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[interfaceType]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "nonexistent"
          },
          {
            "name": "filter[projectId]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "chatInterface"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "AgentSchedule"
        ],
        "responses": {
          "201": {
            "description": "Agent schedule successfully created",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "formInterfaceId": {
                              "type": "string",
                              "nullable": true
                            },
                            "chatInterfaceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "interfaceType": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string",
                              "nullable": true
                            },
                            "status": {
                              "type": "string"
                            },
                            "repeatUnit": {
                              "type": "string"
                            },
                            "repeatFrequency": {
                              "type": "integer"
                            },
                            "repeatSubFrequency": {
                              "type": "array",
                              "items": {
                                "type": "integer"
                              }
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "startAt": {
                              "type": "string"
                            },
                            "endAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "parameterValues": {
                              "type": "object",
                              "properties": {
                                "param2": {
                                  "type": "string"
                                },
                                "param1": {
                                  "type": "string"
                                },
                                "image_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "contentType": {
                                        "type": "string"
                                      },
                                      "binaryBase64": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "contentType",
                                      "binaryBase64"
                                    ]
                                  }
                                },
                                "array_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "mixed_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "oneOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "binaryBase64": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "contentType",
                                          "binaryBase64"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "regular_param": {
                                  "type": "string"
                                },
                                "attachment_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "contentType": {
                                        "type": "string"
                                      },
                                      "binaryBase64": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "contentType",
                                      "binaryBase64"
                                    ]
                                  }
                                },
                                "button_id": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "string"
                                },
                                "test": {
                                  "type": "string"
                                },
                                "report_description": {
                                  "type": "string"
                                },
                                "report_title": {
                                  "type": "string"
                                }
                              }
                            },
                            "sendEmailNotification": {
                              "type": "boolean"
                            },
                            "emailRecipients": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "textResourceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "workflowProjectId": {
                              "type": "string",
                              "nullable": true
                            },
                            "workflowSessionId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "workflowAttemptId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "lastExecutedAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "executionCount": {
                              "type": "integer"
                            },
                            "lastRunStatus": {
                              "nullable": true,
                              "type": "string",
                              "enum": [
                                "success",
                                "failure"
                              ]
                            },
                            "lastRunErrorMessage": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "formInterfaceId",
                            "chatInterfaceId",
                            "interfaceType",
                            "name",
                            "description",
                            "status",
                            "repeatUnit",
                            "repeatFrequency",
                            "repeatSubFrequency",
                            "timezone",
                            "startAt",
                            "endAt",
                            "parameterValues",
                            "sendEmailNotification",
                            "emailRecipients",
                            "textResourceId",
                            "workflowProjectId",
                            "workflowSessionId",
                            "workflowAttemptId",
                            "lastExecutedAt",
                            "executionCount",
                            "lastRunStatus",
                            "lastRunErrorMessage"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agentSchedules",
                    "links": {
                      "self": "http://www.example.com/api/agent_schedules/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "formInterfaceId": null,
                      "chatInterfaceId": "00000000-0000-0000-0000-000000000001",
                      "interfaceType": "chat",
                      "name": "Test Chat Schedule",
                      "description": null,
                      "status": "active",
                      "repeatUnit": "daily",
                      "repeatFrequency": 1,
                      "repeatSubFrequency": [],
                      "timezone": "UTC",
                      "startAt": "2026-01-23T02:17:36",
                      "endAt": null,
                      "parameterValues": {
                        "param2": "value2",
                        "param1": "value1",
                        "image_param": [
                          {
                            "contentType": "image/jpeg",
                            "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA"
                          }
                        ],
                        "array_param": [
                          "item1",
                          "item2"
                        ],
                        "mixed_param": [
                          "regular_item",
                          {
                            "contentType": "application/pdf",
                            "binaryBase64": "pdf_data_here"
                          }
                        ],
                        "regular_param": "regular_value",
                        "attachment_param": [
                          {
                            "contentType": "image/jpeg",
                            "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA"
                          }
                        ],
                        "button_id": "00000000-0000-0000-0000-000000000001",
                        "input": "user text input",
                        "test": "value",
                        "report_description": "Weekly team status report",
                        "report_title": "Team Status"
                      },
                      "sendEmailNotification": true,
                      "emailRecipients": [
                        "00000000-0000-0000-0000-000000000001"
                      ],
                      "textResourceId": null,
                      "workflowProjectId": "test-project-id",
                      "workflowSessionId": null,
                      "workflowAttemptId": null,
                      "lastExecutedAt": null,
                      "executionCount": 0,
                      "lastRunStatus": null,
                      "lastRunErrorMessage": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects emailRecipients in request payload with validation error",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "emailRecipients is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "returns 403 Forbidden when trying to use chat_interface and agent from different account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "rejects neither form_interface nor chat_interface",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "originalType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Either form_interface_id or chat_interface_id must be provided",
                      "detail": "Either form_interface_id or chat_interface_id must be provided",
                      "code": "100",
                      "source": {
                        "pointer": "/data"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_EXACTLY_ONE_INTERFACE_REQUIRED"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "formInterfaceId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "repeatUnit": {
                            "type": "string"
                          },
                          "repeatFrequency": {
                            "type": "integer"
                          },
                          "repeatSubFrequency": {
                            "type": "array",
                            "items": {
                              "type": "integer"
                            }
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "startAt": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "parameterValues": {
                            "type": "object",
                            "properties": {
                              "param2": {
                                "type": "string"
                              },
                              "param1": {
                                "type": "string"
                              },
                              "image_param": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "binaryBase64": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "binaryBase64",
                                    "contentType"
                                  ]
                                }
                              },
                              "regular_param": {
                                "type": "string"
                              },
                              "array_param": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "attachment_param": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "binaryBase64": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "binaryBase64",
                                    "contentType"
                                  ]
                                }
                              },
                              "mixed_param": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "oneOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "contentType": {
                                          "type": "string"
                                        },
                                        "binaryBase64": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "contentType",
                                        "binaryBase64"
                                      ]
                                    }
                                  ]
                                }
                              },
                              "button_id": {
                                "type": "string"
                              },
                              "input": {
                                "type": "string"
                              },
                              "test": {
                                "type": "string"
                              },
                              "report_description": {
                                "type": "string"
                              },
                              "report_title": {
                                "type": "string"
                              }
                            }
                          },
                          "sendEmailNotification": {
                            "type": "boolean"
                          },
                          "endAt": {
                            "type": "string"
                          },
                          "textResourceId": {
                            "type": "string"
                          },
                          "chatInterfaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "projectId",
                          "agentId",
                          "name",
                          "repeatUnit",
                          "repeatFrequency",
                          "timezone",
                          "startAt",
                          "parameterValues"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "agent_schedules",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "formInterfaceId": "00000000-0000-0000-0000-000000000001",
                    "name": "Test Chat Schedule",
                    "repeatUnit": "daily",
                    "repeatFrequency": 1,
                    "repeatSubFrequency": [],
                    "timezone": "UTC",
                    "startAt": "2026-01-23T02:17:36Z",
                    "description": "Automated schedule for reports",
                    "parameterValues": {
                      "param2": "value2",
                      "param1": "value1",
                      "image_param": [
                        {
                          "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA",
                          "contentType": "image/jpeg"
                        }
                      ],
                      "regular_param": "regular_value",
                      "array_param": [
                        "item1",
                        "item2"
                      ],
                      "attachment_param": [
                        {
                          "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA",
                          "contentType": "image/jpeg"
                        }
                      ],
                      "mixed_param": [
                        "regular_item",
                        {
                          "binaryBase64": "pdf_data_here",
                          "contentType": "application/pdf"
                        }
                      ],
                      "button_id": "00000000-0000-0000-0000-000000000001",
                      "input": "user text input",
                      "test": "value",
                      "report_description": "Weekly team status report",
                      "report_title": "Team Status"
                    },
                    "sendEmailNotification": true,
                    "endAt": "2025-12-31T23:59:00",
                    "textResourceId": "00000000-0000-0000-0000-000000000001",
                    "chatInterfaceId": "00000000-0000-0000-0000-000000000001"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agent_schedules/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "AgentSchedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "allows creator to delete their own agent schedule"
          },
          "401": {
            "description": "denies non-creator admin from deleting agent schedule in same account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "DELETE /api/agent_schedules/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "blocks deletion when workflow API fails",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Failed to delete workflow: Workflow deletion failed with status 500",
                      "detail": "Failed to delete workflow: Workflow deletion failed with status 500",
                      "code": "100",
                      "source": {
                        "pointer": "/data"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_SOMETHING_ERROR"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "AgentSchedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "agent"
          }
        ],
        "responses": {
          "200": {
            "description": "retrieves a specific agent_schedule with agent included",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "formInterfaceId": {
                              "type": "string",
                              "nullable": true
                            },
                            "chatInterfaceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "interfaceType": {
                              "type": "string",
                              "enum": [
                                "form",
                                "chat"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string",
                              "nullable": true
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "disabled"
                              ]
                            },
                            "repeatUnit": {
                              "type": "string",
                              "enum": [
                                "no_repeat",
                                "daily",
                                "weekly",
                                "monthly"
                              ]
                            },
                            "repeatFrequency": {
                              "type": "integer"
                            },
                            "repeatSubFrequency": {
                              "type": "array",
                              "items": {
                                "type": "integer"
                              }
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "startAt": {
                              "type": "string"
                            },
                            "endAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "parameterValues": {
                              "type": "object",
                              "properties": {
                                "param1": {
                                  "type": "string"
                                },
                                "test_param": {
                                  "type": "string"
                                }
                              }
                            },
                            "sendEmailNotification": {
                              "type": "boolean"
                            },
                            "emailRecipients": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "textResourceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "workflowProjectId": {
                              "type": "string",
                              "nullable": true
                            },
                            "workflowSessionId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "workflowAttemptId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "lastExecutedAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "executionCount": {
                              "type": "integer"
                            },
                            "lastRunStatus": {
                              "nullable": true,
                              "type": "string",
                              "enum": [
                                "success",
                                "failure"
                              ]
                            },
                            "lastRunErrorMessage": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "formInterfaceId",
                            "chatInterfaceId",
                            "interfaceType",
                            "name",
                            "description",
                            "status",
                            "repeatUnit",
                            "repeatFrequency",
                            "repeatSubFrequency",
                            "timezone",
                            "startAt",
                            "endAt",
                            "parameterValues",
                            "sendEmailNotification",
                            "emailRecipients",
                            "textResourceId",
                            "workflowProjectId",
                            "workflowSessionId",
                            "workflowAttemptId",
                            "lastExecutedAt",
                            "executionCount",
                            "lastRunStatus",
                            "lastRunErrorMessage"
                          ]
                        },
                        "relationships": {
                          "type": "object",
                          "properties": {
                            "project": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            },
                            "createdBy": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            },
                            "updatedBy": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            },
                            "agent": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ],
                            "nullable": true
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "updatedAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "nullable": true
                              },
                              "useRuntimeTextResource": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "useParentSegment": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "useWorkflowExecutor": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "managedType": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "name"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agentSchedules",
                    "links": {
                      "self": "http://www.example.com/api/agent_schedules/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "formInterfaceId": "00000000-0000-0000-0000-000000000001",
                      "chatInterfaceId": null,
                      "interfaceType": "form",
                      "name": "Test Schedule",
                      "description": "Automated schedule for reports",
                      "status": "active",
                      "repeatUnit": "daily",
                      "repeatFrequency": 1,
                      "repeatSubFrequency": [],
                      "timezone": "UTC",
                      "startAt": "2025-12-25T11:42:00",
                      "endAt": "2025-12-31",
                      "parameterValues": {
                        "param1": "value1",
                        "test_param": "test_value",
                        "name": "Monthly Report"
                      },
                      "sendEmailNotification": false,
                      "emailRecipients": [],
                      "textResourceId": null,
                      "workflowProjectId": "test-project-id",
                      "workflowSessionId": null,
                      "workflowAttemptId": null,
                      "lastExecutedAt": null,
                      "executionCount": 0,
                      "lastRunStatus": null,
                      "lastRunErrorMessage": null
                    },
                    "relationships": {
                      "project": {
                        "data": {
                          "type": "projects",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      },
                      "createdBy": {
                        "data": {
                          "type": "users",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      },
                      "updatedBy": {
                        "data": {
                          "type": "users",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      },
                      "agent": {
                        "data": {
                          "type": "agents",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      }
                    }
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "agents",
                      "links": {
                        "self": "http://www.example.com/api/agents/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "name": "bznwfidk"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "returns 404 for non-existent agent_schedule",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "AgentSchedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "allows creator to edit their own agent schedule",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "formInterfaceId": {
                              "type": "string"
                            },
                            "chatInterfaceId": {
                              "nullable": true
                            },
                            "interfaceType": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "repeatUnit": {
                              "type": "string"
                            },
                            "repeatFrequency": {
                              "type": "integer"
                            },
                            "repeatSubFrequency": {
                              "type": "array",
                              "items": {
                                "type": "integer"
                              }
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "startAt": {
                              "type": "string"
                            },
                            "endAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "parameterValues": {
                              "type": "object",
                              "properties": {
                                "param1": {
                                  "type": "string"
                                },
                                "test_param": {
                                  "type": "string"
                                },
                                "updated_param": {
                                  "type": "string"
                                },
                                "new_image_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "contentType": {
                                        "type": "string"
                                      },
                                      "binaryBase64": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "contentType",
                                      "binaryBase64"
                                    ]
                                  }
                                },
                                "regular_param1": {
                                  "type": "string"
                                },
                                "attachment_param": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "contentType": {
                                        "type": "string"
                                      },
                                      "binaryBase64": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "contentType",
                                      "binaryBase64"
                                    ]
                                  }
                                },
                                "subject": {
                                  "type": "string"
                                },
                                "notes": {
                                  "type": "string"
                                }
                              }
                            },
                            "sendEmailNotification": {
                              "type": "boolean"
                            },
                            "emailRecipients": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "textResourceId": {
                              "nullable": true
                            },
                            "workflowProjectId": {
                              "type": "string"
                            },
                            "workflowSessionId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "workflowAttemptId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "lastExecutedAt": {
                              "nullable": true,
                              "type": "string"
                            },
                            "executionCount": {
                              "type": "integer"
                            },
                            "lastRunStatus": {
                              "nullable": true,
                              "type": "string",
                              "enum": [
                                "success",
                                "failure"
                              ]
                            },
                            "lastRunErrorMessage": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "formInterfaceId",
                            "chatInterfaceId",
                            "interfaceType",
                            "name",
                            "description",
                            "status",
                            "repeatUnit",
                            "repeatFrequency",
                            "repeatSubFrequency",
                            "timezone",
                            "startAt",
                            "endAt",
                            "parameterValues",
                            "sendEmailNotification",
                            "emailRecipients",
                            "textResourceId",
                            "workflowProjectId",
                            "workflowSessionId",
                            "workflowAttemptId",
                            "lastExecutedAt",
                            "executionCount",
                            "lastRunStatus",
                            "lastRunErrorMessage"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agentSchedules",
                    "links": {
                      "self": "http://www.example.com/api/agent_schedules/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "formInterfaceId": "00000000-0000-0000-0000-000000000001",
                      "chatInterfaceId": null,
                      "interfaceType": "form",
                      "name": "Updated Schedule",
                      "description": "Updated schedule configuration",
                      "status": "active",
                      "repeatUnit": "daily",
                      "repeatFrequency": 1,
                      "repeatSubFrequency": [],
                      "timezone": "America/New_York",
                      "startAt": "2026-01-23T02:17:28",
                      "endAt": null,
                      "parameterValues": {
                        "param1": "value1",
                        "test_param": "test_value",
                        "updated_param": "updated_value",
                        "new_image_param": [
                          {
                            "contentType": "image/jpeg",
                            "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA"
                          }
                        ],
                        "regular_param1": "value1",
                        "attachment_param": [
                          {
                            "contentType": "image/jpeg",
                            "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA"
                          }
                        ],
                        "subject": "Team Update",
                        "notes": "Additional scheduling notes"
                      },
                      "sendEmailNotification": false,
                      "emailRecipients": [],
                      "textResourceId": null,
                      "workflowProjectId": "test-project-id",
                      "workflowSessionId": null,
                      "workflowAttemptId": null,
                      "lastExecutedAt": null,
                      "executionCount": 0,
                      "lastRunStatus": null,
                      "lastRunErrorMessage": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects emailRecipients in request payload for updates",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "emailRecipients is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "denies non-creator admin from editing agent schedule in same account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "returns 403 Forbidden when trying to update to cross-account agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/agent_schedules/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "returns validation error when updating parameter_values with invalid attachments",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "originalType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "attachments/0 - attachment content is corrupted",
                      "detail": "parameterValues - attachments/0 - attachment content is corrupted",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/parameterValues"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "UNDEFINED_TYPE",
                        "originalType": "attachments/0 - attachment content is corrupted"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "formInterfaceId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "repeatUnit": {
                            "type": "string"
                          },
                          "repeatFrequency": {
                            "type": "integer"
                          },
                          "repeatSubFrequency": {
                            "type": "array",
                            "items": {
                              "type": "integer"
                            }
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "startAt": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "parameterValues": {
                            "type": "object",
                            "properties": {
                              "param1": {
                                "type": "string"
                              },
                              "updated_param": {
                                "type": "string"
                              },
                              "new_image_param": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "binaryBase64": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "binaryBase64",
                                    "contentType"
                                  ]
                                }
                              },
                              "regular_param1": {
                                "type": "string"
                              },
                              "attachment_param": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "binaryBase64": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "binaryBase64",
                                    "contentType"
                                  ]
                                }
                              },
                              "category": {
                                "type": "string"
                              },
                              "notes": {
                                "type": "string"
                              }
                            }
                          },
                          "sendEmailNotification": {
                            "type": "boolean"
                          },
                          "endAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "agent_schedules",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "formInterfaceId": "00000000-0000-0000-0000-000000000001",
                    "name": "Updated Schedule",
                    "repeatUnit": "daily",
                    "repeatFrequency": 1,
                    "repeatSubFrequency": [],
                    "timezone": "America/New_York",
                    "startAt": "2025-12-25T15:30:00",
                    "description": "Updated schedule parameters",
                    "parameterValues": {
                      "param1": "value1",
                      "updated_param": "updated_value",
                      "new_image_param": [
                        {
                          "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA",
                          "contentType": "image/jpeg"
                        }
                      ],
                      "regular_param1": "value1",
                      "attachment_param": [
                        {
                          "binaryBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QClRXhpZgAASUkqAAgAA",
                          "contentType": "image/jpeg"
                        }
                      ],
                      "category": "Project Status",
                      "notes": "Final project review"
                    },
                    "sendEmailNotification": true,
                    "endAt": "2026-01-15T18:45:00"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agent_schedules/{id}/callback": {
      "post": {
        "summary": "callback",
        "tags": [
          "AgentSchedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string"
                  },
                  "attempt_id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "success",
                      "failure",
                      "unknown"
                    ]
                  },
                  "executed_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "error_message": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "required": [
                  "session_id",
                  "attempt_id",
                  "status"
                ]
              },
              "example": {
                "session_id": "session_123",
                "attempt_id": "attempt_456",
                "status": "failure",
                "executed_at": "2026-01-22T02:17:35Z",
                "error_message": "Something went wrong"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "calls update_workflow_project! when expired on failure too"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Agent schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "404",
                  "error": "Not Found"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent_schedules/{id}/execute": {
      "post": {
        "summary": "Execute agent schedule - returns workflow YAML",
        "tags": [
          "AgentSchedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent schedule execution initiated successfully",
            "content": {
              "application/x-yaml": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "active_schedule": {
                    "summary": "Active schedule - returns execution workflow",
                    "value": "---\n\"+create_chat\":\n  http>: /api/chats\n  method: POST\n  content:\n    data:\n      type: chats\n      attributes:\n        formInterfaceId: \"12345\"\n        inputParameters: '{\"param\": \"value\"}'\n\"+with_chat_id\":\n  _do:\n    \"+continue_chat\":\n      py>: continue_chat_handler.handle_sse_request\n      url: /api/chats/${chat_id}/continue\n\"+callback_success\":\n  http>: /api/agent_schedules/00000000-0000-0000-0000-000000000001/callback\n  method: POST\n"
                  },
                  "expired_schedule": {
                    "summary": "Expired schedule - returns expiration log",
                    "value": "---\n\"+log_expired\":\n  echo>: Schedule 00000000-0000-0000-0000-000000000001 has expired and was disabled\n"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Agent schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": 404,
                  "error": "Not Found"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents": {
      "get": {
        "summary": "index",
        "tags": [
          "Agent"
        ],
        "responses": {
          "200": {
            "description": "List of available agents for the current user",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "systemPrompt": {
                                "type": "string"
                              },
                              "starterMessage": {
                                "type": "string",
                                "nullable": true
                              },
                              "modelType": {
                                "type": "string"
                              },
                              "maxToolIterations": {
                                "type": "integer"
                              },
                              "temperature": {
                                "type": "number",
                                "format": "float"
                              },
                              "reasoningEffort": {
                                "type": "string",
                                "enum": [
                                  "NONE",
                                  "MINIMAL",
                                  "LOW",
                                  "MEDIUM",
                                  "HIGH"
                                ]
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "outputs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "functionName": {
                                      "type": "string"
                                    },
                                    "functionDescription": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "jsonSchema": {
                                      "type": "string"
                                    },
                                    "artifactType": {
                                      "type": "string",
                                      "enum": [
                                        "IMAGE_ID_OUTPUT",
                                        "MARKDOWN_TEXT_OUTPUT",
                                        "REACT_OUTPUT",
                                        "PRESENTATION"
                                      ],
                                      "nullable": true
                                    },
                                    "artifactContentType": {
                                      "type": "string",
                                      "enum": [
                                        "IMAGE_ID_OUTPUT",
                                        "MARKDOWN_TEXT_OUTPUT",
                                        "REACT_OUTPUT",
                                        "PRESENTATION"
                                      ],
                                      "nullable": true
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "functionName",
                                    "functionDescription",
                                    "jsonSchema",
                                    "artifactType",
                                    "artifactContentType"
                                  ]
                                }
                              },
                              "tools": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "toolTargetId": {
                                      "type": "string"
                                    },
                                    "targetFunction": {
                                      "type": "string"
                                    },
                                    "functionName": {
                                      "type": "string"
                                    },
                                    "functionDescription": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "agentOutputMode": {
                                      "type": "string",
                                      "enum": [
                                        "RETURN",
                                        "SHOW"
                                      ]
                                    },
                                    "agentPromptSchema": {
                                      "nullable": true,
                                      "type": "string"
                                    },
                                    "agentPromptTemplate": {
                                      "nullable": true,
                                      "type": "string"
                                    },
                                    "toolTargetType": {
                                      "type": "string"
                                    },
                                    "inheritChatFiles": {
                                      "type": "boolean"
                                    },
                                    "targetType": {
                                      "type": "string"
                                    },
                                    "targetKnowledgeBaseId": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "targetAgentId": {
                                      "type": "string",
                                      "nullable": true
                                    }
                                  },
                                  "required": [
                                    "toolTargetId",
                                    "targetFunction",
                                    "functionName",
                                    "functionDescription",
                                    "agentOutputMode",
                                    "agentPromptSchema",
                                    "agentPromptTemplate",
                                    "toolTargetType",
                                    "inheritChatFiles",
                                    "targetType",
                                    "targetKnowledgeBaseId",
                                    "targetAgentId"
                                  ]
                                }
                              },
                              "variables": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "toolTargetId": {
                                      "type": "string"
                                    },
                                    "targetFunction": {
                                      "type": "string"
                                    },
                                    "functionArgumentsText": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "toolTargetType": {
                                      "type": "string"
                                    },
                                    "targetKnowledgeBaseId": {
                                      "type": "string",
                                      "nullable": true
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "toolTargetId",
                                    "targetFunction",
                                    "functionArgumentsText",
                                    "toolTargetType",
                                    "targetKnowledgeBaseId"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "name",
                              "systemPrompt",
                              "starterMessage",
                              "modelType",
                              "maxToolIterations",
                              "temperature",
                              "reasoningEffort",
                              "isManaged",
                              "outputs",
                              "tools",
                              "variables"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "overview": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "firstReferencingAgentName": {
                                "type": "string",
                                "nullable": true
                              },
                              "firstReferencedByAgentName": {
                                "type": "string"
                              },
                              "firstReferencedByPromptName": {
                                "type": "string",
                                "nullable": true
                              },
                              "totalReferencingAgentCount": {
                                "type": "integer"
                              },
                              "totalReferencedByAgentCount": {
                                "type": "integer"
                              },
                              "totalReferencedByPromptCount": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [],
                  "meta": {
                    "total": 0
                  },
                  "links": {
                    "first": "http://www.example.com/api/agents?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/agents?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are invalid or missing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "Unauthorized: {\"status\":401,\"error\":\"Unauthorized: Invalid credentials.\"}"
                }
              }
            }
          },
          "403": {
            "description": "User is not authorized to access this resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "User is not authorized to access this service"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "Agent"
        ],
        "responses": {
          "201": {
            "description": "Agent successfully created",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string",
                              "nullable": true
                            },
                            "modelType": {
                              "type": "string"
                            },
                            "maxToolIterations": {
                              "type": "integer"
                            },
                            "temperature": {
                              "type": "number",
                              "format": "float"
                            },
                            "reasoningEffort": {
                              "type": "string",
                              "enum": [
                                "NONE",
                                "MINIMAL",
                                "LOW",
                                "MEDIUM",
                                "HIGH"
                              ]
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "functionName": {
                                    "type": "string"
                                  },
                                  "functionDescription": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "jsonSchema": {
                                    "type": "string"
                                  },
                                  "artifactType": {
                                    "type": "string",
                                    "enum": [
                                      "IMAGE_ID_OUTPUT",
                                      "MARKDOWN_TEXT_OUTPUT",
                                      "REACT_OUTPUT",
                                      "PRESENTATION"
                                    ],
                                    "nullable": true
                                  },
                                  "artifactContentType": {
                                    "type": "string",
                                    "enum": [
                                      "IMAGE_ID_OUTPUT",
                                      "MARKDOWN_TEXT_OUTPUT",
                                      "REACT_OUTPUT",
                                      "PRESENTATION"
                                    ],
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "functionName",
                                  "functionDescription",
                                  "jsonSchema",
                                  "artifactType",
                                  "artifactContentType"
                                ]
                              }
                            },
                            "tools": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "toolTargetId": {
                                    "type": "string"
                                  },
                                  "targetFunction": {
                                    "type": "string"
                                  },
                                  "functionName": {
                                    "type": "string"
                                  },
                                  "functionDescription": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "agentOutputMode": {
                                    "type": "string",
                                    "enum": [
                                      "RETURN",
                                      "SHOW"
                                    ]
                                  },
                                  "agentPromptSchema": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "agentPromptTemplate": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "toolTargetType": {
                                    "type": "string"
                                  },
                                  "inheritChatFiles": {
                                    "type": "boolean"
                                  },
                                  "targetType": {
                                    "type": "string"
                                  },
                                  "targetKnowledgeBaseId": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "targetAgentId": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "toolTargetId",
                                  "targetFunction",
                                  "functionName",
                                  "functionDescription",
                                  "agentOutputMode",
                                  "agentPromptSchema",
                                  "agentPromptTemplate",
                                  "toolTargetType",
                                  "inheritChatFiles",
                                  "targetType",
                                  "targetKnowledgeBaseId",
                                  "targetAgentId"
                                ]
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "toolTargetId": {
                                    "type": "string"
                                  },
                                  "targetFunction": {
                                    "type": "string"
                                  },
                                  "functionArgumentsText": {
                                    "nullable": true,
                                    "type": "string"
                                  },
                                  "toolTargetType": {
                                    "type": "string"
                                  },
                                  "targetKnowledgeBaseId": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "toolTargetId",
                                  "targetFunction",
                                  "toolTargetType"
                                ]
                              }
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "systemPrompt",
                            "starterMessage",
                            "modelType",
                            "maxToolIterations",
                            "temperature",
                            "reasoningEffort",
                            "isManaged",
                            "outputs",
                            "tools",
                            "variables"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agents",
                    "links": {
                      "self": "http://www.example.com/api/agents/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "name1",
                      "systemPrompt": "",
                      "starterMessage": "",
                      "modelType": "claude-4.5-haiku",
                      "maxToolIterations": 4,
                      "temperature": 0,
                      "reasoningEffort": "NONE",
                      "isManaged": false,
                      "outputs": [],
                      "tools": [],
                      "variables": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid agent parameters provided",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - cannot reference agents from other users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "Validation error - temperature must be between 0 and 2",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be in 0..1",
                      "detail": "temperature - must be in 0..1",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/temperature"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "modelType": {
                            "type": "string"
                          },
                          "maxToolIterations": {
                            "type": "integer"
                          },
                          "temperature": {
                            "type": "number",
                            "format": "float"
                          },
                          "variables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "targetKnowledgeBaseId": {
                                  "type": "string"
                                },
                                "targetFunction": {
                                  "type": "string"
                                },
                                "toolTargetId": {
                                  "type": "string"
                                },
                                "toolTargetType": {
                                  "type": "string"
                                },
                                "functionArgumentsText": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "toolTargetId",
                                "toolTargetType",
                                "targetFunction"
                              ]
                            }
                          },
                          "reasoningEffort": {
                            "type": "string",
                            "enum": [
                              "NONE",
                              "MINIMAL",
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ],
                            "description": "Overall reasoning effort for the agent.\nFor models whose name matches \"gpt-oss-*\", only \"LOW\", \"MEDIUM\", and \"HIGH\"\nare supported; \"NONE\" and \"MINIMAL\" are not valid for gpt-oss-* models.\n"
                          },
                          "systemPrompt": {
                            "type": "string",
                            "nullable": true
                          },
                          "starterMessage": {
                            "type": "string",
                            "nullable": true
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "functionName": {
                                  "type": "string"
                                },
                                "functionDescription": {
                                  "type": "string"
                                },
                                "jsonSchema": {
                                  "type": "string"
                                },
                                "artifactType": {
                                  "type": "string",
                                  "enum": [
                                    "IMAGE_ID_OUTPUT",
                                    "MARKDOWN_TEXT_OUTPUT",
                                    "REACT_OUTPUT",
                                    "PRESENTATION"
                                  ]
                                },
                                "artifactContentType": {
                                  "type": "string",
                                  "enum": [
                                    "IMAGE_ID_OUTPUT",
                                    "MARKDOWN_TEXT_OUTPUT",
                                    "REACT_OUTPUT",
                                    "PRESENTATION"
                                  ]
                                }
                              },
                              "required": [
                                "name",
                                "functionName",
                                "jsonSchema"
                              ]
                            }
                          },
                          "tools": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "toolTargetId": {
                                  "type": "string"
                                },
                                "toolTargetType": {
                                  "type": "string"
                                },
                                "targetFunction": {
                                  "type": "string"
                                },
                                "functionName": {
                                  "type": "string"
                                },
                                "functionDescription": {
                                  "type": "string"
                                },
                                "agentOutputMode": {
                                  "type": "string",
                                  "enum": [
                                    "RETURN",
                                    "SHOW"
                                  ],
                                  "nullable": true
                                },
                                "agentPromptSchema": {
                                  "type": "string"
                                },
                                "agentPromptTemplate": {
                                  "type": "string"
                                },
                                "inheritChatFiles": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "toolTargetId",
                                "toolTargetType",
                                "targetFunction",
                                "functionName"
                              ]
                            }
                          }
                        },
                        "required": [
                          "name",
                          "projectId",
                          "modelType"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "agents",
                  "attributes": {
                    "name": "name1",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "modelType": "claude-4.5-haiku",
                    "maxToolIterations": 4,
                    "temperature": 0,
                    "variables": [
                      {
                        "name": "columns",
                        "toolTargetId": "00000000-0000-0000-0000-000000000001",
                        "toolTargetType": "knowledge_base",
                        "targetFunction": "LIST_COLUMNS"
                      }
                    ],
                    "reasoningEffort": "LOW"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Agent deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions to delete this agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "restricts deletion of an agent if it is referenced by a prompt",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "referencedByTools": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              },
                              "referencedByPrompts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Cannot delete record because dependent referenced by prompts exist",
                      "detail": "Cannot delete record because dependent referenced by prompts exist",
                      "code": "100",
                      "source": {
                        "pointer": "/data"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "DEPENDENT_DESTROY_RESTRICTED_HAS_MANY",
                        "referencedByPrompts": [
                          {
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Agent details and configuration",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string",
                              "nullable": true
                            },
                            "modelType": {
                              "type": "string"
                            },
                            "maxToolIterations": {
                              "type": "integer"
                            },
                            "temperature": {
                              "type": "number",
                              "format": "float"
                            },
                            "reasoningEffort": {
                              "type": "string",
                              "enum": [
                                "NONE",
                                "MINIMAL",
                                "LOW",
                                "MEDIUM",
                                "HIGH"
                              ]
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "functionName": {
                                    "type": "string"
                                  },
                                  "functionDescription": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "jsonSchema": {
                                    "type": "string"
                                  },
                                  "artifactType": {
                                    "nullable": true,
                                    "type": "string",
                                    "enum": [
                                      "IMAGE_ID_OUTPUT",
                                      "MARKDOWN_TEXT_OUTPUT",
                                      "REACT_OUTPUT",
                                      "PRESENTATION"
                                    ]
                                  },
                                  "artifactContentType": {
                                    "nullable": true,
                                    "type": "string",
                                    "enum": [
                                      "IMAGE_ID_OUTPUT",
                                      "MARKDOWN_TEXT_OUTPUT",
                                      "REACT_OUTPUT",
                                      "PRESENTATION"
                                    ]
                                  }
                                },
                                "required": [
                                  "name",
                                  "functionName",
                                  "functionDescription",
                                  "jsonSchema",
                                  "artifactType",
                                  "artifactContentType"
                                ]
                              }
                            },
                            "tools": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "toolTargetId": {
                                    "type": "string"
                                  },
                                  "targetFunction": {
                                    "type": "string"
                                  },
                                  "functionName": {
                                    "type": "string"
                                  },
                                  "functionDescription": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "agentOutputMode": {
                                    "type": "string",
                                    "enum": [
                                      "RETURN",
                                      "SHOW"
                                    ]
                                  },
                                  "agentPromptSchema": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "agentPromptTemplate": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "toolTargetType": {
                                    "type": "string"
                                  },
                                  "inheritChatFiles": {
                                    "type": "boolean"
                                  },
                                  "targetType": {
                                    "type": "string"
                                  },
                                  "targetKnowledgeBaseId": {
                                    "nullable": true,
                                    "type": "string"
                                  },
                                  "targetAgentId": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "toolTargetId",
                                  "targetFunction",
                                  "functionName",
                                  "functionDescription",
                                  "agentOutputMode",
                                  "agentPromptSchema",
                                  "agentPromptTemplate",
                                  "toolTargetType",
                                  "inheritChatFiles",
                                  "targetType",
                                  "targetKnowledgeBaseId",
                                  "targetAgentId"
                                ]
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "toolTargetId": {
                                    "type": "string"
                                  },
                                  "targetFunction": {
                                    "type": "string"
                                  },
                                  "functionArgumentsText": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "toolTargetType": {
                                    "type": "string"
                                  },
                                  "targetKnowledgeBaseId": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "toolTargetId",
                                  "targetFunction",
                                  "toolTargetType"
                                ]
                              }
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "systemPrompt",
                            "starterMessage",
                            "modelType",
                            "maxToolIterations",
                            "temperature",
                            "reasoningEffort",
                            "isManaged",
                            "outputs",
                            "tools",
                            "variables"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agents",
                    "links": {
                      "self": "http://www.example.com/api/agents/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "mteewcrk",
                      "systemPrompt": "",
                      "starterMessage": "",
                      "modelType": "claude-4.5-haiku",
                      "maxToolIterations": 4,
                      "temperature": 0,
                      "reasoningEffort": "NONE",
                      "isManaged": true,
                      "outputs": [],
                      "tools": [],
                      "variables": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates an agent if the modelType to a non-deprecated model_type",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string"
                            },
                            "modelType": {
                              "type": "string"
                            },
                            "maxToolIterations": {
                              "type": "integer"
                            },
                            "temperature": {
                              "type": "number",
                              "format": "float"
                            },
                            "reasoningEffort": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "functionName": {
                                    "type": "string"
                                  },
                                  "functionDescription": {
                                    "nullable": true
                                  },
                                  "jsonSchema": {
                                    "type": "string"
                                  },
                                  "artifactType": {
                                    "nullable": true,
                                    "type": "string",
                                    "enum": [
                                      "IMAGE_ID_OUTPUT",
                                      "MARKDOWN_TEXT_OUTPUT",
                                      "REACT_OUTPUT",
                                      "PRESENTATION"
                                    ]
                                  },
                                  "artifactContentType": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "functionName",
                                  "functionDescription",
                                  "jsonSchema",
                                  "artifactType",
                                  "artifactContentType"
                                ]
                              }
                            },
                            "tools": {
                              "type": "array",
                              "items": {}
                            },
                            "variables": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "systemPrompt",
                            "starterMessage",
                            "modelType",
                            "maxToolIterations",
                            "temperature",
                            "reasoningEffort",
                            "isManaged",
                            "outputs",
                            "tools",
                            "variables"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "agents",
                    "links": {
                      "self": "http://www.example.com/api/agents/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "new_name",
                      "systemPrompt": "",
                      "starterMessage": "",
                      "modelType": "claude-4.5-haiku",
                      "maxToolIterations": 4,
                      "temperature": 0,
                      "reasoningEffort": "NONE",
                      "isManaged": false,
                      "outputs": [],
                      "tools": [],
                      "variables": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Forbidden - insufficient permissions to modify this agent",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/agents rejects {\"temperature\":-2}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be in 0..1",
                      "detail": "temperature - must be in 0..1",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/temperature"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "modelType": {
                            "type": "string"
                          },
                          "maxToolIterations": {
                            "type": "integer"
                          },
                          "temperature": {
                            "type": "number",
                            "format": "float"
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "functionName": {
                                  "type": "string"
                                },
                                "jsonSchema": {
                                  "type": "string"
                                },
                                "functionDescription": {
                                  "type": "string"
                                },
                                "artifactType": {
                                  "type": "string",
                                  "enum": [
                                    "IMAGE_ID_OUTPUT",
                                    "MARKDOWN_TEXT_OUTPUT",
                                    "REACT_OUTPUT",
                                    "PRESENTATION"
                                  ]
                                },
                                "artifactContentType": {
                                  "type": "string",
                                  "enum": [
                                    "IMAGE_ID_OUTPUT",
                                    "MARKDOWN_TEXT_OUTPUT",
                                    "REACT_OUTPUT",
                                    "PRESENTATION"
                                  ]
                                }
                              },
                              "required": [
                                "name",
                                "functionName",
                                "jsonSchema"
                              ]
                            }
                          },
                          "systemPrompt": {
                            "type": "string",
                            "nullable": true
                          },
                          "starterMessage": {
                            "type": "string",
                            "nullable": true
                          },
                          "reasoningEffort": {
                            "type": "string",
                            "enum": [
                              "NONE",
                              "MINIMAL",
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ]
                          },
                          "tools": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "toolTargetId": {
                                  "type": "string"
                                },
                                "toolTargetType": {
                                  "type": "string"
                                },
                                "targetFunction": {
                                  "type": "string"
                                },
                                "functionName": {
                                  "type": "string"
                                },
                                "functionDescription": {
                                  "type": "string"
                                },
                                "agentOutputMode": {
                                  "type": "string",
                                  "enum": [
                                    "RETURN",
                                    "SHOW"
                                  ],
                                  "nullable": true
                                },
                                "agentPromptSchema": {
                                  "type": "string"
                                },
                                "agentPromptTemplate": {
                                  "type": "string"
                                },
                                "inheritChatFiles": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "toolTargetId",
                                "toolTargetType",
                                "targetFunction",
                                "functionName"
                              ]
                            }
                          },
                          "variables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "toolTargetId": {
                                  "type": "string"
                                },
                                "toolTargetType": {
                                  "type": "string"
                                },
                                "targetFunction": {
                                  "type": "string"
                                },
                                "functionArgumentsText": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "toolTargetId",
                                "toolTargetType",
                                "targetFunction"
                              ]
                            }
                          }
                        },
                        "required": [
                          "name",
                          "modelType"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "agents",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "new_name",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "modelType": "claude-4.5-haiku",
                    "maxToolIterations": 4,
                    "temperature": 1,
                    "outputs": [
                      {
                        "name": "out1",
                        "functionName": "func1",
                        "jsonSchema": "{}"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/artifacts": {
      "get": {
        "summary": "index",
        "tags": [
          "Artifact"
        ],
        "responses": {
          "200": {
            "description": "filters by chat_interface_id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "chatId": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "formInterfaceId": {
                                "type": "string",
                                "nullable": true
                              },
                              "chatInterfaceId": {
                                "type": "string",
                                "nullable": true
                              },
                              "artifactType": {
                                "type": "string",
                                "enum": [
                                  "IMAGE_ID_OUTPUT",
                                  "MARKDOWN_TEXT_OUTPUT",
                                  "REACT_OUTPUT",
                                  "PRESENTATION"
                                ]
                              },
                              "textContent": {
                                "nullable": true,
                                "type": "string"
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "binaryContent": {
                                "nullable": true,
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "chatId",
                              "projectId",
                              "formInterfaceId",
                              "chatInterfaceId",
                              "artifactType",
                              "textContent",
                              "contentType",
                              "binaryContent"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [],
                  "meta": {
                    "total": 0
                  },
                  "links": {
                    "first": "http://www.example.com/api/artifacts?filter%5Bchat_interface_id%5D=00000000-0000-0000-0000-000000000001&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/artifacts?filter%5Bchat_interface_id%5D=00000000-0000-0000-0000-000000000001&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[chat_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[chat_interface_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[form_interface_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ]
      }
    },
    "/api/chat_attachments": {
      "get": {
        "summary": "index",
        "tags": [
          "ChatAttachment"
        ],
        "responses": {
          "200": {
            "description": "sorts by attachment_index",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "chatId": {
                                "type": "string"
                              },
                              "attachmentIndex": {
                                "type": "integer"
                              },
                              "attachmentType": {
                                "type": "string"
                              },
                              "contentFormatMode": {
                                "type": "string"
                              },
                              "inputFieldName": {
                                "nullable": true
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "imageWidth": {
                                "type": "integer"
                              },
                              "imageHeight": {
                                "type": "integer"
                              },
                              "pdfPageCount": {
                                "nullable": true
                              },
                              "binaryBase64": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "chatId",
                              "attachmentIndex",
                              "attachmentType",
                              "contentFormatMode",
                              "inputFieldName",
                              "contentType",
                              "imageWidth",
                              "imageHeight",
                              "pdfPageCount",
                              "binaryBase64"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatAttachments",
                      "links": {
                        "self": "http://www.example.com/api/chat_attachments/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "chatId": "00000000-0000-0000-0000-000000000001",
                        "attachmentIndex": 1,
                        "attachmentType": "USER_INPUT_DRAFT",
                        "contentFormatMode": "ID_AND_CONTENT",
                        "inputFieldName": null,
                        "contentType": "image/png",
                        "imageWidth": 225,
                        "imageHeight": 225,
                        "pdfPageCount": null,
                        "binaryBase64": "<BASE64_CONTENT>="
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatAttachments",
                      "links": {
                        "self": "http://www.example.com/api/chat_attachments/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "chatId": "00000000-0000-0000-0000-000000000001",
                        "attachmentIndex": 2,
                        "attachmentType": "USER_INPUT",
                        "contentFormatMode": "ID_AND_CONTENT",
                        "inputFieldName": null,
                        "contentType": "image/png",
                        "imageWidth": 225,
                        "imageHeight": 225,
                        "pdfPageCount": null,
                        "binaryBase64": "<BASE64_CONTENT>="
                      }
                    }
                  ],
                  "meta": {
                    "total": 2
                  },
                  "links": {
                    "first": "http://www.example.com/api/chat_attachments?page%5Blimit%5D=20&page%5Boffset%5D=0&sort=attachment_index",
                    "last": "http://www.example.com/api/chat_attachments?page%5Blimit%5D=20&page%5Boffset%5D=0&sort=attachment_index"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[attachment_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "USER_INPUT_DRAFT"
          },
          {
            "name": "filter[chat_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "attachment_index"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "ChatAttachment"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "chatId": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "inputFieldName": {
                            "type": "string"
                          },
                          "binaryBase64": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "chatId",
                          "contentType",
                          "inputFieldName",
                          "binaryBase64"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "chat_attachments",
                  "attributes": {
                    "chatId": "00000000-0000-0000-0000-000000000001",
                    "contentType": "image/png",
                    "inputFieldName": "screenshot",
                    "binaryBase64": "iVBORw0KGgoAAAAAAAAAAAAABAAAAAMAAAAAAAAAAAAAAA=="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Chat attachment successfully created",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "chatId": {
                              "type": "string"
                            },
                            "attachmentIndex": {
                              "type": "integer"
                            },
                            "attachmentType": {
                              "type": "string"
                            },
                            "contentFormatMode": {
                              "type": "string"
                            },
                            "inputFieldName": {
                              "type": "string"
                            },
                            "contentType": {
                              "type": "string"
                            },
                            "imageWidth": {
                              "type": "integer"
                            },
                            "imageHeight": {
                              "type": "integer"
                            },
                            "pdfPageCount": {
                              "nullable": true
                            },
                            "binaryBase64": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "chatId",
                            "attachmentIndex",
                            "attachmentType",
                            "contentFormatMode",
                            "inputFieldName",
                            "contentType",
                            "imageWidth",
                            "imageHeight",
                            "pdfPageCount",
                            "binaryBase64"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chatAttachments",
                    "links": {
                      "self": "http://www.example.com/api/chat_attachments/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "chatId": "00000000-0000-0000-0000-000000000001",
                      "attachmentIndex": 1,
                      "attachmentType": "USER_INPUT_DRAFT",
                      "contentFormatMode": "ID_AND_CONTENT",
                      "inputFieldName": "screenshot",
                      "contentType": "image/png",
                      "imageWidth": 1024,
                      "imageHeight": 768,
                      "pdfPageCount": null,
                      "binaryBase64": "iVBORw0KGgoAAAAAAAAAAAAABAAAAAMAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "returns validation error",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "originalType": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must exist",
                      "detail": "project - must exist",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/project"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "can't be blank",
                      "detail": "projectId - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/projectId"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "must exist",
                      "detail": "chat - must exist",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/chat"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat_attachments/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "ChatAttachment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Chat attachment successfully deleted"
          },
          "403": {
            "description": "Forbidden - insufficient permissions to delete this resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "ChatAttachment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the specific chat attachment",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "chatId": {
                              "type": "string"
                            },
                            "attachmentIndex": {
                              "type": "integer"
                            },
                            "attachmentType": {
                              "type": "string"
                            },
                            "contentFormatMode": {
                              "type": "string"
                            },
                            "inputFieldName": {
                              "nullable": true
                            },
                            "contentType": {
                              "type": "string"
                            },
                            "imageWidth": {
                              "type": "integer"
                            },
                            "imageHeight": {
                              "type": "integer"
                            },
                            "pdfPageCount": {
                              "nullable": true
                            },
                            "binaryBase64": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "chatId",
                            "attachmentIndex",
                            "attachmentType",
                            "contentFormatMode",
                            "inputFieldName",
                            "contentType",
                            "imageWidth",
                            "imageHeight",
                            "pdfPageCount",
                            "binaryBase64"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chatAttachments",
                    "links": {
                      "self": "http://www.example.com/api/chat_attachments/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "chatId": "00000000-0000-0000-0000-000000000001",
                      "attachmentIndex": 1,
                      "attachmentType": "USER_INPUT_DRAFT",
                      "contentFormatMode": "ID_AND_CONTENT",
                      "inputFieldName": null,
                      "contentType": "image/png",
                      "imageWidth": 225,
                      "imageHeight": 225,
                      "pdfPageCount": null,
                      "binaryBase64": "<BASE64_CONTENT>="
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/chat_interfaces": {
      "get": {
        "summary": "index",
        "tags": [
          "ChatInterface"
        ],
        "responses": {
          "200": {
            "description": "includes by created_by and updated_by",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "starterMessage": {
                                "type": "string"
                              },
                              "textInputEnabled": {
                                "type": "boolean"
                              },
                              "textInputAgentId": {
                                "type": "string",
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "chatInterfaceButtons": {
                                "type": "array",
                                "items": {}
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "name",
                              "starterMessage",
                              "textInputEnabled",
                              "textInputAgentId",
                              "isManaged",
                              "chatInterfaceButtons"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "Chat Interface 1",
                        "starterMessage": "",
                        "textInputEnabled": false,
                        "textInputAgentId": null,
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "Chat Interface 2",
                        "starterMessage": "",
                        "textInputEnabled": false,
                        "textInputAgentId": null,
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    }
                  ],
                  "meta": {
                    "total": 2
                  },
                  "links": {
                    "first": "http://www.example.com/api/chat_interfaces?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/chat_interfaces?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Restricted User",
                        "email": "user@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "ChatInterface"
        ],
        "responses": {
          "201": {
            "description": "creates a chat_interface with buttons",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string"
                            },
                            "textInputEnabled": {
                              "type": "boolean"
                            },
                            "textInputAgentId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "chatInterfaceButtons": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "agentId",
                                  "label",
                                  "prompt"
                                ]
                              }
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "starterMessage",
                            "textInputEnabled",
                            "textInputAgentId",
                            "isManaged",
                            "chatInterfaceButtons"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chatInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Test Chat Interface",
                      "starterMessage": "",
                      "textInputEnabled": true,
                      "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                      "isManaged": false,
                      "chatInterfaceButtons": [
                        {
                          "agentId": "00000000-0000-0000-0000-000000000001",
                          "label": "Help",
                          "prompt": "Please help me with this task"
                        },
                        {
                          "agentId": "00000000-0000-0000-0000-000000000001",
                          "label": "Info",
                          "prompt": "Tell me more information"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/chat_interfaces rejects {\"createdAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "createdAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "returns button index in validation errors for labels longer than 100 characters",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 50 characters)",
                      "detail": "chatInterfaceButtons/1/label - is too long (maximum is 50 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/chatInterfaceButtons/1/label"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "textInputEnabled": {
                            "type": "boolean"
                          },
                          "textInputAgentId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "chatInterfaceButtons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "agentId": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "agentId",
                                "label",
                                "prompt"
                              ]
                            }
                          }
                        },
                        "required": [
                          "projectId",
                          "name",
                          "textInputEnabled"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "chat_interfaces",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Test Chat Interface",
                    "textInputEnabled": true,
                    "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                    "chatInterfaceButtons": [
                      {
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "label": "Help",
                        "prompt": "Please help me with this task"
                      },
                      {
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "label": "Info",
                        "prompt": "Tell me more information"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/chat_interfaces/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "ChatInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Chat interface deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Chat interface not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "ChatInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat interface details and configuration",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string"
                            },
                            "textInputEnabled": {
                              "type": "boolean"
                            },
                            "textInputAgentId": {
                              "type": "string",
                              "nullable": true
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "chatInterfaceButtons": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "starterMessage",
                            "textInputEnabled",
                            "textInputAgentId",
                            "isManaged",
                            "chatInterfaceButtons"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chatInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "avpughte",
                      "starterMessage": "",
                      "textInputEnabled": false,
                      "textInputAgentId": null,
                      "isManaged": false,
                      "chatInterfaceButtons": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Chat interface not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "ChatInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat interface updated successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "starterMessage": {
                              "type": "string"
                            },
                            "textInputEnabled": {
                              "type": "boolean"
                            },
                            "textInputAgentId": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "chatInterfaceButtons": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "agentId",
                                  "label",
                                  "prompt"
                                ]
                              }
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "starterMessage",
                            "textInputEnabled",
                            "textInputAgentId",
                            "isManaged",
                            "chatInterfaceButtons"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chatInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Updated Chat Interface",
                      "starterMessage": "",
                      "textInputEnabled": true,
                      "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                      "isManaged": false,
                      "chatInterfaceButtons": [
                        {
                          "agentId": "00000000-0000-0000-0000-000000000001",
                          "label": "Submit",
                          "prompt": "Submit your request"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/chat_interfaces rejects {\"createdAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "createdAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Chat interface not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "validates button label length when updating",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 50 characters)",
                      "detail": "chatInterfaceButtons/0/label - is too long (maximum is 50 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/chatInterfaceButtons/0/label"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "textInputEnabled": {
                            "type": "boolean"
                          },
                          "textInputAgentId": {
                            "type": "string"
                          },
                          "chatInterfaceButtons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "agentId": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "agentId",
                                "label",
                                "prompt"
                              ]
                            }
                          }
                        },
                        "required": [
                          "name",
                          "textInputEnabled",
                          "textInputAgentId"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "chat_interfaces",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Updated Chat Interface",
                    "textInputEnabled": true,
                    "textInputAgentId": "00000000-0000-0000-0000-000000000001",
                    "chatInterfaceButtons": [
                      {
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "label": "Submit",
                        "prompt": "Submit your request"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/chats": {
      "get": {
        "summary": "index",
        "tags": [
          "Chat"
        ],
        "parameters": [
          {
            "name": "filter[chat_interface_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[form_interface_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[has_artifacts]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "true"
          },
          {
            "name": "filter[parent_segment_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 978814
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[service_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "HOGE_HOGE"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "last_conversation_at"
          }
        ],
        "responses": {
          "200": {
            "description": "Empty chat list when no chat sessions exist",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "promptId": {
                                "type": "string",
                                "nullable": true
                              },
                              "integrationId": {
                                "type": "string",
                                "nullable": true
                              },
                              "actionId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "formInterfaceId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "chatInterfaceId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "inputParameters": {
                                "nullable": true,
                                "type": "string"
                              },
                              "textResourceId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "userProperties": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "value"
                                  ]
                                }
                              },
                              "firstInputContent": {
                                "nullable": true,
                                "type": "string"
                              },
                              "createdByChatId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "createdByToolCallId": {
                                "nullable": true,
                                "type": "string"
                              },
                              "lastConversationAt": {
                                "type": "string"
                              },
                              "attachments": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "binaryBase64": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    },
                                    "inputFieldName": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "binaryBase64",
                                    "contentType",
                                    "inputFieldName"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "agentId",
                              "promptId",
                              "integrationId",
                              "actionId",
                              "formInterfaceId",
                              "chatInterfaceId",
                              "inputParameters",
                              "textResourceId",
                              "userProperties",
                              "firstInputContent",
                              "createdByChatId",
                              "createdByToolCallId",
                              "lastConversationAt",
                              "attachments"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [],
                  "meta": {
                    "total": 0
                  },
                  "links": {
                    "first": "http://www.example.com/api/chats?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/chats?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  }
                }
              }
            }
          },
          "400": {
            "description": "GET /api/chats filters invalid parent_segment_id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Invalid filter value",
                      "detail": "invalid type is not a valid value for parent_segment_id.",
                      "code": "107",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "create",
        "tags": [
          "Chat"
        ],
        "responses": {
          "201": {
            "description": "POST /api/chats normalizes null userProperties to empty array",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "promptId": {
                              "type": "string",
                              "nullable": true
                            },
                            "integrationId": {
                              "type": "string",
                              "nullable": true
                            },
                            "actionId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "formInterfaceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "chatInterfaceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "inputParameters": {
                              "nullable": true,
                              "type": "string"
                            },
                            "textResourceId": {
                              "nullable": true,
                              "type": "string"
                            },
                            "userProperties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "value"
                                ]
                              }
                            },
                            "firstInputContent": {
                              "nullable": true
                            },
                            "createdByChatId": {
                              "nullable": true
                            },
                            "createdByToolCallId": {
                              "nullable": true
                            },
                            "lastConversationAt": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "promptId",
                            "integrationId",
                            "actionId",
                            "formInterfaceId",
                            "chatInterfaceId",
                            "inputParameters",
                            "textResourceId",
                            "userProperties",
                            "firstInputContent",
                            "createdByChatId",
                            "createdByToolCallId",
                            "lastConversationAt",
                            "attachments"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chats",
                    "links": {
                      "self": "http://www.example.com/api/chats/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "promptId": null,
                      "integrationId": null,
                      "actionId": null,
                      "formInterfaceId": null,
                      "chatInterfaceId": null,
                      "inputParameters": null,
                      "textResourceId": null,
                      "userProperties": [],
                      "firstInputContent": null,
                      "createdByChatId": null,
                      "createdByToolCallId": null,
                      "lastConversationAt": "2025-05-01T05:05:14.000Z",
                      "attachments": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "returns 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/chats rejects userProperties with more than 10 items",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "originalType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 10 characters)",
                      "detail": "userProperties - is too long (maximum is 10 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/userProperties"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "agentId": {
                            "type": "string"
                          },
                          "promptId": {
                            "type": "string"
                          },
                          "integrationId": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "binaryBase64": {
                                  "type": "string"
                                },
                                "contentType": {
                                  "type": "string"
                                },
                                "inputFieldName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "binaryBase64",
                                "contentType",
                                "inputFieldName"
                              ]
                            }
                          },
                          "actionId": {
                            "type": "string"
                          },
                          "formInterfaceId": {
                            "type": "string"
                          },
                          "inputParameters": {
                            "type": "string"
                          },
                          "chatInterfaceId": {
                            "type": "string"
                          },
                          "textResourceId": {
                            "type": "string"
                          },
                          "userProperties": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "value"
                              ]
                            },
                            "nullable": true
                          }
                        }
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "chats",
                  "attributes": {
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "promptId": "00000000-0000-0000-0000-000000000001",
                    "integrationId": "00000000-0000-0000-0000-000000000001",
                    "attachments": [
                      {
                        "binaryBase64": "<BASE64_CONTENT>=",
                        "contentType": "image/png",
                        "inputFieldName": "input_field_name"
                      }
                    ],
                    "actionId": "00000000-0000-0000-0000-000000000001",
                    "formInterfaceId": "00000000-0000-0000-0000-000000000001",
                    "inputParameters": "{\"subject\":\"Welcome to our newest gummy bear\",\"topic\":\"New lemon flavored gummy bear in our collection\"}",
                    "chatInterfaceId": "00000000-0000-0000-0000-000000000001",
                    "textResourceId": "00000000-0000-0000-0000-000000000001",
                    "userProperties": null
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/chats/{id}": {
      "get": {
        "summary": "show",
        "tags": [
          "Chat"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "GET /api/chats/:id returns userProperties in response",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "promptId": {
                              "nullable": true
                            },
                            "integrationId": {
                              "nullable": true
                            },
                            "actionId": {
                              "nullable": true
                            },
                            "formInterfaceId": {
                              "nullable": true
                            },
                            "chatInterfaceId": {
                              "nullable": true
                            },
                            "inputParameters": {
                              "nullable": true
                            },
                            "textResourceId": {
                              "nullable": true
                            },
                            "userProperties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "value"
                                ]
                              }
                            },
                            "firstInputContent": {
                              "nullable": true
                            },
                            "createdByChatId": {
                              "nullable": true
                            },
                            "createdByToolCallId": {
                              "nullable": true
                            },
                            "lastConversationAt": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "promptId",
                            "integrationId",
                            "actionId",
                            "formInterfaceId",
                            "chatInterfaceId",
                            "inputParameters",
                            "textResourceId",
                            "userProperties",
                            "firstInputContent",
                            "createdByChatId",
                            "createdByToolCallId",
                            "lastConversationAt",
                            "attachments"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "chats",
                    "links": {
                      "self": "http://www.example.com/api/chats/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "promptId": null,
                      "integrationId": null,
                      "actionId": null,
                      "formInterfaceId": null,
                      "chatInterfaceId": null,
                      "inputParameters": null,
                      "textResourceId": null,
                      "userProperties": [
                        {
                          "name": "browser_language",
                          "value": "ja"
                        }
                      ],
                      "firstInputContent": null,
                      "createdByChatId": null,
                      "createdByToolCallId": null,
                      "lastConversationAt": "2025-05-01T05:05:14.000Z",
                      "attachments": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "GET /api/chats/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chats/{id}/continue": {
      "post": {
        "summary": "continue",
        "tags": [
          "Chat"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "POST /api/chats/:id/continue embeds prompt template variables",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "data: {\"user_content\":\"Template: value1, 123, [\\\"serized\\\",{\\\"to\\\":\\\"json\\\"}], \",\"at\":\"2026-04-06T07:15:33Z\"}\n\n"
              }
            }
          },
          "403": {
            "description": "returns 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "returns 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": 404,
                  "error": "Not Found"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/chats/:id/continue rejects setting both input and inputParams",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "422",
                  "error": "setting both input and inputParams is invalid",
                  "details": [
                    "attachments - exceeds the maximum number of attachments allowed"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "returns a 429 status with the correct error message and headers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "429",
                  "error": "Rate limit exceeded. Please wait 60 seconds before trying again."
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string"
                  },
                  "inputParams": {
                    "type": "object",
                    "properties": {
                      "foo": {
                        "type": "string"
                      },
                      "var1": {
                        "type": "string"
                      },
                      "var2": {
                        "type": "integer"
                      },
                      "var3": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "binaryBase64": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        },
                        "inputFieldName": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "binaryBase64",
                        "contentType"
                      ]
                    }
                  }
                }
              },
              "example": {
                "input": "Hi",
                "inputParams": {
                  "foo": "bar",
                  "var1": "value1",
                  "var2": 123,
                  "var3": [
                    "serized",
                    {
                      "to": "json"
                    }
                  ]
                },
                "attachments": [
                  {
                    "binaryBase64": "<BASE64_CONTENT>=",
                    "contentType": "image/png",
                    "inputFieldName": "input_field_name"
                  },
                  {
                    "binaryBase64": "<BASE64_CONTENT>==",
                    "contentType": "application/pdf"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/chats/{id}/download_files": {
      "post": {
        "summary": "download_files",
        "tags": [
          "Chat"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ]
              },
              "example": {
                "method": "multipart",
                "prefix": "/tmp/"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "POST /api/chats/:id/download_files downloads with prefix",
            "content": {
              "multipart/mixed": {
                "schema": {
                  "type": "string"
                },
                "example": "--B-<BASE64_CONTENT>\r\nContent-Type: text/plain\r\nContent-Disposition: attachment; filename=attachment; filename=\"dir1%2Ff2.txt\"; filename*=UTF-8''dir1%2Ff2.txt\r\n\r\nv2\r\n--B-<BASE64_CONTENT>\r\nContent-Type: text/plain\r\nContent-Disposition: attachment; filename=attachment; filename=\"dir1%2Ff3.txt\"; filename*=UTF-8''dir1%2Ff3.txt\r\n\r\nv3\r\n--B-<BASE64_CONTENT>--\r\n"
              }
            }
          },
          "404": {
            "description": "GET /api/chats/:id/*files* returns 404 if the chat is not visible by the user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": 404,
                  "error": "Not Found"
                }
              }
            }
          }
        }
      }
    },
    "/api/chats/{id}/history": {
      "get": {
        "summary": "history",
        "tags": [
          "Chat"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "createArtifact call creates an artifact",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "input": {
                            "type": "string",
                            "nullable": true
                          },
                          "at": {
                            "type": "string"
                          },
                          "tool": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "functionName": {
                                "type": "string"
                              },
                              "functionArguments": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "output": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name"
                                ]
                              },
                              "targetKnowledgeBase": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ]
                              },
                              "targetFunction": {
                                "type": "string"
                              },
                              "toolTarget": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "type",
                                  "name"
                                ]
                              },
                              "targetAgent": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ]
                              },
                              "newChat": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "functionName",
                              "functionArguments",
                              "content",
                              "status"
                            ],
                            "nullable": true
                          },
                          "output": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "content"
                            ],
                            "nullable": true
                          },
                          "content": {
                            "type": "string",
                            "nullable": true
                          },
                          "artifact": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "output": {
                                "type": "string"
                              },
                              "chatId": {
                                "type": "string"
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "artifactType": {
                                "type": "string"
                              },
                              "chatFilePathPrefix": {
                                "type": "string"
                              },
                              "experimentalArtifactId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "output",
                              "chatId",
                              "contentType",
                              "artifactType"
                            ],
                            "nullable": true
                          },
                          "reasoning": {
                            "type": "string",
                            "nullable": true
                          }
                        },
                        "required": [
                          "at"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "input": "Hi",
                      "at": "2026-04-06T07:15:33Z"
                    },
                    {
                      "tool": {
                        "id": "id-1",
                        "functionName": "call_create_artifact",
                        "functionArguments": "\n{}\n",
                        "content": "{\"id\":\"00000000-0000-0000-0000-000000000001\",\"pathPrefix\":\"/experimental/1/\"}",
                        "status": "OK",
                        "targetFunction": "func_create_artifact",
                        "toolTarget": {
                          "id": "00000000-0000-0000-0000-000000000001",
                          "type": "ExperimentalKnowledgeBase",
                          "name": "experimental_knowledge_base_17"
                        }
                      },
                      "at": "2026-04-06T07:15:33Z"
                    },
                    {
                      "artifact": {
                        "id": "00000000-0000-0000-0000-000000000001",
                        "output": "# OK",
                        "chatId": "00000000-0000-0000-0000-000000000001",
                        "chatFilePathPrefix": "/experimental/1/",
                        "contentType": "EXPERIMENTAL",
                        "artifactType": "EXPERIMENTAL",
                        "experimentalArtifactId": "00000000-0000-0000-0000-000000000001"
                      },
                      "at": "2026-04-06T07:15:33Z"
                    },
                    {
                      "content": "done",
                      "at": "2026-04-06T07:15:33Z"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/form_interfaces": {
      "get": {
        "summary": "index",
        "tags": [
          "FormInterface"
        ],
        "responses": {
          "200": {
            "description": "List of form interfaces with input validation applied",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "promptTemplate": {
                                "type": "string"
                              },
                              "formJsonSchema": {
                                "type": "string"
                              },
                              "formUiSchema": {
                                "type": "string",
                                "nullable": true
                              },
                              "useTextResource": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "agentId",
                              "name",
                              "promptTemplate",
                              "formJsonSchema",
                              "formUiSchema",
                              "useTextResource"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "project": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "description": {
                                "nullable": true
                              },
                              "useRuntimeTextResource": {
                                "type": "boolean"
                              },
                              "useParentSegment": {
                                "type": "boolean"
                              },
                              "useWorkflowExecutor": {
                                "type": "boolean"
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "managedType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name"
                            ]
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "formInterfaces": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "id"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "formInterfaces"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [],
                  "meta": {
                    "total": 0
                  },
                  "links": {
                    "first": "http://www.example.com/api/form_interfaces?filter%5Bname%5D=clean_nameinjection&filter%5Bproject_id%5D=00000000-0000-0000-0000-000000000001&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/form_interfaces?filter%5Bname%5D=clean_nameinjection&filter%5Bproject_id%5D=00000000-0000-0000-0000-000000000001&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "projects",
                      "links": {
                        "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "name": "schfbjqu",
                        "description": null,
                        "useRuntimeTextResource": false,
                        "useParentSegment": false,
                        "useWorkflowExecutor": false,
                        "isManaged": false,
                        "managedType": "NONE"
                      },
                      "relationships": {
                        "formInterfaces": {
                          "data": [
                            {
                              "type": "formInterfaces",
                              "id": "00000000-0000-0000-0000-000000000001"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "projects",
                      "links": {
                        "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "name": "amdfoeyh",
                        "description": null,
                        "useRuntimeTextResource": false,
                        "useParentSegment": false,
                        "useWorkflowExecutor": false,
                        "isManaged": false,
                        "managedType": "NONE"
                      },
                      "relationships": {
                        "formInterfaces": {
                          "data": [
                            {
                              "type": "formInterfaces",
                              "id": "00000000-0000-0000-0000-000000000001"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "clean_nameinjection"
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "project"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "FormInterface"
        ],
        "responses": {
          "201": {
            "description": "Form interface successfully created",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "promptTemplate": {
                              "type": "string"
                            },
                            "formJsonSchema": {
                              "type": "string"
                            },
                            "formUiSchema": {
                              "nullable": true,
                              "type": "string"
                            },
                            "useTextResource": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "promptTemplate",
                            "formJsonSchema",
                            "formUiSchema",
                            "useTextResource"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "formInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "clean name",
                      "promptTemplate": "test prompt",
                      "formJsonSchema": "{\"type\": \"object\", \"properties\": {\"name\": {\"type\": \"string\"}}}",
                      "formUiSchema": null,
                      "useTextResource": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/form_interfaces rejects {\"createdAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "createdAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/form_interfaces rejects {\"formUiSchema\":\"{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 15000 characters)",
                      "detail": "formUiSchema - is too long (maximum is 15000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/formUiSchema"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "promptTemplate": {
                            "type": "string"
                          },
                          "formJsonSchema": {
                            "type": "string"
                          },
                          "formUiSchema": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "projectId",
                          "agentId",
                          "name",
                          "promptTemplate",
                          "formJsonSchema"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "form_interfaces",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "name": "clean name",
                    "promptTemplate": "test prompt",
                    "formJsonSchema": "{\"type\": \"object\", \"properties\": {\"name\": {\"type\": \"string\"}}}",
                    "formUiSchema": "{\"ui:title\": \"Title\", \"ui:description\": \"Description\", \"ui:classNames\": \"my-class\", \"ui:submitButtonOptions\": {\"props\": {\"disabled\": false,\"className\": \"btn btn-info\"}}}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/form_interfaces/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "FormInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Form interface deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Form interface not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "FormInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Form interface details and configuration",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "promptTemplate": {
                              "type": "string"
                            },
                            "formJsonSchema": {
                              "type": "string"
                            },
                            "formUiSchema": {
                              "type": "string",
                              "nullable": true
                            },
                            "useTextResource": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "promptTemplate",
                            "formJsonSchema",
                            "formUiSchema",
                            "useTextResource"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "formInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "eaxhrdyr",
                      "promptTemplate": "This is a test prompt template that parses arguments. subject: {{subject}}. topic: {{topic}}.",
                      "formJsonSchema": "{\"type\":\"object\",\"properties\":{\"subject\":{\"type\":\"string\",\"title\":\"Subject\"},\"topic\":{\"title\":\"Topic\",\"type\":\"string\"}},\"required\":[]}",
                      "formUiSchema": null,
                      "useTextResource": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Form interface not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "FormInterface"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Form interface updated successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "promptTemplate": {
                              "type": "string"
                            },
                            "formJsonSchema": {
                              "type": "string"
                            },
                            "formUiSchema": {
                              "type": "string",
                              "nullable": true
                            },
                            "useTextResource": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "promptTemplate",
                            "formJsonSchema",
                            "formUiSchema",
                            "useTextResource"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "formInterfaces",
                    "links": {
                      "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "updated name",
                      "promptTemplate": "update_prompt_template",
                      "formJsonSchema": "{\"type\":\"object\",\"properties\":{\"subject\":{\"type\":\"string\",\"title\":\"Subject\"},\"topic\":{\"title\":\"Topic\",\"type\":\"string\"}},\"required\":[]}",
                      "formUiSchema": null,
                      "useTextResource": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/form_interfaces rejects {\"createdAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "createdAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/form_interfaces/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Validation error - invalid request body",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 15000 characters)",
                      "detail": "formUiSchema - is too long (maximum is 15000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/formUiSchema"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "promptTemplate": {
                            "type": "string"
                          },
                          "formJsonSchema": {
                            "type": "string"
                          },
                          "formUiSchema": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "projectId",
                          "agentId",
                          "name",
                          "promptTemplate"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "form_interfaces",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "name": "updated name",
                    "promptTemplate": "update_prompt_template",
                    "formJsonSchema": "{\"type\": \"object\", \"properties\": {\"name\": {\"type\": \"string\"}}}",
                    "formUiSchema": "{\"ui:title\": \"Title\", \"ui:description\": \"Description\", \"ui:classNames\": \"my-class\", \"ui:submitButtonOptions\": {\"props\": {\"disabled\": false,\"className\": \"btn btn-info\"}}}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/image_generators": {
      "post": {
        "summary": "create",
        "tags": [
          "ImageGenerator"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "imageModelType": {
                            "type": "string"
                          },
                          "imageReturnMode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "projectId",
                          "name",
                          "imageModelType",
                          "imageReturnMode"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "imageGenerators",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Sample Image Generator",
                    "imageModelType": "nova-canvas",
                    "imageReturnMode": "ID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "creates a new ImageGenerator",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "imageModelType": {
                              "type": "string"
                            },
                            "imageReturnMode": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "imageModelType",
                            "imageReturnMode",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "imageGenerators",
                    "links": {
                      "self": "http://www.example.com/api/image_generators/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Sample Image Generator",
                      "imageModelType": "nova-canvas",
                      "imageReturnMode": "ID",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/image_generators rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "POST /api/image_generators rejects {\"imageReturnMode\":null}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is not included in the list",
                      "detail": "imageReturnMode - is not included in the list",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/imageReturnMode"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/image_generators/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "ImageGenerator"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Image generator deleted successfully"
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "ImageGenerator"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the details of a specific image_generator",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "imageModelType": {
                              "type": "string"
                            },
                            "imageReturnMode": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "imageModelType",
                            "imageReturnMode",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "imageGenerators",
                    "links": {
                      "self": "http://www.example.com/api/image_generators/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "GenDetail",
                      "imageModelType": "nova-canvas",
                      "imageReturnMode": "ID",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "ImageGenerator"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates the image_generator",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "imageModelType": {
                              "type": "string"
                            },
                            "imageReturnMode": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "imageModelType",
                            "imageReturnMode",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "imageGenerators",
                    "links": {
                      "self": "http://www.example.com/api/image_generators/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Updated Name",
                      "imageModelType": "nova-canvas",
                      "imageReturnMode": "ID",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/image_generators rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/image_generators rejects {\"imageReturnMode\":null}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is not included in the list",
                      "detail": "imageReturnMode - is not included in the list",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/imageReturnMode"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "imageGenerators",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "Updated Name"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations": {
      "get": {
        "summary": "index",
        "tags": [
          "Integration"
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/integrations",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "serviceType": {
                                "type": "string"
                              },
                              "actions": {
                                "type": "array",
                                "items": {}
                              },
                              "webhookAuthorizationUsername": {
                                "type": "string",
                                "nullable": true
                              },
                              "webhookAuthorizationPassword": {
                                "type": "string",
                                "nullable": true
                              },
                              "webhookAuthorizationHeader": {
                                "type": "string"
                              },
                              "webhookCorsOrigins": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "origin": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "origin"
                                  ]
                                },
                                "nullable": true
                              },
                              "slackSigningSecret": {
                                "type": "string",
                                "nullable": true
                              },
                              "slackMessageMode": {
                                "type": "string"
                              },
                              "chatIgnoreManagedActions": {
                                "type": "boolean"
                              },
                              "chatWelcomeMessage": {
                                "nullable": true
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "isManaged",
                              "serviceType",
                              "actions",
                              "webhookAuthorizationUsername",
                              "webhookAuthorizationPassword",
                              "webhookAuthorizationHeader",
                              "webhookCorsOrigins",
                              "slackSigningSecret",
                              "slackMessageMode",
                              "chatIgnoreManagedActions",
                              "chatWelcomeMessage"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "integrations",
                      "links": {
                        "self": "http://www.example.com/api/integrations/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "isManaged": true,
                        "serviceType": "WEBHOOK",
                        "actions": [],
                        "webhookAuthorizationUsername": "v0",
                        "webhookAuthorizationPassword": "<WEBHOOK_PASSWORD>",
                        "webhookAuthorizationHeader": "Basic <BASE64_CREDENTIALS>",
                        "webhookCorsOrigins": null,
                        "slackSigningSecret": null,
                        "slackMessageMode": "in_channel",
                        "chatIgnoreManagedActions": false,
                        "chatWelcomeMessage": null
                      }
                    }
                  ],
                  "meta": {
                    "total": 1
                  },
                  "links": {
                    "first": "http://www.example.com/api/integrations?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/integrations?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "Integration"
        ],
        "responses": {
          "201": {
            "description": "Integration successfully created",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "serviceType": {
                              "type": "string"
                            },
                            "actions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "promptId": {
                                    "type": "string"
                                  },
                                  "chatWidgetType": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "chatWidgetLabel": {
                                    "nullable": true
                                  },
                                  "uiTags": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "webhookTextUrl": {
                                    "nullable": true,
                                    "type": "string"
                                  },
                                  "slackRequestUrl": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "promptId",
                                  "chatWidgetType",
                                  "chatWidgetLabel",
                                  "uiTags",
                                  "webhookTextUrl",
                                  "slackRequestUrl"
                                ]
                              }
                            },
                            "webhookAuthorizationUsername": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationPassword": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationHeader": {
                              "type": "string"
                            },
                            "webhookCorsOrigins": {
                              "nullable": true
                            },
                            "slackSigningSecret": {
                              "nullable": true
                            },
                            "slackMessageMode": {
                              "type": "string"
                            },
                            "chatIgnoreManagedActions": {
                              "type": "boolean"
                            },
                            "chatWelcomeMessage": {
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "isManaged",
                            "serviceType",
                            "actions",
                            "webhookAuthorizationUsername",
                            "webhookAuthorizationPassword",
                            "webhookAuthorizationHeader",
                            "webhookCorsOrigins",
                            "slackSigningSecret",
                            "slackMessageMode",
                            "chatIgnoreManagedActions",
                            "chatWelcomeMessage"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "integrations",
                    "links": {
                      "self": "http://www.example.com/api/integrations/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "isManaged": false,
                      "serviceType": "WEBHOOK",
                      "actions": [
                        {
                          "promptId": "00000000-0000-0000-0000-000000000001",
                          "chatWidgetType": null,
                          "chatWidgetLabel": null,
                          "uiTags": [],
                          "webhookTextUrl": "http://localhost:3000/api/actions/00000000-0000-0000-0000-000000000001/text",
                          "slackRequestUrl": null
                        }
                      ],
                      "webhookAuthorizationUsername": "v0",
                      "webhookAuthorizationPassword": "<WEBHOOK_PASSWORD>",
                      "webhookAuthorizationHeader": "Basic <BASE64_CREDENTIALS>",
                      "webhookCorsOrigins": null,
                      "slackSigningSecret": null,
                      "slackMessageMode": "in_channel",
                      "chatIgnoreManagedActions": false,
                      "chatWelcomeMessage": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects POST /api/integrations",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "Validation error - invalid action configuration provided",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 10 characters)",
                      "detail": "webhookCorsOrigins - is too long (maximum is 10 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/webhookCorsOrigins"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "serviceType": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "promptId": {
                                  "type": "string"
                                },
                                "chatWidgetType": {
                                  "type": "string"
                                },
                                "uiTags": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "promptId"
                              ]
                            }
                          }
                        },
                        "required": [
                          "serviceType",
                          "projectId",
                          "actions"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "integrations",
                  "attributes": {
                    "serviceType": "WEBHOOK",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "actions": [
                      {
                        "promptId": "00000000-0000-0000-0000-000000000001"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "Integration"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Integration deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions to delete this integration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Integration not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "Integration"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/integrations/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "serviceType": {
                              "type": "string"
                            },
                            "actions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "promptId": {
                                    "type": "string"
                                  },
                                  "chatWidgetType": {
                                    "nullable": true
                                  },
                                  "chatWidgetLabel": {
                                    "nullable": true
                                  },
                                  "uiTags": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "webhookTextUrl": {
                                    "type": "string"
                                  },
                                  "slackRequestUrl": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "promptId",
                                  "chatWidgetType",
                                  "chatWidgetLabel",
                                  "uiTags",
                                  "webhookTextUrl",
                                  "slackRequestUrl"
                                ]
                              }
                            },
                            "webhookAuthorizationUsername": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationPassword": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationHeader": {
                              "type": "string"
                            },
                            "webhookCorsOrigins": {
                              "nullable": true,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "origin": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "origin"
                                ]
                              }
                            },
                            "slackSigningSecret": {
                              "type": "string",
                              "nullable": true
                            },
                            "slackMessageMode": {
                              "type": "string"
                            },
                            "chatIgnoreManagedActions": {
                              "type": "boolean"
                            },
                            "chatWelcomeMessage": {
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "isManaged",
                            "serviceType",
                            "actions",
                            "webhookAuthorizationUsername",
                            "webhookAuthorizationPassword",
                            "webhookAuthorizationHeader",
                            "webhookCorsOrigins",
                            "slackSigningSecret",
                            "slackMessageMode",
                            "chatIgnoreManagedActions",
                            "chatWelcomeMessage"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "integrations",
                    "links": {
                      "self": "http://www.example.com/api/integrations/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "isManaged": true,
                      "serviceType": "WEBHOOK",
                      "actions": [],
                      "webhookAuthorizationUsername": "v0",
                      "webhookAuthorizationPassword": "<WEBHOOK_PASSWORD>",
                      "webhookAuthorizationHeader": "Basic <BASE64_CREDENTIALS>",
                      "webhookCorsOrigins": null,
                      "slackSigningSecret": null,
                      "slackMessageMode": "in_channel",
                      "chatIgnoreManagedActions": false,
                      "chatWelcomeMessage": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "GET /api/integrations/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "Integration"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates an integration's updated_at field when actions are updated",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "serviceType": {
                              "type": "string"
                            },
                            "actions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "promptId": {
                                    "type": "string"
                                  },
                                  "chatWidgetType": {
                                    "nullable": true
                                  },
                                  "chatWidgetLabel": {
                                    "nullable": true
                                  },
                                  "uiTags": {
                                    "type": "array",
                                    "items": {}
                                  },
                                  "webhookTextUrl": {
                                    "type": "string"
                                  },
                                  "slackRequestUrl": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "promptId",
                                  "chatWidgetType",
                                  "chatWidgetLabel",
                                  "uiTags",
                                  "webhookTextUrl",
                                  "slackRequestUrl"
                                ]
                              }
                            },
                            "webhookAuthorizationUsername": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationPassword": {
                              "nullable": true,
                              "type": "string"
                            },
                            "webhookAuthorizationHeader": {
                              "type": "string"
                            },
                            "webhookCorsOrigins": {
                              "nullable": true
                            },
                            "slackSigningSecret": {
                              "type": "string",
                              "nullable": true
                            },
                            "slackMessageMode": {
                              "type": "string"
                            },
                            "chatIgnoreManagedActions": {
                              "type": "boolean"
                            },
                            "chatWelcomeMessage": {
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "isManaged",
                            "serviceType",
                            "actions",
                            "webhookAuthorizationUsername",
                            "webhookAuthorizationPassword",
                            "webhookAuthorizationHeader",
                            "webhookCorsOrigins",
                            "slackSigningSecret",
                            "slackMessageMode",
                            "chatIgnoreManagedActions",
                            "chatWelcomeMessage"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "integrations",
                    "links": {
                      "self": "http://www.example.com/api/integrations/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "isManaged": false,
                      "serviceType": "WEBHOOK",
                      "actions": [
                        {
                          "promptId": "00000000-0000-0000-0000-000000000001",
                          "chatWidgetType": null,
                          "chatWidgetLabel": null,
                          "uiTags": [],
                          "webhookTextUrl": "http://localhost:3000/api/actions/00000000-0000-0000-0000-000000000001/text",
                          "slackRequestUrl": null
                        }
                      ],
                      "webhookAuthorizationUsername": "v0",
                      "webhookAuthorizationPassword": "<WEBHOOK_PASSWORD>",
                      "webhookAuthorizationHeader": "Basic <BASE64_CREDENTIALS>",
                      "webhookCorsOrigins": null,
                      "slackSigningSecret": null,
                      "slackMessageMode": "in_channel",
                      "chatIgnoreManagedActions": false,
                      "chatWelcomeMessage": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects PATCH /api/integrations/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/integrations/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "rejects duplicated unique name",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "has already been taken",
                      "detail": "actions/1/promptId - has already been taken",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/actions/1/promptId"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "VIOLATES_UNIQUENESS_CONSTRAINT"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "serviceType": {
                            "type": "string"
                          },
                          "slackSigningSecret": {
                            "type": "string"
                          },
                          "slackMessageMode": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "promptId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "promptId"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "integrations",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "serviceType": "SLACK",
                    "slackSigningSecret": "xxx",
                    "slackMessageMode": "in_channel",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "actions": [
                      {
                        "promptId": "00000000-0000-0000-0000-000000000001"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/knowledge_bases": {
      "get": {
        "summary": "index",
        "tags": [
          "KnowledgeBase"
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/knowledge_bases",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "tdDatabaseName": {
                                "type": "string"
                              },
                              "formatType": {
                                "type": "string"
                              },
                              "maxRows": {
                                "type": "integer"
                              },
                              "timeoutSeconds": {
                                "type": "integer"
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "tables": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "tdQuery": {
                                      "type": "string"
                                    },
                                    "enableData": {
                                      "type": "boolean"
                                    },
                                    "enableDataIndex": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "tdQuery",
                                    "enableData",
                                    "enableDataIndex"
                                  ]
                                }
                              },
                              "lastJob": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "nullable": true
                                  },
                                  "finishedAt": {
                                    "nullable": true
                                  },
                                  "logs": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "status",
                                  "message",
                                  "finishedAt",
                                  "logs"
                                ],
                                "nullable": true
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "name",
                              "tdDatabaseName",
                              "formatType",
                              "maxRows",
                              "timeoutSeconds",
                              "isManaged",
                              "tables",
                              "lastJob"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "knowledgeBases",
                      "links": {
                        "self": "http://www.example.com/api/knowledge_bases/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "ygpozuds",
                        "tdDatabaseName": "dhjcmdvy",
                        "formatType": "LEGACY_JSON",
                        "maxRows": 50,
                        "timeoutSeconds": 60,
                        "isManaged": true,
                        "tables": [],
                        "lastJob": {
                          "status": "IN_PROGRESS",
                          "message": null,
                          "finishedAt": null,
                          "logs": null
                        }
                      }
                    }
                  ],
                  "meta": {
                    "total": 1
                  },
                  "links": {
                    "first": "http://www.example.com/api/knowledge_bases?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/knowledge_bases?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "KnowledgeBase"
        ],
        "responses": {
          "201": {
            "description": "Knowledge base created successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "tdDatabaseName": {
                              "type": "string"
                            },
                            "formatType": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "tables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "tdQuery": {
                                    "type": "string"
                                  },
                                  "enableData": {
                                    "type": "boolean"
                                  },
                                  "enableDataIndex": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "name",
                                  "tdQuery",
                                  "enableData",
                                  "enableDataIndex"
                                ]
                              }
                            },
                            "lastJob": {
                              "nullable": true,
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string"
                                },
                                "message": {
                                  "nullable": true
                                },
                                "finishedAt": {
                                  "nullable": true
                                },
                                "logs": {
                                  "nullable": true
                                }
                              },
                              "required": [
                                "status",
                                "message",
                                "finishedAt",
                                "logs"
                              ]
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "tdDatabaseName",
                            "formatType",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged",
                            "tables",
                            "lastJob"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "knowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "name1",
                      "tdDatabaseName": "db1",
                      "formatType": "LEGACY_JSON",
                      "maxRows": 50,
                      "timeoutSeconds": 60,
                      "isManaged": false,
                      "tables": [
                        {
                          "name": "tbl1",
                          "tdQuery": "select 1",
                          "enableData": false,
                          "enableDataIndex": false
                        }
                      ],
                      "lastJob": {
                        "status": "IN_PROGRESS",
                        "message": null,
                        "finishedAt": null,
                        "logs": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects POST /api/knowledge_bases",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/knowledge_bases rejects {\"formatType\":\"MARKDOWN_KV\",\"timeoutSeconds\":700}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be in 10..300",
                      "detail": "timeoutSeconds - must be in 10..300",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/timeoutSeconds"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    },
                    {
                      "title": "can be set only if format type is LEGACY_JSON",
                      "detail": "tables - can be set only if format type is LEGACY_JSON",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/tables"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_KNOWLEDGE_BASE_TABLES_AVAILABLE_ONLY_WITH_LEGACY_JSON"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "tdDatabaseName": {
                            "type": "string"
                          },
                          "formatType": {
                            "type": "string"
                          },
                          "tables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "tdQuery": {
                                  "type": "string"
                                },
                                "enableData": {
                                  "type": "boolean"
                                },
                                "enableDataIndex": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "name",
                                "tdQuery",
                                "enableData",
                                "enableDataIndex"
                              ]
                            }
                          }
                        },
                        "required": [
                          "name",
                          "tdDatabaseName",
                          "projectId"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "knowledge_bases",
                  "attributes": {
                    "name": "name1",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "tdDatabaseName": "db1",
                    "formatType": "MARKDOWN_KV",
                    "tables": [
                      {
                        "name": "tbl1",
                        "tdQuery": "select 1",
                        "enableData": false,
                        "enableDataIndex": false
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/knowledge_bases/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "KnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "submits a RAG REMOVE job even with formatType=MARKDOWN_KV"
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "rejects DELETE /api/knowledge_bases/:id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "DELETE /api/knowledge_bases/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "restricts deletion of a knowledge base if it is referenced by a variable",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              },
                              "referencedByTools": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              },
                              "referencedByVariables": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Cannot delete record because dependent referenced by variables exist",
                      "detail": "Cannot delete record because dependent referenced by variables exist",
                      "code": "100",
                      "source": {
                        "pointer": "/data"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "DEPENDENT_DESTROY_RESTRICTED_HAS_MANY",
                        "referencedByVariables": [
                          {
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "KnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base details and configuration",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "tdDatabaseName": {
                              "type": "string"
                            },
                            "formatType": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "tables": {
                              "type": "array",
                              "items": {}
                            },
                            "lastJob": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string"
                                },
                                "message": {
                                  "nullable": true
                                },
                                "finishedAt": {
                                  "nullable": true
                                },
                                "logs": {
                                  "nullable": true
                                }
                              },
                              "required": [
                                "status",
                                "message",
                                "finishedAt",
                                "logs"
                              ]
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "tdDatabaseName",
                            "formatType",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged",
                            "tables",
                            "lastJob"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "knowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "sfimdaoe",
                      "tdDatabaseName": "awqjtevx",
                      "formatType": "LEGACY_JSON",
                      "maxRows": 50,
                      "timeoutSeconds": 60,
                      "isManaged": true,
                      "tables": [],
                      "lastJob": {
                        "status": "IN_PROGRESS",
                        "message": null,
                        "finishedAt": null,
                        "logs": null
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Knowledge base not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "KnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base updated successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "tdDatabaseName": {
                              "type": "string"
                            },
                            "formatType": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "tables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "tdQuery": {
                                    "type": "string"
                                  },
                                  "enableData": {
                                    "type": "boolean"
                                  },
                                  "enableDataIndex": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "name",
                                  "tdQuery",
                                  "enableData",
                                  "enableDataIndex"
                                ]
                              }
                            },
                            "lastJob": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string"
                                },
                                "message": {
                                  "nullable": true
                                },
                                "finishedAt": {
                                  "nullable": true
                                },
                                "logs": {
                                  "nullable": true
                                }
                              },
                              "required": [
                                "status",
                                "message",
                                "finishedAt",
                                "logs"
                              ]
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "tdDatabaseName",
                            "formatType",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged",
                            "tables",
                            "lastJob"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "knowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "new_name",
                      "tdDatabaseName": "new_db",
                      "formatType": "LEGACY_JSON",
                      "maxRows": 50,
                      "timeoutSeconds": 60,
                      "isManaged": false,
                      "tables": [
                        {
                          "name": "tab",
                          "tdQuery": "select 1 from ttt",
                          "enableData": false,
                          "enableDataIndex": false
                        }
                      ],
                      "lastJob": {
                        "status": "IN_PROGRESS",
                        "message": null,
                        "finishedAt": null,
                        "logs": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects PATCH /api/knowledge_bases/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/knowledge_bases/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/knowledge_bases rejects {\"formatType\":\"MARKDOWN_KV\",\"timeoutSeconds\":700}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be in 10..300",
                      "detail": "timeoutSeconds - must be in 10..300",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/timeoutSeconds"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    },
                    {
                      "title": "can be set only if format type is LEGACY_JSON",
                      "detail": "tables - can be set only if format type is LEGACY_JSON",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/tables"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_KNOWLEDGE_BASE_TABLES_AVAILABLE_ONLY_WITH_LEGACY_JSON"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "tdDatabaseName": {
                            "type": "string"
                          },
                          "tables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "tdQuery": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "tdQuery"
                              ]
                            }
                          },
                          "projectId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "tdDatabaseName",
                          "tables"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "knowledge_bases",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "new_name",
                    "tdDatabaseName": "new_db",
                    "tables": [
                      {
                        "name": "tab",
                        "tdQuery": "select 1 from ttt"
                      }
                    ],
                    "projectId": "00000000-0000-0000-0000-000000000001"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/knowledge_bases/{id}/query": {
      "post": {
        "summary": "query",
        "tags": [
          "KnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "function": {
                    "type": "string"
                  },
                  "arguments": {
                    "type": "object",
                    "properties": {
                      "query": {
                        "type": "string"
                      },
                      "keywords": {
                        "type": "string"
                      },
                      "tables": {
                        "nullable": true,
                        "type": "string"
                      },
                      "statement": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "function",
                  "arguments"
                ]
              },
              "example": {
                "function": "QUERY_DATA_DIRECT",
                "arguments": {
                  "query": "test query",
                  "keywords": "kwd",
                  "tables": null,
                  "statement": "select * from tab1"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "formats using formatType=MARKDOWN_KV with a truncated message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "content"
                  ]
                },
                "example": {
                  "content": "# Records\n\n## Record 1\n\n```\nc1: 0\nc2: t-0\n```\n\n## Record 2\n\n```\nc1: 1\nc2: t-1\n```\n\n## Record 3\n\n```\nc1: 2\nc2: t-2\n```\n\n## Record 4\n\n```\nc1: 3\nc2: t-3\n```\n\n## Record 5\n\n```\nc1: 4\nc2: t-4\n```\n\n## Record 6\n\n```\nc1: 5\nc2: t-5\n```\n\n## Record 7\n\n```\nc1: 6\nc2: t-6\n```\n\n## Record 8\n\n```\nc1: 7\nc2: t-7\n```\n\n## Record 9\n\n```\nc1: 8\nc2: t-8\n```\n\n## Record 10\n\n```\nc1: 9\nc2: t-9\n```\n\n## Record 11\n\n```\nc1: 10\nc2: t-10\n```\n\n## Record 12\n\n```\nc1: 11\nc2: t-11\n```\n\n## Record 13\n\n```\nc1: 12\nc2: t-12\n```\n\n## Record 14\n\n```\nc1: 13\nc2: t-13\n```\n\n## Record 15\n\n```\nc1: 14\nc2: t-14\n```\n\n## Record 16\n\n```\nc1: 15\nc2: t-15\n```\n\n## Record 17\n\n```\nc1: 16\nc2: t-16\n```\n\n## Record 18\n\n```\nc1: 17\nc2: t-17\n```\n\n## Record 19\n\n```\nc1: 18\nc2: t-18\n```\n\n## Record 20\n\n```\nc1: 19\nc2: t-19\n```\n\n## Record 21\n\n```\nc1: 20\nc2: t-20\n```\n\n## Record 22\n\n```\nc1: 21\nc2: t-21\n```\n\n## Record 23\n\n```\nc1: 22\nc2: t-22\n```\n\n## Record 24\n\n```\nc1: 23\nc2: t-23\n```\n\n## Record 25\n\n```\nc1: 24\nc2: t-24\n```\n\n## Record 26\n\n```\nc1: 25\nc2: t-25\n```\n\n## Record 27\n\n```\nc1: 26\nc2: t-26\n```\n\n## Record 28\n\n```\nc1: 27\nc2: t-27\n```\n\n## Record 29\n\n```\nc1: 28\nc2: t-28\n```\n\n## Record 30\n\n```\nc1: 29\nc2: t-29\n```\n\n## Record 31\n\n```\nc1: 30\nc2: t-30\n```\n\n## Record 32\n\n```\nc1: 31\nc2: t-31\n```\n\n## Record 33\n\n```\nc1: 32\nc2: t-32\n```\n\n## Record 34\n\n```\nc1: 33\nc2: t-33\n```\n\n## Record 35\n\n```\nc1: 34\nc2: t-34\n```\n\n## Record 36\n\n```\nc1: 35\nc2: t-35\n```\n\n## Record 37\n\n```\nc1: 36\nc2: t-36\n```\n\n## Record 38\n\n```\nc1: 37\nc2: t-37\n```\n\n## Record 39\n\n```\nc1: 38\nc2: t-38\n```\n\n## Record 40\n\n```\nc1: 39\nc2: t-39\n```\n\n## Record 41\n\n```\nc1: 40\nc2: t-40\n```\n\n## Record 42\n\n```\nc1: 41\nc2: t-41\n```\n\n## Record 43\n\n```\nc1: 42\nc2: t-42\n```\n\n## Record 44\n\n```\nc1: 43\nc2: t-43\n```\n\n## Record 45\n\n```\nc1: 44\nc2: t-44\n```\n\n## Record 46\n\n```\nc1: 45\nc2: t-45\n```\n\n## Record 47\n\n```\nc1: 46\nc2: t-46\n```\n\n## Record 48\n\n```\nc1: 47\nc2: t-47\n```\n\n## Record 49\n\n```\nc1: 48\nc2: t-48\n```\n\n## Record 50\n\n```\nc1: 49\nc2: t-49\n```\n\n# Warning\n\n[TRUNCATED] Results limited to 50 rows. To retrieve more data, add pagination to your SQL query using OFFSET N LIMIT M (OFFSET must come before LIMIT), or add WHERE conditions to narrow the results.\n"
                }
              }
            }
          },
          "422": {
            "description": "rejects unknown function",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "422",
                  "error": "function must be LIST_COLUMNS, SEARCH_SCHEMA, QUERY_DATA_DIRECT"
                }
              }
            }
          }
        }
      }
    },
    "/api/plazma_query_tools": {
      "post": {
        "summary": "create",
        "tags": [
          "PlazmaQueryTool"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "maxRows": {
                            "type": "integer"
                          },
                          "timeoutSeconds": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "projectId",
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "plazmaQueryTools",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Minimal Plazma Tool",
                    "maxRows": 75,
                    "timeoutSeconds": 120
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "creates a new PlazmaQueryTool with minimal parameters (uses defaults)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "plazmaQueryTools",
                    "links": {
                      "self": "http://www.example.com/api/plazma_query_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Minimal Plazma Tool",
                      "maxRows": 50,
                      "timeoutSeconds": 60,
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/plazma_query_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "POST /api/plazma_query_tools rejects {\"timeoutSeconds\":60.5}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be an integer",
                      "detail": "timeoutSeconds - must be an integer",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/timeoutSeconds"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "NOT_AN_INTEGER"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/plazma_query_tools/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "PlazmaQueryTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "deletes a PlazmaQueryTool"
          },
          "404": {
            "description": "returns 404 when trying to delete non-existent PlazmaQueryTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "PlazmaQueryTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "retrieves a PlazmaQueryTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "plazmaQueryTools",
                    "links": {
                      "self": "http://www.example.com/api/plazma_query_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "TestPlazmaQuery",
                      "maxRows": 25,
                      "timeoutSeconds": 90,
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "returns 404 when PlazmaQueryTool doesn't exist",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "PlazmaQueryTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates only specified fields",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "maxRows": {
                              "type": "integer"
                            },
                            "timeoutSeconds": {
                              "type": "integer"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "maxRows",
                            "timeoutSeconds",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "plazmaQueryTools",
                    "links": {
                      "self": "http://www.example.com/api/plazma_query_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "TestPlazma Query",
                      "maxRows": 10,
                      "timeoutSeconds": 90,
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/plazma_query_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "validates updated values",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "must be in 1..100",
                      "detail": "maxRows - must be in 1..100",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/maxRows"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "INVALID_FORMAT_OR_ASSOCIATION"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "maxRows": {
                            "type": "integer"
                          },
                          "timeoutSeconds": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "maxRows"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "plazmaQueryTools",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "Updated Plazma Query Tool",
                    "maxRows": 10,
                    "timeoutSeconds": 180
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/presentation_artifact_tools": {
      "post": {
        "summary": "create",
        "tags": [
          "PresentationArtifactTool"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "projectId",
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "presentationArtifactTools",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Sample Slide Generator"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "creates a new PresentationArtifactTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "presentationArtifactTools",
                    "links": {
                      "self": "http://www.example.com/api/presentation_artifact_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Sample Slide Generator",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/presentation_artifact_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "POST /api/presentation_artifact_tools rejects {\"name\":\"\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "can't be blank",
                      "detail": "name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "can't be blank",
                      "detail": "toolTarget/name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/toolTarget/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/presentation_artifact_tools/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "PresentationArtifactTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "deletes a PresentationArtifactTool"
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "PresentationArtifactTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "retrieves a PresentationArtifactTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "presentationArtifactTools",
                    "links": {
                      "self": "http://www.example.com/api/presentation_artifact_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "TestSlideGen",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "returns 404 when PresentationArtifactTool doesn't exist",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "PresentationArtifactTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates a PresentationArtifactTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "presentationArtifactTools",
                    "links": {
                      "self": "http://www.example.com/api/presentation_artifact_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Updated Slide Generator",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/presentation_artifact_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/presentation_artifact_tools rejects {\"name\":\"\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "can't be blank",
                      "detail": "name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "can't be blank",
                      "detail": "toolTarget/name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/toolTarget/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "presentationArtifactTools",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "Updated Slide Generator"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/projects": {
      "get": {
        "summary": "index",
        "tags": [
          "Project"
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/projects",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "nullable": true
                              },
                              "useRuntimeTextResource": {
                                "type": "boolean"
                              },
                              "useParentSegment": {
                                "type": "boolean"
                              },
                              "useWorkflowExecutor": {
                                "type": "boolean"
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "managedType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "name",
                              "description",
                              "useRuntimeTextResource",
                              "useParentSegment",
                              "useWorkflowExecutor",
                              "isManaged",
                              "managedType"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "overview": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "formInterfaces": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "id"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "chatInterfaces": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "array",
                                    "items": {}
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "firstAgentName": {
                                "type": "string"
                              },
                              "firstIntegrationServiceType": {
                                "type": "string"
                              },
                              "firstKnowledgeBaseName": {
                                "type": "string"
                              },
                              "totalAgentCount": {
                                "type": "integer"
                              },
                              "totalIntegrationCount": {
                                "type": "integer"
                              },
                              "totalKnowledgeBaseCount": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string",
                                "nullable": true
                              },
                              "promptTemplate": {
                                "type": "string",
                                "nullable": true
                              },
                              "formJsonSchema": {
                                "type": "string",
                                "nullable": true
                              },
                              "formUiSchema": {
                                "nullable": true
                              },
                              "useTextResource": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "starterMessage": {
                                "type": "string",
                                "nullable": true
                              },
                              "textInputEnabled": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "textInputAgentId": {
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "chatInterfaceButtons": {
                                "type": "array",
                                "items": {},
                                "nullable": true
                              }
                            }
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "project": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "project"
                            ],
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "projects",
                      "links": {
                        "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "name": "cefwatpd",
                        "description": null,
                        "useRuntimeTextResource": false,
                        "useParentSegment": false,
                        "useWorkflowExecutor": false,
                        "isManaged": true,
                        "managedType": "PARENT_SEGMENT"
                      }
                    }
                  ],
                  "meta": {
                    "total": 1
                  },
                  "links": {
                    "first": "http://www.example.com/api/projects?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/projects?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "formInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "name": "ffyhntyh",
                        "promptTemplate": "This is a test prompt template that parses arguments. subject: {{subject}}. topic: {{topic}}.",
                        "formJsonSchema": "{\"type\":\"object\",\"properties\":{\"subject\":{\"type\":\"string\",\"title\":\"Subject\"},\"topic\":{\"title\":\"Topic\",\"type\":\"string\"}},\"required\":[]}",
                        "formUiSchema": null,
                        "useTextResource": false
                      },
                      "relationships": {
                        "project": {
                          "data": {
                            "type": "projects",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "formInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "name": "gkqnpzio",
                        "promptTemplate": "This is a test prompt template that parses arguments. subject: {{subject}}. topic: {{topic}}.",
                        "formJsonSchema": "{\"type\":\"object\",\"properties\":{\"subject\":{\"type\":\"string\",\"title\":\"Subject\"},\"topic\":{\"title\":\"Topic\",\"type\":\"string\"}},\"required\":[]}",
                        "formUiSchema": null,
                        "useTextResource": false
                      },
                      "relationships": {
                        "project": {
                          "data": {
                            "type": "projects",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "vznhgcqt",
                        "starterMessage": "",
                        "textInputEnabled": false,
                        "textInputAgentId": null,
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "fytqacsk",
                        "starterMessage": "",
                        "textInputEnabled": false,
                        "textInputAgentId": null,
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter[fulltext]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "nothing"
          },
          {
            "name": "filter[hasInterfaces]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "form,chat"
          },
          {
            "name": "filter[has_form_interfaces]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "false"
          },
          {
            "name": "filter[is_managed]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "false"
          },
          {
            "name": "filter[manage_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "PARENT_SEGMENT,PACKAGE"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "formInterfaces,chatInterfaces"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "Project"
        ],
        "responses": {
          "201": {
            "description": "creates a project with useWorkflowExecutor set to true",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "nullable": true,
                              "type": "string"
                            },
                            "useRuntimeTextResource": {
                              "type": "boolean"
                            },
                            "useParentSegment": {
                              "type": "boolean"
                            },
                            "useWorkflowExecutor": {
                              "type": "boolean"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "managedType": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "useRuntimeTextResource",
                            "useParentSegment",
                            "useWorkflowExecutor",
                            "isManaged",
                            "managedType"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "projects",
                    "links": {
                      "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "workflow_project",
                      "description": "project with workflow executor",
                      "useRuntimeTextResource": false,
                      "useParentSegment": false,
                      "useWorkflowExecutor": true,
                      "isManaged": false,
                      "managedType": "NONE"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects POST /api/projects",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "managedType is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "Validation error - invalid or conflicting parameters provided",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "has already been taken",
                      "detail": "name - has already been taken",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "VIOLATES_UNIQUENESS_CONSTRAINT"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "useRuntimeTextResource": {
                            "type": "boolean"
                          },
                          "useWorkflowExecutor": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "projects",
                  "attributes": {
                    "name": "workflow_project",
                    "description": "project with workflow executor",
                    "useRuntimeTextResource": true,
                    "useWorkflowExecutor": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Project deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions to delete this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "formInterfaces.createdBy,formInterfaces.updatedBy,chatInterfaces.createdBy,chatInterfaces.updatedBy"
          }
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/projects/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "nullable": true
                            },
                            "useRuntimeTextResource": {
                              "type": "boolean"
                            },
                            "useParentSegment": {
                              "type": "boolean"
                            },
                            "useWorkflowExecutor": {
                              "type": "boolean"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "managedType": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "useRuntimeTextResource",
                            "useParentSegment",
                            "useWorkflowExecutor",
                            "isManaged",
                            "managedType"
                          ]
                        },
                        "relationships": {
                          "type": "object",
                          "properties": {
                            "formInterfaces": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "data"
                              ]
                            },
                            "chatInterfaces": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "data"
                              ]
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ],
                            "nullable": true
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "updatedAt": {
                                "type": "string",
                                "nullable": true
                              },
                              "projectId": {
                                "type": "string",
                                "nullable": true
                              },
                              "agentId": {
                                "type": "string",
                                "nullable": true
                              },
                              "name": {
                                "type": "string"
                              },
                              "promptTemplate": {
                                "type": "string",
                                "nullable": true
                              },
                              "formJsonSchema": {
                                "type": "string",
                                "nullable": true
                              },
                              "formUiSchema": {
                                "nullable": true
                              },
                              "useTextResource": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "starterMessage": {
                                "type": "string",
                                "nullable": true
                              },
                              "textInputEnabled": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "textInputAgentId": {
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "chatInterfaceButtons": {
                                "type": "array",
                                "items": {},
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "name"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "project": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ],
                                "nullable": true
                              },
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "projects",
                    "links": {
                      "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "zqvusnib",
                      "description": null,
                      "useRuntimeTextResource": false,
                      "useParentSegment": false,
                      "useWorkflowExecutor": false,
                      "isManaged": true,
                      "managedType": "PARENT_SEGMENT"
                    },
                    "relationships": {
                      "formInterfaces": {
                        "data": [
                          {
                            "type": "formInterfaces",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        ]
                      },
                      "chatInterfaces": {
                        "data": [
                          {
                            "type": "chatInterfaces",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        ]
                      }
                    }
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "formInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/form_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "name": "snyxrfzb",
                        "promptTemplate": "This is a test prompt template that parses arguments. subject: {{subject}}. topic: {{topic}}.",
                        "formJsonSchema": "{\"type\":\"object\",\"properties\":{\"subject\":{\"type\":\"string\",\"title\":\"Subject\"},\"topic\":{\"title\":\"Topic\",\"type\":\"string\"}},\"required\":[]}",
                        "formUiSchema": null,
                        "useTextResource": false
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "project": {
                          "data": {
                            "type": "projects",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "chatInterfaces",
                      "links": {
                        "self": "http://www.example.com/api/chat_interfaces/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "zqtzwrlp",
                        "starterMessage": "",
                        "textInputEnabled": false,
                        "textInputAgentId": null,
                        "isManaged": false,
                        "chatInterfaceButtons": []
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "GET /api/projects/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates a project with and toggles the managed RuntimeTextResourceKnowledgeBase",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "nullable": true,
                              "type": "string"
                            },
                            "useRuntimeTextResource": {
                              "type": "boolean"
                            },
                            "useParentSegment": {
                              "type": "boolean"
                            },
                            "useWorkflowExecutor": {
                              "type": "boolean"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "managedType": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "useRuntimeTextResource",
                            "useParentSegment",
                            "useWorkflowExecutor",
                            "isManaged",
                            "managedType"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "projects",
                    "links": {
                      "self": "http://www.example.com/api/projects/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "new-name",
                      "description": null,
                      "useRuntimeTextResource": false,
                      "useParentSegment": false,
                      "useWorkflowExecutor": false,
                      "isManaged": false,
                      "managedType": "NONE"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects PATCH /api/projects/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "managedType is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/projects/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/projects rejects {\"description\":\"<BASE64_CONTENT>\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 2000 characters)",
                      "detail": "description - is too long (maximum is 2000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/description"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "useRuntimeTextResource": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "projects",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "new-name",
                    "description": "new-description",
                    "useRuntimeTextResource": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/prompts": {
      "get": {
        "summary": "index",
        "tags": [
          "Prompt"
        ],
        "responses": {
          "200": {
            "description": "allows GET /api/prompts",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "systemPrompt": {
                                "type": "string"
                              },
                              "template": {
                                "type": "string"
                              },
                              "isManaged": {
                                "type": "boolean"
                              },
                              "jsonSchemaHint": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "agentId",
                              "name",
                              "systemPrompt",
                              "template",
                              "isManaged",
                              "jsonSchemaHint"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "prompts",
                      "links": {
                        "self": "http://www.example.com/api/prompts/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "agentId": "00000000-0000-0000-0000-000000000001",
                        "name": "ypjzahsd",
                        "systemPrompt": "",
                        "template": "Prompt text: {{text}}",
                        "isManaged": true,
                        "jsonSchemaHint": "{\"type\":\"object\",\"properties\":{\"text\":{\"type\":\"string\"}}}"
                      }
                    }
                  ],
                  "meta": {
                    "total": 1
                  },
                  "links": {
                    "first": "http://www.example.com/api/prompts?page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/prompts?page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ]
      },
      "post": {
        "summary": "create",
        "tags": [
          "Prompt"
        ],
        "responses": {
          "201": {
            "description": "Prompt created successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "template": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "jsonSchemaHint": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "systemPrompt",
                            "template",
                            "isManaged",
                            "jsonSchemaHint"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "prompts",
                    "links": {
                      "self": "http://www.example.com/api/prompts/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "name1",
                      "systemPrompt": "",
                      "template": "{{text}}",
                      "isManaged": false,
                      "jsonSchemaHint": "{\"type\":\"object\",\"properties\":{\"text\":{\"type\":\"string\"}}}"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects POST /api/prompts",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/prompts rejects {\"systemPrompt\":\"<BASE64_CONTENT>\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 9000 characters)",
                      "detail": "systemPrompt - is too long (maximum is 9000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/systemPrompt"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "systemPrompt": {
                            "type": "string"
                          },
                          "template": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "agentId",
                          "template",
                          "projectId"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "prompts",
                  "attributes": {
                    "name": "name1",
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "systemPrompt": "<BASE64_CONTENT>",
                    "template": "{{text}}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/prompts/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "Prompt"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Prompt deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions to access this resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "403",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Prompt not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "Prompt"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Prompt details and configuration",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "template": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "jsonSchemaHint": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "systemPrompt",
                            "template",
                            "isManaged",
                            "jsonSchemaHint"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "prompts",
                    "links": {
                      "self": "http://www.example.com/api/prompts/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "bsfvrllg",
                      "systemPrompt": "",
                      "template": "Prompt text: {{text}}",
                      "isManaged": true,
                      "jsonSchemaHint": "{\"type\":\"object\",\"properties\":{\"text\":{\"type\":\"string\"}}}"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Prompt not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "Prompt"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Prompt updated successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "template": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "jsonSchemaHint": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "agentId",
                            "name",
                            "systemPrompt",
                            "template",
                            "isManaged",
                            "jsonSchemaHint"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "prompts",
                    "links": {
                      "self": "http://www.example.com/api/prompts/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "agentId": "00000000-0000-0000-0000-000000000001",
                      "name": "new-name",
                      "systemPrompt": "",
                      "template": "Prompt text: {{text}}",
                      "isManaged": false,
                      "jsonSchemaHint": "{\"type\":\"object\",\"properties\":{\"text\":{\"type\":\"string\"}}}"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "rejects PATCH /api/prompts/:id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "isManaged is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/prompts/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "rejects updating agent_id",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is immutable",
                      "detail": "agentId - is immutable",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/agentId"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_IMMUTABLE"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "template": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "template"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "prompts",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "new-name",
                    "agentId": "00000000-0000-0000-0000-000000000001",
                    "template": "Prompt text: {{text}}",
                    "projectId": "00000000-0000-0000-0000-000000000001"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/text_knowledge_bases": {
      "post": {
        "summary": "create",
        "tags": [
          "TextKnowledgeBase"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "projectId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "text",
                          "projectId"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "textKnowledgeBases",
                  "attributes": {
                    "name": "Text Knowledge Base",
                    "text": "This is a sample text for the knowledge base.",
                    "projectId": "00000000-0000-0000-0000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "creates a new TextKnowledgeBase",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "text",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textKnowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/text_knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Text Knowledge Base",
                      "text": "This is a sample text for the knowledge base.",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "returns errors for invalid parameters",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "can't be blank",
                      "detail": "text - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/text"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/text_knowledge_bases/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "TextKnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "deletes the TextKnowledgeBase"
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "TextKnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the details of a specific TextKnowledgeBase",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "text",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textKnowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/text_knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Sample Knowledge Base",
                      "text": "This is a sample text for the TextKnowledgeBase.",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "TextKnowledgeBase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "text"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "textKnowledgeBases",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "Updated Name",
                    "text": "Updated text"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "updates the TextKnowledgeBase successfully",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "text",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textKnowledgeBases",
                    "links": {
                      "self": "http://www.example.com/api/text_knowledge_bases/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Updated Name",
                      "text": "Updated text",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "returns detailed errors for invalid updates",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "can't be blank",
                      "detail": "name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "can't be blank",
                      "detail": "toolTarget/name - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/toolTarget/name"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    },
                    {
                      "title": "can't be blank",
                      "detail": "text - can't be blank",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/text"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "CANNOT_BE_BLANK"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/text_resources": {
      "get": {
        "summary": "index",
        "tags": [
          "TextResource"
        ],
        "parameters": [
          {
            "name": "filter[fulltext]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "nothing"
          },
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "includes by created_by and updated_by",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "self"
                            ]
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string",
                                "nullable": true
                              },
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "name",
                              "description",
                              "text"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "links",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "textResources",
                      "links": {
                        "self": "http://www.example.com/api/text_resources/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "name": "jhkhgcxl",
                        "description": null,
                        "text": "Sint qui explicabo. Ipsum sequi ut. Aut necessitatibus laudantium."
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "textResources",
                      "links": {
                        "self": "http://www.example.com/api/text_resources/00000000-0000-0000-0000-000000000001"
                      },
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "name": "wrngnbxn",
                        "description": null,
                        "text": "Quod et reiciendis. Aliquam corrupti numquam. Vero dicta non."
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    }
                  ],
                  "meta": {
                    "total": 2
                  },
                  "links": {
                    "first": "http://www.example.com/api/text_resources?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/text_resources?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Restricted User",
                        "email": "user@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "create",
        "tags": [
          "TextResource"
        ],
        "responses": {
          "201": {
            "description": "creates a new text_resource",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "text"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textResources",
                    "links": {
                      "self": "http://www.example.com/api/text_resources/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "name 1",
                      "description": "description 1",
                      "text": "text 1"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "422": {
            "description": "POST /api/text_resources rejects {\"text\":\"<BASE64_CONTENT>\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 18000 characters)",
                      "detail": "text - is too long (maximum is 18000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/text"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "description",
                          "text"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "text_resources",
                  "attributes": {
                    "name": "name 1",
                    "description": "description 1",
                    "text": "text 1"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/text_resources/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "TextResource"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Text resource deleted successfully"
          },
          "401": {
            "description": "Unauthorized - authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "Text resource not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "TextResource"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the details of a specific text_resource",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string",
                              "nullable": true
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "text"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textResources",
                    "links": {
                      "self": "http://www.example.com/api/text_resources/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "jsblqvmy",
                      "description": null,
                      "text": "Laudantium quisquam magni. Quo vel fuga. Quas quibusdam quos."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "GET /api/text_resources/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "TextResource"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates a text_resource",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "name",
                            "description",
                            "text"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textResources",
                    "links": {
                      "self": "http://www.example.com/api/text_resources/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "name": "updated name",
                      "description": "updated description",
                      "text": "updated text"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Rejected by 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "401",
                  "error": "User credentials aren't set on the request"
                }
              }
            }
          },
          "404": {
            "description": "PATCH /api/text_resources/:id returns 404 Not Found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Record not found",
                      "detail": "The record identified by 00000000-0000-0000-0000-000000000001 could not be found.",
                      "code": "404",
                      "status": "404"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/text_resources rejects {\"text\":\"<BASE64_CONTENT>\"}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "is too long (maximum is 18000 characters)",
                      "detail": "text - is too long (maximum is 18000 characters)",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/text"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "IS_TOO_LONG"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "description",
                          "text"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "text_resources",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "updated name",
                    "description": "updated description",
                    "text": "updated text"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tool_targets": {
      "get": {
        "summary": "index",
        "tags": [
          "ToolTarget"
        ],
        "parameters": [
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "duzdfzfd"
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "filter[target_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "WorkflowExecutor"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          },
          {
            "name": "targetType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "ExperimentalKnowledgeBase"
          }
        ],
        "responses": {
          "200": {
            "description": "includes by created_by and updated_by",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "projectId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "tdDatabaseName": {
                                "type": "string",
                                "nullable": true
                              },
                              "formatType": {
                                "type": "string",
                                "nullable": true
                              },
                              "maxRows": {
                                "type": "integer",
                                "nullable": true
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "nullable": true
                              },
                              "isManaged": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "tables": {
                                "type": "array",
                                "items": {},
                                "nullable": true
                              },
                              "lastJob": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "nullable": true
                                  },
                                  "finishedAt": {
                                    "nullable": true
                                  },
                                  "logs": {
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "status",
                                  "message",
                                  "finishedAt",
                                  "logs"
                                ],
                                "nullable": true
                              },
                              "text": {
                                "type": "string",
                                "nullable": true
                              },
                              "tdAccountId": {
                                "type": "string",
                                "nullable": true
                              },
                              "createdByUserId": {
                                "type": "string",
                                "nullable": true
                              },
                              "updatedByUserId": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "createdAt",
                              "updatedAt",
                              "projectId",
                              "name"
                            ]
                          },
                          "relationships": {
                            "type": "object",
                            "properties": {
                              "createdBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              },
                              "updatedBy": {
                                "type": "object",
                                "properties": {
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "id"
                                    ]
                                  }
                                },
                                "required": [
                                  "data"
                                ]
                              }
                            },
                            "required": [
                              "createdBy",
                              "updatedBy"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total"
                      ]
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string"
                        },
                        "last": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "first",
                        "last"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "links"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "knowledgeBaseToolTargets",
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "zmohxxyy",
                        "tdDatabaseName": "uwocaenb",
                        "formatType": "LEGACY_JSON",
                        "maxRows": 50,
                        "timeoutSeconds": 60,
                        "isManaged": false,
                        "tables": [],
                        "lastJob": {
                          "status": "IN_PROGRESS",
                          "message": null,
                          "finishedAt": null,
                          "logs": null
                        }
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "knowledgeBaseToolTargets",
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "pthvwfok",
                        "tdDatabaseName": "nfrueigh",
                        "formatType": "LEGACY_JSON",
                        "maxRows": 50,
                        "timeoutSeconds": 60,
                        "isManaged": false,
                        "tables": [],
                        "lastJob": {
                          "status": "IN_PROGRESS",
                          "message": null,
                          "finishedAt": null,
                          "logs": null
                        }
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "textKnowledgeBaseToolTargets",
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "atsmmlxa",
                        "text": "This is a sample text for the TextKnowledgeBase.",
                        "isManaged": false
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "workflowExecutorToolTargets",
                      "attributes": {
                        "createdAt": "2025-05-01T05:05:14.000Z",
                        "updatedAt": "2025-05-01T05:05:14.000Z",
                        "tdAccountId": "100",
                        "projectId": "00000000-0000-0000-0000-000000000001",
                        "name": "Project Workflow Executor",
                        "createdByUserId": "00000000-0000-0000-0000-000000000001",
                        "updatedByUserId": "00000000-0000-0000-0000-000000000001"
                      },
                      "relationships": {
                        "createdBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        },
                        "updatedBy": {
                          "data": {
                            "type": "users",
                            "id": "00000000-0000-0000-0000-000000000001"
                          }
                        }
                      }
                    }
                  ],
                  "meta": {
                    "total": 4
                  },
                  "links": {
                    "first": "http://www.example.com/api/tool_targets?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0",
                    "last": "http://www.example.com/api/tool_targets?include=createdBy%2CupdatedBy&page%5Blimit%5D=20&page%5Boffset%5D=0"
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tool_targets/{id}": {
      "get": {
        "summary": "show",
        "tags": [
          "ToolTarget"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the details of a specific tool target",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "isManaged": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "text",
                            "isManaged"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "textKnowledgeBaseToolTargets",
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "sklvtlti",
                      "text": "This is a sample text for the TextKnowledgeBase.",
                      "isManaged": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/users/current": {
      "get": {
        "summary": "current",
        "tags": [
          "User"
        ],
        "responses": {
          "200": {
            "description": "returns TD user and account IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "user",
                    "account"
                  ]
                },
                "example": {
                  "user": {
                    "id": "1000",
                    "name": "Admin User"
                  },
                  "account": {
                    "id": "100"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/users/current_settings": {
      "get": {
        "summary": "current_settings",
        "tags": [
          "User"
        ],
        "responses": {
          "200": {
            "description": "Available AI models and configuration settings for current user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "availableModels": {
                      "type": "object",
                      "properties": {
                        "nova-pro-v1": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "nova-lite-v1": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "nova-micro-v1": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-3.5-sonnet": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-4-sonnet": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-4.5-haiku": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-4.5-sonnet": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-4.6-sonnet": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "claude-4.6-opus": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-5": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-5-mini": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-5-nano": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-4.1": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-4.1-mini": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-4.1-nano": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        },
                        "gpt-5.5": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        }
                      },
                      "required": [
                        "nova-pro-v1",
                        "nova-lite-v1",
                        "nova-micro-v1",
                        "claude-3.5-sonnet",
                        "claude-4-sonnet",
                        "claude-4.5-haiku",
                        "claude-4.5-sonnet",
                        "claude-4.6-sonnet",
                        "claude-4.6-opus",
                        "gpt-5",
                        "gpt-5-mini",
                        "gpt-5-nano",
                        "gpt-4.1",
                        "gpt-4.1-mini",
                        "gpt-4.1-nano"
                      ]
                    },
                    "availableImageModels": {
                      "type": "object",
                      "properties": {
                        "nova-canvas": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "displayName"
                          ]
                        }
                      },
                      "required": [
                        "nova-canvas"
                      ]
                    }
                  },
                  "required": [
                    "availableModels",
                    "availableImageModels"
                  ]
                },
                "example": {
                  "availableModels": {
                    "nova-pro-v1": {
                      "displayName": "Nova Pro"
                    },
                    "nova-lite-v1": {
                      "displayName": "Nova Lite"
                    },
                    "nova-micro-v1": {
                      "displayName": "Nova Micro"
                    },
                    "claude-3.5-sonnet": {
                      "displayName": "Claude 3.5 Sonnet"
                    },
                    "claude-4-sonnet": {
                      "displayName": "Claude 4 Sonnet"
                    },
                    "claude-4.5-haiku": {
                      "displayName": "Claude 4.5 Haiku"
                    },
                    "claude-4.5-sonnet": {
                      "displayName": "Claude 4.5 Sonnet"
                    },
                    "claude-4.6-sonnet": {
                      "displayName": "Claude 4.6 Sonnet"
                    },
                    "claude-4.6-opus": {
                      "displayName": "Claude 4.6 Opus"
                    },
                    "gpt-5": {
                      "displayName": "GPT-5"
                    },
                    "gpt-5-mini": {
                      "displayName": "GPT-5 mini"
                    },
                    "gpt-5-nano": {
                      "displayName": "GPT-5 nano"
                    },
                    "gpt-4.1": {
                      "displayName": "GPT 4.1"
                    },
                    "gpt-4.1-mini": {
                      "displayName": "GPT 4.1 mini"
                    },
                    "gpt-4.1-nano": {
                      "displayName": "GPT 4.1 nano"
                    },
                    "gpt-5.5": {
                      "displayName": "GPT-5.5"
                    }
                  },
                  "availableImageModels": {
                    "nova-canvas": {
                      "displayName": "Nova Canvas"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/util/convert_segment_rule": {
      "post": {
        "summary": "convert_segment_rule",
        "tags": [
          "Util"
        ],
        "responses": {
          "200": {
            "description": "creates a rule with only base segment references using AND logic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "fullIonRule": {
                      "type": "object",
                      "properties": {
                        "conditions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "conditions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "arrayMatching": {
                                      "nullable": true
                                    },
                                    "exclude": {
                                      "type": "boolean"
                                    },
                                    "leftValue": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name"
                                      ],
                                      "nullable": true
                                    },
                                    "operator": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string"
                                        },
                                        "not": {
                                          "type": "boolean"
                                        },
                                        "rightValue": {
                                          "oneOf": [
                                            {
                                              "type": "number",
                                              "format": "float"
                                            },
                                            {
                                              "type": "integer"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "not",
                                        "rightValue"
                                      ],
                                      "nullable": true
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string",
                                      "nullable": true
                                    }
                                  },
                                  "required": [
                                    "exclude",
                                    "type"
                                  ]
                                }
                              },
                              "type": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "conditions",
                              "type"
                            ]
                          }
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "conditions",
                        "type"
                      ]
                    }
                  },
                  "required": [
                    "name",
                    "description",
                    "fullIonRule"
                  ]
                },
                "example": {
                  "name": "Test Simplified Ion Rule",
                  "description": "This is a simplified ion rule generated by a chat agent.",
                  "fullIonRule": {
                    "conditions": [
                      {
                        "conditions": [
                          {
                            "exclude": false,
                            "id": "22222",
                            "type": "Reference"
                          },
                          {
                            "exclude": false,
                            "id": "33333",
                            "type": "Reference"
                          },
                          {
                            "exclude": false,
                            "id": "44444",
                            "type": "Reference"
                          }
                        ],
                        "type": "And"
                      }
                    ],
                    "type": "And"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "400",
                  "error": "param is missing or the value is empty: name"
                }
              }
            }
          },
          "422": {
            "description": "Validation error - invalid or missing parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "error"
                  ]
                },
                "example": {
                  "status": "422",
                  "error": "simplifiedIonRule is missing required keys"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "parent_segment_id": {
                    "type": "string"
                  },
                  "simplifiedIonRule": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "conditions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "attribute_column": {
                              "type": "string",
                              "description": "Column name to filter on (alternative to left_value)"
                            },
                            "operator": {
                              "type": "string",
                              "nullable": true,
                              "description": "Comparison operator",
                              "enum": [
                                "=",
                                "!=",
                                ">",
                                ">=",
                                "<",
                                "<=",
                                "IS NULL",
                                "IS NOT NULL",
                                "IN",
                                "BETWEEN",
                                "REGEX",
                                "NOT REGEX"
                              ]
                            },
                            "right_value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      }
                                    ]
                                  }
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              ],
                              "description": "Value to compare against (optional, not needed for IS NULL/IS NOT NULL operators)"
                            },
                            "reason": {
                              "type": "string",
                              "nullable": true,
                              "description": "Human-readable explanation for this condition"
                            },
                            "left_value": {
                              "type": "string",
                              "nullable": true,
                              "description": "Column name to filter on (alternative to attribute_column)"
                            },
                            "logic": {
                              "type": "string",
                              "nullable": true,
                              "enum": [
                                "ALL",
                                "ANY"
                              ],
                              "description": "Logic operator for nested conditions"
                            },
                            "conditions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "left_value": {
                                    "type": "string"
                                  },
                                  "operator": {
                                    "type": "string",
                                    "enum": [
                                      "=",
                                      "!=",
                                      ">",
                                      ">=",
                                      "<",
                                      "<=",
                                      "IS NULL",
                                      "IS NOT NULL",
                                      "IN",
                                      "BETWEEN",
                                      "REGEX",
                                      "NOT REGEX"
                                    ]
                                  },
                                  "right_value": {
                                    "oneOf": [
                                      {
                                        "type": "integer"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "left_value",
                                  "operator",
                                  "right_value",
                                  "reason"
                                ]
                              },
                              "nullable": true,
                              "description": "Nested conditions array"
                            }
                          }
                        }
                      },
                      "logic": {
                        "type": "string"
                      },
                      "baseSegmentIds": {
                        "type": "object",
                        "properties": {
                          "logic": {
                            "type": "string",
                            "enum": [
                              "ALL",
                              "ANY"
                            ]
                          },
                          "segment_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "segmentIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "logic",
                          "segmentIds"
                        ]
                      }
                    },
                    "required": [
                      "title",
                      "summary"
                    ],
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "conditions"
                        ]
                      },
                      {
                        "type": "object",
                        "required": [
                          "baseSegmentIds"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "description",
                  "simplifiedIonRule"
                ]
              },
              "example": {
                "name": "Test Simplified Ion Rule",
                "description": "This is a simplified ion rule generated by a chat agent.",
                "parent_segment_id": "11111",
                "simplifiedIonRule": {
                  "title": "Base Segments AND Combination",
                  "summary": "Segment combining base segments with AND logic",
                  "conditions": [],
                  "logic": "",
                  "baseSegmentIds": {
                    "logic": "ALL",
                    "segment_ids": [
                      "12345",
                      "67890"
                    ],
                    "segmentIds": [
                      "22222",
                      "33333",
                      "44444"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/web_search_tools": {
      "post": {
        "summary": "create",
        "tags": [
          "WebSearchTool"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "projectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "modelType": {
                            "type": "string",
                            "enum": [
                              "gpt-5",
                              "gpt-5-mini"
                            ]
                          },
                          "searchContextSize": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ]
                          },
                          "userLocation": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "approximate"
                                ]
                              },
                              "country": {
                                "type": "string"
                              },
                              "city": {
                                "type": "string"
                              },
                              "region": {
                                "type": "string"
                              },
                              "timezone": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "country",
                              "city",
                              "region",
                              "timezone"
                            ],
                            "nullable": true
                          },
                          "systemPrompt": {
                            "type": "string",
                            "nullable": true
                          },
                          "filters": {
                            "type": "object",
                            "properties": {
                              "allowed_domains": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "allowed_domains"
                            ],
                            "nullable": true
                          }
                        },
                        "required": [
                          "projectId",
                          "name",
                          "modelType"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "webSearchTools",
                  "attributes": {
                    "projectId": "00000000-0000-0000-0000-000000000001",
                    "name": "Sample Web Search Tool",
                    "modelType": "gpt-5",
                    "searchContextSize": "medium",
                    "userLocation": {
                      "type": "approximate",
                      "country": "JP",
                      "city": "Minato",
                      "region": "Tokyo",
                      "timezone": "Asia/Tokyo"
                    },
                    "systemPrompt": "You are a helpful search assistant.",
                    "filters": {
                      "allowed_domains": [
                        "medical.example.test",
                        "research.example.test",
                        "health.example.test"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "creates a new WebSearchTool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "modelType": {
                              "type": "string",
                              "enum": [
                                "gpt-5",
                                "gpt-5-mini"
                              ]
                            },
                            "searchContextSize": {
                              "type": "string",
                              "nullable": true,
                              "enum": [
                                "low",
                                "medium",
                                "high"
                              ]
                            },
                            "userLocation": {
                              "type": "object",
                              "properties": {
                                "city": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "approximate"
                                  ]
                                },
                                "region": {
                                  "type": "string"
                                },
                                "country": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "city",
                                "type",
                                "region",
                                "country",
                                "timezone"
                              ],
                              "nullable": true
                            },
                            "filters": {
                              "type": "object",
                              "properties": {
                                "allowed_domains": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "allowed_domains"
                              ],
                              "nullable": true
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "systemPrompt": {
                              "type": "string",
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "modelType",
                            "searchContextSize",
                            "userLocation",
                            "filters",
                            "isManaged",
                            "systemPrompt"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "webSearchTools",
                    "links": {
                      "self": "http://www.example.com/api/web_search_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Sample Web Search Tool",
                      "modelType": "gpt-5",
                      "searchContextSize": "medium",
                      "userLocation": {
                        "city": "Minato",
                        "type": "approximate",
                        "region": "Tokyo",
                        "country": "JP",
                        "timezone": "Asia/Tokyo"
                      },
                      "filters": {
                        "allowed_domains": [
                          "medical.example.test",
                          "research.example.test",
                          "health.example.test"
                        ]
                      },
                      "isManaged": false,
                      "systemPrompt": "You are a helpful search assistant."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "POST /api/web_search_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "POST /api/web_search_tools rejects {\"filters\":{}}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "invalid JSON: allowed_domains is required",
                      "detail": "filters - invalid JSON: allowed_domains is required",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/filters"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_INVALID_JSON"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/web_search_tools/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "WebSearchTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "204": {
            "description": "Web search tool successfully deleted"
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "WebSearchTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the details of a specific web_search_tool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "modelType": {
                              "type": "string",
                              "enum": [
                                "gpt-5",
                                "gpt-5-mini"
                              ]
                            },
                            "searchContextSize": {
                              "type": "string",
                              "nullable": true,
                              "enum": [
                                "low",
                                "medium",
                                "high"
                              ]
                            },
                            "userLocation": {
                              "type": "object",
                              "properties": {
                                "city": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "approximate"
                                  ]
                                },
                                "region": {
                                  "type": "string"
                                },
                                "country": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "city",
                                "type",
                                "region",
                                "country",
                                "timezone"
                              ],
                              "nullable": true
                            },
                            "filters": {
                              "type": "object",
                              "properties": {
                                "allowed_domains": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "allowed_domains"
                              ],
                              "nullable": true
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "systemPrompt": {
                              "type": "string",
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "modelType",
                            "searchContextSize",
                            "userLocation",
                            "filters",
                            "isManaged",
                            "systemPrompt"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "webSearchTools",
                    "links": {
                      "self": "http://www.example.com/api/web_search_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "TestSearch",
                      "modelType": "gpt-5",
                      "searchContextSize": "medium",
                      "userLocation": {
                        "city": "Minato",
                        "type": "approximate",
                        "region": "Tokyo",
                        "country": "JP",
                        "timezone": "Asia/Tokyo"
                      },
                      "filters": {
                        "allowed_domains": [
                          "medical.example.test",
                          "research.example.test",
                          "health.example.test"
                        ]
                      },
                      "isManaged": false,
                      "systemPrompt": "You are a helpful search assistant."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "WebSearchTool"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "updates the web_search_tool",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "modelType": {
                              "type": "string",
                              "enum": [
                                "gpt-5",
                                "gpt-5-mini"
                              ]
                            },
                            "searchContextSize": {
                              "type": "string",
                              "nullable": true,
                              "enum": [
                                "low",
                                "medium",
                                "high"
                              ]
                            },
                            "userLocation": {
                              "nullable": true,
                              "type": "object",
                              "properties": {
                                "city": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "approximate"
                                  ]
                                },
                                "region": {
                                  "type": "string"
                                },
                                "country": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "city",
                                "type",
                                "region",
                                "country",
                                "timezone"
                              ]
                            },
                            "filters": {
                              "nullable": true,
                              "type": "object",
                              "properties": {
                                "allowed_domains": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "allowed_domains"
                              ]
                            },
                            "isManaged": {
                              "type": "boolean"
                            },
                            "systemPrompt": {
                              "type": "string",
                              "nullable": true
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "projectId",
                            "name",
                            "modelType",
                            "searchContextSize",
                            "userLocation",
                            "filters",
                            "isManaged",
                            "systemPrompt"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "webSearchTools",
                    "links": {
                      "self": "http://www.example.com/api/web_search_tools/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Updated Name",
                      "modelType": "gpt-5-mini",
                      "searchContextSize": "high",
                      "userLocation": null,
                      "filters": null,
                      "isManaged": false,
                      "systemPrompt": "Updated prompt"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PATCH /api/web_search_tools rejects {\"updatedAt\":1}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "Param not allowed",
                      "detail": "updatedAt is not allowed.",
                      "code": "105",
                      "status": "400"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "PATCH /api/web_search_tools rejects {\"filters\":{}}",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "pointer"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "validationCode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "validationCode"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "detail",
                          "code",
                          "source",
                          "status",
                          "meta"
                        ]
                      }
                    }
                  },
                  "required": [
                    "errors"
                  ]
                },
                "example": {
                  "errors": [
                    {
                      "title": "invalid JSON: allowed_domains is required",
                      "detail": "filters - invalid JSON: allowed_domains is required",
                      "code": "100",
                      "source": {
                        "pointer": "/data/attributes/filters"
                      },
                      "status": "422",
                      "meta": {
                        "validationCode": "LLM_INVALID_JSON"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "modelType": {
                            "type": "string",
                            "enum": [
                              "gpt-5",
                              "gpt-5-mini"
                            ]
                          },
                          "searchContextSize": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ]
                          },
                          "userLocation": {
                            "nullable": true,
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "approximate"
                                ]
                              },
                              "country": {
                                "type": "string"
                              },
                              "city": {
                                "type": "string"
                              },
                              "region": {
                                "type": "string"
                              },
                              "timezone": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "country",
                              "city",
                              "region",
                              "timezone"
                            ]
                          },
                          "systemPrompt": {
                            "type": "string",
                            "nullable": true
                          },
                          "filters": {
                            "nullable": true,
                            "type": "object",
                            "properties": {
                              "allowed_domains": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "allowed_domains"
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "modelType"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "attributes"
                    ]
                  }
                },
                "required": [
                  "data"
                ]
              },
              "example": {
                "data": {
                  "type": "webSearchTools",
                  "id": "00000000-0000-0000-0000-000000000001",
                  "attributes": {
                    "name": "Updated Name",
                    "modelType": "gpt-5-mini",
                    "searchContextSize": "high",
                    "userLocation": null,
                    "systemPrompt": "Updated prompt",
                    "filters": null
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/workflow_executors/{id}": {
      "get": {
        "summary": "show",
        "tags": [
          "WorkflowExecutor"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-0000-0000-000000000001"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdBy,updatedBy"
          }
        ],
        "responses": {
          "200": {
            "description": "includes by created_by and updated_by",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "self": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "self"
                          ]
                        },
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "tdAccountId": {
                              "type": "string"
                            },
                            "projectId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "createdByUserId": {
                              "type": "string"
                            },
                            "updatedByUserId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "createdAt",
                            "updatedAt",
                            "tdAccountId",
                            "projectId",
                            "name",
                            "createdByUserId",
                            "updatedByUserId"
                          ]
                        },
                        "relationships": {
                          "type": "object",
                          "properties": {
                            "createdBy": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            },
                            "updatedBy": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ]
                                }
                              },
                              "required": [
                                "data"
                              ]
                            }
                          },
                          "required": [
                            "createdBy",
                            "updatedBy"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "links",
                        "attributes"
                      ]
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-0000-0000-000000000001",
                    "type": "workflowExecutors",
                    "links": {
                      "self": "http://www.example.com/api/workflow_executors/00000000-0000-0000-0000-000000000001"
                    },
                    "attributes": {
                      "createdAt": "2025-05-01T05:05:14.000Z",
                      "updatedAt": "2025-05-01T05:05:14.000Z",
                      "tdAccountId": "100",
                      "projectId": "00000000-0000-0000-0000-000000000001",
                      "name": "Project Workflow Executor",
                      "createdByUserId": "00000000-0000-0000-0000-000000000001",
                      "updatedByUserId": "00000000-0000-0000-0000-000000000001"
                    },
                    "relationships": {
                      "createdBy": {
                        "data": {
                          "type": "users",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      },
                      "updatedBy": {
                        "data": {
                          "type": "users",
                          "id": "00000000-0000-0000-0000-000000000001"
                        }
                      }
                    }
                  },
                  "included": [
                    {
                      "id": "00000000-0000-0000-0000-000000000001",
                      "type": "users",
                      "attributes": {
                        "name": "Admin User",
                        "email": "admin@example.com"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}