{
  "openapi": "3.0.0",
  "info": {
    "title": "Superjoin API",
    "description": "API for importing and refreshing data in a Google Sheets spreadsheet.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.superjoin.ai",
      "description": "Production server"
    }
  ],
  "paths": {
    "/public/v1/import/refresh-data": {
      "post": {
        "summary": "Refresh Data in Google Sheets",
        "description": "This endpoint allows you to refresh data in a specified Google Sheets spreadsheet.",
        "tags": ["Data Import"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["spreadsheetId", "sheetId"],
                "properties": {
                  "spreadsheetId": {
                    "type": "string",
                    "description": "The ID of the spreadsheet you want to refresh.",
                    "example": "16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4"
                  },
                  "sheetId": {
                    "type": "string",
                    "description": "The ID of the specific sheet within the spreadsheet to refresh.",
                    "example": "649755416"
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Optional metadata for the refresh operation.",
                    "properties": {
                      "userEmailAddress": {
                        "type": "string",
                        "description": "The email address of the user performing the action.",
                        "example": "support@superjoin.ai"
                      },
                      "identifier": {
                        "type": "string",
                        "description": "An optional identifier for uniquely identifying the refresh operation.",
                        "example": "refresh-2024-09-03-1234"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully refreshed the data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Data refreshed successfully."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Bad Request: Invalid inputs."
                    }
                  }
                }
              }
            }
          },
          
          "403": {
            "description": "Unauthorized access.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Forbidden: Invalid API Key."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Too many requests."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal server error."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "To access this endpoint, you need an API key. Please use the following format: Api-Key <API_KEY>.\n\nIf you don't have an API key, you can request one by reaching out to us at [support@superjoin.ai](mailto:support@superjoin.ai). \n\nIn case you've misplaced your API key, you can request a new one; however, note that any previous keys will be deactivated."
      }
    }
  }
}