{
    "openapi": "3.0.2",
    "info": {
        "title": "SciSummary",
        "version": "1.0.0",
        "description": "SciSummary API allows you to generate summaries of scientific articles in bulk"
    },
    "servers": [
        {
            "url": "https://scisummary.com",
            "description": ""
        }
    ],
    "paths": {
        "/api/batch/{uuid}": {
            "get": {
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Batch"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": [
                        ]
                    }
                ],
                "summary": "Get Batch",
                "description": "Retrieve an entire batch of requests, this will include all summaries and be populated as it's generated."
            },
            "parameters": [
                {
                    "name": "uuid",
                    "description": "UUID of the batch",
                    "in": "path",
                    "required": true
                }
            ]
        },
        "/api/batch": {
            "get": {
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/PaginatedBatches"
                    }
                },
                "summary": "List Batches"
            },
            "post": {
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BatchRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/BatchRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Batch"
                    }
                },
                "summary": "Create new batch of requests"
            }
        },
        "/api/request": {

        },
        "/api/request/{uuid}": {
            "get": {
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Request"
                    }
                },
                "summary": "Get Request"
            }
        }
    },
    "components": {
        "schemas": {
            "Request": {
                "title": "Root Type for Request",
                "description": "A request to summarize an article",
                "type": "object",
                "properties": {
                    "created_at": {
                        "format": "date-time",
                        "type": "string"
                    },
                    "updated_at": {
                        "format": "date-time",
                        "type": "string"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "text": {
                        "type": "string"
                    },
                    "from": {
                        "type": "string"
                    },
                    "to": {
                        "type": "string"
                    },
                    "message_id": {
                        "type": "string"
                    },
                    "subject": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "filename": {
                        "type": "string"
                    },
                    "summaries": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Summary"
                        }
                    }
                },
                "example": {
                    "created_at": "2023-02-05 05:18",
                    "updated_at": "2023-02-05 05:18",
                    "uuid": "e131ea01-58c2-4a1d-a874-0494fc71174c",
                    "text": "Article...",
                    "from": "heckel.max@gmail.com",
                    "to": "api@scisummary.com",
                    "message_id": "",
                    "subject": "",
                    "type": "pdf",
                    "filename": "PIIS2589537023000172.pdf",
                    "summaries": [
                        {
                            "created_at": "2023-02-05T05:20:11.000000Z",
                            "updated_at": "2023-02-05T05:20:11.000000Z",
                            "uuid": "9b29fe13-ce11-475e-a4ce-d47daaf33487",
                            "request_id": 7,
                            "text": "Summarized..."
                        }
                    ]
                }
            },
            "Batch": {
                "title": "Root Type for Batch",
                "description": "A batch of requests to summarize articles",
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "requests": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Request"
                        }
                    }
                },
                "example": {
                    "created_at": "2023-02-05T05:18:57.000000Z",
                    "updated_at": "2023-02-05T05:18:57.000000Z",
                    "uuid": "8019f0de-99a5-4c9f-a9e2-54b667e0cb64",
                    "requests": [
                        {
                            "created_at": "2023-02-05 05:18",
                            "updated_at": "2023-02-05 05:18",
                            "uuid": "e131ea01-58c2-4a1d-a874-0494fc71174c",
                            "text": "Article...",
                            "from": "heckel.max@gmail.com",
                            "to": "api@scisummary.com",
                            "message_id": "",
                            "subject": "",
                            "type": "pdf",
                            "filename": "PIIS2589537023000172.pdf",
                            "summaries": [
                                {
                                    "created_at": "2023-02-05T05:20:11.000000Z",
                                    "updated_at": "2023-02-05T05:20:11.000000Z",
                                    "uuid": "9b29fe13-ce11-475e-a4ce-d47daaf33487",
                                    "request_id": 7,
                                    "text": "Summarized..."
                                }
                            ]
                        }
                    ]
                }
            },
            "Summary": {
                "title": "Root Type for Summary",
                "description": "A summary of an article",
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "request_id": {
                        "format": "int32",
                        "type": "integer"
                    },
                    "text": {
                        "type": "string"
                    },
                    "rank": {
                        "type": "string"
                    }
                },
                "example": {
                    "created_at": "2023-02-05T05:20:11.000000Z",
                    "updated_at": "2023-02-05T05:20:11.000000Z",
                    "uuid": "9b29fe13-ce11-475e-a4ce-d47daaf33487",
                    "request_id": 7,
                    "text": "Summarized"
                }
            },
            "BatchRequest": {
                "title": "Root Type for BatchRequest",
                "description": "",
                "type": "object",
                "properties": {
                    "texts": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "pdfs[]": {
                        "$ref": "#/components/schemas/File"
                    }
                },
                "example": {
                    "texts": [
                        "article text 1...",
                        "article text 2..."
                    ],
                    "urls": [
                        "https://article.one",
                        "https://article.two"
                    ],
                    "pdfs[]": "multipart file..."
                }
            },
            "File": {
                "description": "",
                "type": "object"
            },
            "PaginatedBatches": {
                "title": "Root Type for PaginatedBatches",
                "description": "Paginated batches response",
                "type": "object",
                "properties": {
                    "page": {
                        "format": "int32",
                        "type": "integer"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "created_at": {
                                    "type": "string"
                                },
                                "updated_at": {
                                    "type": "string"
                                },
                                "uuid": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "next": {
                        "type": "string"
                    },
                    "previous": {
                        "type": "string"
                    },
                    "total": {
                        "format": "int32",
                        "type": "integer"
                    }
                },
                "example": {
                    "page": 1,
                    "data": [
                        {
                            "created_at": "2023-02-04T18:56:58.000000Z",
                            "updated_at": "2023-02-04T18:56:58.000000Z",
                            "uuid": "d52199be-aefb-4d1e-9fca-eba50e847f8c"
                        },
                        {
                            "created_at": "2023-02-04T18:58:29.000000Z",
                            "updated_at": "2023-02-04T18:58:29.000000Z",
                            "uuid": "cb240713-e97d-4f8f-b1d0-d7ecab271dfc"
                        },
                        {
                            "created_at": "2023-02-05T05:17:43.000000Z",
                            "updated_at": "2023-02-05T05:17:43.000000Z",
                            "uuid": "fbf0d970-a979-4565-944a-6ba856c261eb"
                        },
                        {
                            "created_at": "2023-02-05T05:18:57.000000Z",
                            "updated_at": "2023-02-05T05:18:57.000000Z",
                            "uuid": "8019f0de-99a5-4c9f-a9e2-54b667e0cb64"
                        }
                    ],
                    "total": 4
                }
            }
        },
        "responses": {
            "Batch": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Batch"
                        }
                    }
                },
                "description": "A batch of requests to summarize articles"
            },
            "Request": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Request"
                        }
                    }
                },
                "description": ""
            },
            "PaginatedBatches": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/PaginatedBatches"
                        }
                    }
                },
                "description": ""
            }
        },
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "description": "Pass an API key created from https://scisummary.com/api/tokens",
                "name": "Authorization",
                "in": "header"
            }
        }
    },
    "security": [
        {
            "ApiKeyAuth": [
            ]
        }
    ]
}