{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Growth Engine workspace API",
    "version": "1.0.0",
    "description": "One customer workspace: plans, people to review, replies, meetings and results. Get a token as described in https://ai-growth-engine.oliosoftware.com/auth.md."
  },
  "externalDocs": {
    "url": "https://ai-growth-engine.oliosoftware.com/auth.md",
    "description": "Getting and using a token"
  },
  "servers": [
    {
      "url": "https://app.ai-growth-engine.oliosoftware.com"
    }
  ],
  "security": [
    {
      "token": []
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "list_tools",
        "summary": "Every tool and its inputs. No token needed.",
        "security": [],
        "responses": {
          "200": {
            "description": "The tool list"
          }
        }
      }
    },
    "/api/v1/list_plans": {
      "get": {
        "operationId": "list_plans",
        "summary": "The workspace's outreach plans (campaigns): name, status, people in each, and how sending is going.",
        "description": "The workspace's outreach plans (campaigns): name, status, people in each, and how sending is going. Token scope: read.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/buyers_to_review": {
      "get": {
        "operationId": "buyers_to_review",
        "summary": "People found for the plans and waiting for approval, best first, with why they fit and any reason to buy now.",
        "description": "People found for the plans and waiting for approval, best first, with why they fit and any reason to buy now. Token scope: read.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/approve_people": {
      "post": {
        "operationId": "approve_people",
        "summary": "Approve people from buyers_to_review (their ids) so their plan writes to them",
        "description": "Approve people from buyers_to_review (their ids) so their plan writes to them. Needs a token allowed to approve. Token scope: approve.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 8,
                      "maxLength": 32
                    }
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reasons_to_buy": {
      "get": {
        "operationId": "reasons_to_buy",
        "summary": "Companies in the plans with a reason to buy now: hiring, expansion, trade fair, order won, funding, new leader",
        "description": "Companies in the plans with a reason to buy now: hiring, expansion, trade fair, order won, funding, new leader. With the source link. Token scope: read.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/buying_posts": {
      "get": {
        "operationId": "buying_posts",
        "summary": "LinkedIn posts where someone asks to buy what this workspace sells, newest first, with the link to reply.",
        "description": "LinkedIn posts where someone asks to buy what this workspace sells, newest first, with the link to reply. Token scope: read.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/replies": {
      "get": {
        "operationId": "replies",
        "summary": "Conversations with replies, newest first; filter by intent (interested, meeting_request, question, not_now, referral).",
        "description": "Conversations with replies, newest first; filter by intent (interested, meeting_request, question, not_now, referral). Token scope: read.",
        "parameters": [
          {
            "name": "intent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "interested",
                "meeting_request",
                "question",
                "not_now",
                "referral",
                "neutral"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/meetings": {
      "get": {
        "operationId": "meetings",
        "summary": "Meetings booked from the outreach, upcoming or past, with the person, company and plan.",
        "description": "Meetings booked from the outreach, upcoming or past, with the person, company and plan. Token scope: read.",
        "parameters": [
          {
            "name": "when",
            "in": "query",
            "required": false,
            "schema": {
              "default": "upcoming",
              "type": "string",
              "enum": [
                "upcoming",
                "past"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/results": {
      "get": {
        "operationId": "results",
        "summary": "Results over 30 and 90 days and six months: people reached, replies, interested replies, meetings, reply speed.",
        "description": "Results over 30 and 90 days and six months: people reached, replies, interested replies, meetings, reply speed. Token scope: read.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Token not allowed to do this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "token": {
        "type": "http",
        "scheme": "bearer",
        "description": "Token from Settings, API & AI access. Scopes: read, approve."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}
