{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI Plant Store",
    "description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.harvestapi.io"
    }
  ],
  "security": [
    {
      "ApiKeyAuthHeader": []
    }
  ],
  "paths": {
    "/users/my-api-user": {
      "get": {
        "summary": "Get my API user details",
        "description": "Get details about the API user associated with the provided API key",
        "parameters": [],
        "responses": {
          "200": {
            "description": "My API user details"
          }
        }
      }
    },
    "/users/my-private-account-pools": {
      "get": {
        "summary": "Get my API private pools",
        "description": "Get details about the private pools of resources associated with the API user",
        "parameters": [],
        "responses": {
          "200": {
            "description": "My API private pools"
          }
        }
      }
    },
    "/linkedin/lead-search-capacity": {
      "get": {
        "summary": "Get lead search capacity",
        "description": "How much of the general system capacity for lead search, account search and account insights is already used in the current hour and in the current day (UTC), in percent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The share of the capacity used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSearchCapacity"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadSearchCapacity": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "object",
            "description": "The current hour (UTC)",
            "properties": {
              "usedPercent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "Share of this hour's capacity already used, rounded down. 100 means nothing is left this hour",
                "example": 16
              }
            }
          },
          "day": {
            "type": "object",
            "description": "The current day (UTC)",
            "properties": {
              "usedPercent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "Share of today's capacity already used, rounded down. 100 means nothing is left today",
                "example": 29
              }
            }
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalElements": {
            "type": "integer",
            "format": "int32"
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "previousElements": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "paginationToken": {
            "type": "string",
            "format": "nullable"
          }
        }
      },
      "Error": {
        "required": ["error", "message"],
        "type": "object",
        "properties": {
          "error": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuthHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
