{
 "openapi": "3.1.0",
 "info": {
  "title": "MeetStream Meeting Bot",
  "version": "1.0.0",
  "description": "Three MeetStream operations for a Meta Muse Custom Connector: send a bot to a Zoom, Google Meet or Microsoft Teams meeting, check its status, fetch the transcript. Full API: https://docs.meetstream.ai",
  "contact": {
   "name": "MeetStream",
   "url": "https://meetstream.ai/integrations/muse-meeting-connector"
  }
 },
 "servers": [
  {
   "url": "https://api.meetstream.ai/api/v1"
  }
 ],
 "security": [
  {
   "MeetStreamToken": []
  }
 ],
 "components": {
  "securitySchemes": {
   "MeetStreamToken": {
    "type": "apiKey",
    "in": "header",
    "name": "Authorization",
    "description": "Value is the word Token, a space, then your MeetStream API key. Store the key as the connector credential."
   }
  },
  "schemas": {
   "CreateBotRequest": {
    "type": "object",
    "required": [
     "meeting_link",
     "bot_name"
    ],
    "properties": {
     "meeting_link": {
      "type": "string",
      "description": "Zoom, Google Meet or Microsoft Teams meeting URL"
     },
     "bot_name": {
      "type": "string",
      "description": "Name shown in the participant list"
     },
     "recording_config": {
      "type": "object",
      "properties": {
       "transcript": {
        "type": "object",
        "properties": {
         "provider": {
          "type": "object",
          "properties": {
           "meetstream": {
            "type": "object"
           }
          }
         }
        }
       }
      },
      "default": {
       "transcript": {
        "provider": {
         "meetstream": {}
        }
       }
      }
     }
    }
   },
   "CreateBotResponse": {
    "type": "object",
    "properties": {
     "bot_id": {
      "type": "string"
     },
     "transcript_id": {
      "type": "string"
     },
     "meeting_url": {
      "type": "string"
     },
     "status": {
      "type": "string"
     }
    }
   },
   "BotStatus": {
    "type": "object",
    "properties": {
     "bot_id": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "Joining, InWaitingRoom, InMeeting, Recording, Leaving, Stopped, NotAllowed, Denied, Error, MediaProcessing, Done, MediaExpired"
     },
     "custom_attributes": {
      "type": "object"
     }
    }
   },
   "TranscriptSegment": {
    "type": "object",
    "properties": {
     "speaker": {
      "type": "string"
     },
     "transcript": {
      "type": "string"
     },
     "start_time": {
      "type": "number"
     },
     "end_time": {
      "type": "number"
     },
     "words": {
      "type": "array",
      "items": {
       "type": "object"
      }
     }
    }
   }
  }
 },
 "paths": {
  "/bots/create_bot": {
   "post": {
    "operationId": "create_bot",
    "summary": "Send a bot to a meeting link",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CreateBotRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Bot created",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CreateBotResponse"
        }
       }
      }
     }
    }
   }
  },
  "/bots/{bot_id}/status": {
   "get": {
    "operationId": "get_bot_status",
    "summary": "Current status of a bot",
    "parameters": [
     {
      "name": "bot_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Status",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BotStatus"
        }
       }
      }
     }
    }
   }
  },
  "/transcript/{transcript_id}/get_transcript": {
   "get": {
    "operationId": "get_transcript",
    "summary": "Final transcript for a completed meeting",
    "parameters": [
     {
      "name": "transcript_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "List of speaker-labelled segments",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/TranscriptSegment"
         }
        }
       }
      }
     },
     "202": {
      "description": "Transcript still processing, retry shortly"
     }
    }
   }
  }
 }
}