{ "openapi": "3.0.0", "info": { "title": "AiInTheLoop Swagger", "description": "Welcome to the API documentation for AI2loop! AI2loop is a powerful SaaS (Software-as-a-Service) tool designed to review AI-generated content in automation processes. This REST API allows developers to seamlessly integrate AI2loop into their applications and leverage its advanced capabilities.\n\nWith AI2loop, you can ensure the quality and reliability of AI-generated content by automating the review process. Whether you're working on content generation or any other AI-driven automation, AI2loop provides you with a robust solution to validate the outputs.\n\nThis documentation will guide you through the various endpoints and functionalities of the AI2loop API, enabling you to make efficient use of the tool's features. You will learn how to authenticate requests, handle responses, and explore the available endpoints to perform tasks such as submitting content for review and managing AI2loop configurations.\n\nTo get started, we recommend familiarizing yourself with the authentication process and the basic structure of API requests. You will also find detailed explanations and examples for each endpoint, along with the expected request parameters and response formats.\\n\nLet's begin the journey towards more accurate and dependable AI-generated content with AI2loop!", "version": "0.1.0" }, "components": { "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-KEY" } }, "schemas": { "Approval": { "properties": { "approved": { "title": "Approval.approved", "nullable": true, "type": "boolean" }, "content": { "title": "Approval.content", "nullable": true, "type": "string" }, "image": { "title": "Approval.image", "nullable": true, "type": "string" }, "video": { "title": "Approval.video", "nullable": true, "type": "string" }, "created_at": { "title": "Approval.created_at", "nullable": true, "type": "string" }, "ID": { "title": "Approval.ID", "type": "string" }, "approval_uri": { "title": "Approval.approval_uri", "nullable": true, "type": "string" }, "loop_id": { "title": "Approval.loop_id", "nullable": true, "type": "string" }, "user_id": { "title": "Approval.user_id", "type": "string" }, "prompts": { "anyOf": [ { "items": {}, "title": "Approval.prompts", "type": "array" }, { "title": "Approval.prompts", "nullable": true } ], "title": "Approval.prompts", "nullable": true }, "type": { "title": "Approval.type", "nullable": true, "type": "string" } }, "required": [ "approved", "content", "created_at", "ID", "approval_uri", "loop_id", "user_id", "prompts", "type", "type" ], "additionalProperties": false, "title": "Approval", "type": "object" }, "ApprovalResponse": { "properties": { "message": { "title": "ApprovalResponse.message", "type": "string" }, "data": { "items": {}, "title": "ApprovalResponse.data", "type": "array", "anyOf": [ { "$ref": "#/components/schemas/Approval", "title": "ApprovalResponse.data" }, { "items": { "$ref": "#/components/schemas/Approval", "title": "ApprovalResponse.data.[]" }, "title": "ApprovalResponse.data.[]", "type": "array" } ] }, "status": { "title": "ApprovalResponse.status", "type": "number" } }, "required": [ "message", "status" ], "additionalProperties": false, "title": "ApprovalResponse", "type": "object" }, "DefaultResponse": { "properties": { "status": { "title": "DefaultResponse.status", "type": "number" }, "message": { "title": "DefaultResponse.message", "type": "string" } }, "required": [ "status", "message" ], "additionalProperties": false, "title": "DefaultResponse", "type": "object" }, "DiscordIntegrationRequest": { "properties": { "webhook": { "title": "DiscordIntegrationRequest.webhook", "type": "string" } }, "required": [ "webhook" ], "additionalProperties": false, "title": "DiscordIntegrationRequest", "type": "object" }, "Hook": { "properties": { "data": { "title": "Hook.data" } }, "required": [ "data" ], "additionalProperties": false, "title": "Hook", "type": "object" }, "Loop": { "properties": { "ident": { "title": "Loop.ident", "type": "string" }, "created_at": { "title": "Loop.created_at", "type": "string" }, "name": { "title": "Loop.name", "type": "string" }, "user_id": { "title": "Loop.user_id", "type": "string" }, "tool": { "title": "Loop.tool", "type": "string" }, "type": { "title": "Loop.type", "type": "string" }, "hook": { "title": "Loop.hook", "nullable": true, "type": "boolean" }, "description": { "title": "Loop.description", "type": "string" }, "acceptHook": { "title": "Loop.acceptHook", "nullable": true, "type": "string" }, "declineHook": { "title": "Loop.declineHook", "nullable": true, "type": "string" } }, "required": [ "ident", "created_at", "name", "user_id", "tool", "type", "description" ], "additionalProperties": false, "title": "Loop", "type": "object" }, "LoopResponse": { "properties": { "message": { "title": "LoopResponse.message", "examples": [ "Some Message", "Some Other Message" ], "type": "string" }, "data": { "title": "LoopResponse.data", "$ref": "#/components/schemas/Loop" }, "status": { "title": "LoopResponse.status", "examples": [ "200", "400" ], "type": "number" } }, "required": [ "message", "data", "status" ], "additionalProperties": false, "title": "LoopResponse", "type": "object" }, "Prompt": { "properties": { "id": { "title": "Prompt.id", "type": "string" }, "prompt": { "title": "Prompt.prompt", "type": "string" } }, "required": [ "id", "prompt" ], "additionalProperties": false, "title": "Prompt", "type": "object" }, "RegisterHookRequest": { "properties": { "type": { "title": "RegisterHookRequest.type", "type": "string" }, "url": { "title": "RegisterHookRequest.url", "type": "string" }, "loopId": { "title": "RegisterHookRequest.loopId", "type": "string" } }, "required": [ "type", "url", "loopId" ], "additionalProperties": false, "title": "RegisterHookRequest", "type": "object" }, "TeamsIntegrationRequest": { "properties": { "webhook": { "title": "TeamsIntegrationRequest.webhook", "type": "string" } }, "required": [ "webhook" ], "additionalProperties": false, "title": "TeamsIntegrationRequest", "type": "object" }, "UnregisterHookRequest": { "properties": { "type": { "title": "UnregisterHookRequest.type", "type": "string" }, "url": { "title": "UnregisterHookRequest.url", "type": "string" }, "loopId": { "title": "UnregisterHookRequest.loopId", "type": "string" } }, "required": [ "type", "url", "loopId" ], "additionalProperties": false, "title": "UnregisterHookRequest", "type": "object" }, "User": { "properties": { "init": { "title": "User.init", "type": "boolean" }, "email": { "title": "User.email", "nullable": true, "type": "string" } }, "required": [ "init", "email" ], "additionalProperties": false, "title": "User", "type": "object" } } }, "paths": { "/api/approvals": { "post": { "summary": "Creates an Approval", "tags": [ "Approvals" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Approval" } } } }, "responses": { "200": { "description": "The Approval Data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApprovalResponse" } } } } } } }, "/approve/{id}": { "post": { "tags": [ "Approvals" ], "summary": "Approve a request", "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "object" } }, "required": [ "content" ] } } } }, "responses": { "200": { "description": "Request successfully approved", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "200" }, "message": { "type": "string", "example": "Approved" } } } } } }, "500": { "description": "Error occurred during approval process", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "500" }, "message": { "type": "string", "example": "Approving failed" } } } } } } } } }, "/api/auth": { "get": { "tags": [ "Auth" ], "summary": "Check if api key valid", "responses": { "200": { "description": "If API Key is valid" } } } }, "/api/hook": { "post": { "summary": "Creates an Approval", "tags": [ "Approvals" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Approval" } } } }, "responses": { "200": { "description": "The Approval Data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApprovalResponse" } } } } } } }, "/api/loops": { "get": { "summary": "Returns all Loops for a User", "parameters": [ { "in": "query", "name": "userId", "schema": { "type": "string" }, "required": false, "description": "The tool for which the loop is deployed" } ], "tags": [ "Loops" ], "responses": { "200": { "description": "The list of all Loops", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoopResponse" } } } } } } }, "/api/registerHook": { "post": { "tags": [ "Hooks" ], "summary": "Register a hook for a certain loop", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterHookRequest" } } } }, "responses": { "200": { "description": "RegisterHookResponse", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DefaultResponse" } } } } } } }, "/api/reloop/{id}": { "post": { "summary": "Reloop based on the approval", "tags": [ "Loops" ], "parameters": [ { "name": "id", "in": "path", "description": "The ID of the approval", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "description": "Array of strings containing the prompts for the loop.", "items": { "type": "string" } } } } } } }, "responses": { "200": { "description": "Loop has been relooped successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "200" }, "message": { "type": "string", "example": "Approved" } } } } } }, "500": { "description": "Failed to reloop", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "500" }, "message": { "type": "string", "example": "Approving failed" } } } } } } } } }, "/api/loops/loopStart": { "post": { "summary": "Starts a loop with the specified prompts", "tags": [ "Loops" ], "requestBody": { "description": "The prompts for the loop", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "loopId": { "type": "string", "description": "The ID of the loop to start" }, "prompts": { "type": "array", "items": { "type": "string" }, "description": "An array of prompts for the loop" } } } } } }, "responses": { "200": { "description": "The loop was successfully started", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "The HTTP status code", "example": "200" }, "message": { "type": "string", "description": "A message indicating the success of the request", "example": "Loop started" } } } } } }, "500": { "description": "An error occurred while starting the loop", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "The HTTP status code", "example": "500" }, "message": { "type": "string", "description": "A message indicating the failure of the request", "example": "Loop Start failed" } } } } } } } } }, "/api/unregisterHook": { "post": { "summary": "Unregister a hook for a certain loop", "tags": [ "Hooks" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnregisterHookRequest" } } } }, "responses": { "200": { "description": "UnregisterHookResponse", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DefaultResponse" } } } } } } } }, "tags": [] }