{
  "openapi": "3.1.0",
  "info": {
    "title": "Ask a website agent, via Rose",
    "version": "1.0.0",
    "description": "Ask a company's official website agent a question over plain HTTP. No key. Only companies that turned this endpoint on answer; other domains return 404."
  },
  "servers": [
    {
      "url": "https://ask.userose.ai"
    }
  ],
  "paths": {
    "/{domain}": {
      "get": {
        "operationId": "askWebsiteAgent",
        "summary": "Ask a company's official website agent",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "The company's website domain.",
            "schema": {
              "type": "string",
              "example": "lemlist.com"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "The question. Without it the response is a discovery page about the company with example questions.",
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          },
          {
            "name": "c",
            "in": "query",
            "required": false,
            "description": "Conversation id returned by a previous answer, to continue that conversation.",
            "schema": {
              "type": "string",
              "pattern": "^ah-[0-9a-f-]{36}$"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Answer language code, e.g. en or fr.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "description": "For a company with several agents, the agent_id of the one to ask, from the agents a question returned. Choose the user's stated country, product or business context; if unclear, ask them.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Deprecated alias for agent; use agent for new requests.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json returns a JSON object instead of markdown.",
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer (markdown by default, JSON with format=json), or the agents to choose from for a company with several agents asked without agent.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "answer",
                        "conversation_id"
                      ],
                      "properties": {
                        "answer": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          }
                        },
                        "follow_ups": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "conversation_id": {
                          "type": "string"
                        },
                        "company": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "agents"
                      ],
                      "properties": {
                        "company": {
                          "type": "string"
                        },
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "agent_id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The canonical and deprecated agent choices conflict.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "This endpoint is not available for this site.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Wait for Retry-After seconds.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  }
}