{
  "openapi": "3.1.0",
  "info": {
    "title": "Memox agent API",
    "version": "1.0.0",
    "summary": "Read the Memox offer, products, proof and trust facts. Ask for a pilot for your user.",
    "description": "Memox is a team and a platform: one brain for your company, with products built on it. The read endpoints give the same words as the pages of memox.io, as JSON. No sign-in. The pilot request endpoint is closed unless the Memox team opens it: GET /api/agent/v1 says if it is open. Send a person's name and email only when that person agrees. Rules for agents: https://memox.io/agents.md",
    "contact": {
      "name": "Memox",
      "email": "hello@memox.io",
      "url": "https://memox.io/agents"
    },
    "termsOfService": "https://memox.io/terms"
  },
  "servers": [
    {
      "url": "https://memox.io"
    }
  ],
  "externalDocs": {
    "description": "How an AI agent reads and acts on memox.io",
    "url": "https://memox.io/agents.md"
  },
  "tags": [
    {
      "name": "read",
      "description": "Public, read-only, cached 5 minutes."
    },
    {
      "name": "act",
      "description": "Actions for a user, with the user's consent."
    }
  ],
  "paths": {
    "/api/agent/v1": {
      "get": {
        "operationId": "getIndex",
        "summary": "The start point",
        "description": "Links to each resource, and whether the pilot request endpoint is open.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Index"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/pilot": {
      "get": {
        "operationId": "getPilotOffer",
        "summary": "The pilot offer",
        "description": "The free 30-day pilot: the steps, the exit, the price line after the pilot and the questions.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PilotOffer"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "The 5 products",
        "description": "Each product: what it does, its jobs, its features and its questions.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/proof": {
      "get": {
        "operationId": "getProof",
        "summary": "The ContainerOne proof",
        "description": "The customer numbers with their as-of date. Quote them word for word.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proof"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/trust": {
      "get": {
        "operationId": "getTrustFacts",
        "summary": "Trust and data",
        "description": "The data agreement, where data is kept, roles, approval and support.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trust"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/booking": {
      "get": {
        "operationId": "getBookingLink",
        "summary": "Book the fit call",
        "description": "Book a 30-minute fit call: the calendar link and what we check on the call.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Booking"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "Events",
        "description": "The trade show stand while the show is on. An empty list after it.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Events"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/pages": {
      "get": {
        "operationId": "listPages",
        "summary": "The pages",
        "description": "Each public page with its HTML and markdown URL.",
        "tags": [
          "read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pages"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/v1/pilot-requests": {
      "post": {
        "operationId": "requestPilot",
        "summary": "Ask for a free pilot for your user",
        "description": "Closed unless the Memox team opens it (503). A person on the Memox team gets the request and contacts the person. Send the details only when the person agrees. 3 requests an hour from 1 network.",
        "tags": [
          "act"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PilotRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Received. A person on the Memox team contacts the person.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PilotRequestReceived"
                }
              }
            }
          },
          "400": {
            "description": "A field is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Not stored. Book the fit call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Closed, or not stored. Book the fit call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Page": {
        "type": "object",
        "required": [
          "url",
          "markdown"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdown": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "QA": {
        "type": "object",
        "required": [
          "question",
          "answer"
        ],
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          }
        }
      },
      "Index": {
        "type": "object",
        "required": [
          "name",
          "version",
          "resources",
          "pilot_request"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "what_memox_is": {
            "type": "string"
          },
          "brand_line": {
            "type": "string"
          },
          "site": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "llms_txt": {
            "type": "string",
            "format": "uri"
          },
          "mcp": {
            "type": "string",
            "format": "uri"
          },
          "resources": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            }
          },
          "pilot_request": {
            "type": "object",
            "required": [
              "open",
              "method",
              "url"
            ],
            "properties": {
              "open": {
                "type": "boolean"
              },
              "method": {
                "type": "string",
                "const": "POST"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "fields": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "when_closed": {
                "type": "string"
              }
            }
          },
          "rules": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Booking": {
        "type": "object",
        "required": [
          "label",
          "minutes",
          "calendar_url",
          "booking_page"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "minutes": {
            "type": "integer"
          },
          "calendar_url": {
            "type": "string",
            "format": "uri"
          },
          "booking_page": {
            "$ref": "#/components/schemas/Page"
          },
          "what_we_check": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "line": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "PilotOffer": {
        "type": "object",
        "required": [
          "name",
          "headline",
          "price_after_pilot",
          "steps",
          "booking"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "what_memox_is": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "exit": {
            "type": "string"
          },
          "agreement": {
            "type": "string"
          },
          "needs_from_you": {
            "type": "string"
          },
          "price_after_pilot": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "title",
                "text"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "faq": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QA"
            }
          },
          "systems": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/Page"
          },
          "booking": {
            "$ref": "#/components/schemas/Booking"
          }
        }
      },
      "Products": {
        "type": "object",
        "required": [
          "products"
        ],
        "properties": {
          "note": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "slug",
                "name",
                "line",
                "page"
              ],
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "line": {
                  "type": "string"
                },
                "result": {
                  "type": "string"
                },
                "does_today": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "headline": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "jobs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    }
                  }
                },
                "features": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "faq": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QA"
                  }
                },
                "page": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          }
        }
      },
      "Proof": {
        "type": "object",
        "required": [
          "customer",
          "in_use",
          "page"
        ],
        "properties": {
          "customer": {
            "type": "string"
          },
          "about": {
            "type": "string"
          },
          "in_use": {
            "type": "string"
          },
          "products_used": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "line": {
                  "type": "string"
                },
                "page": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "numbers": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "as_of": {
                "type": "string"
              },
              "chat_sessions": {
                "type": "integer"
              },
              "stayed_with_the_ai": {
                "type": "integer"
              },
              "handed_to_a_person": {
                "type": "integer"
              },
              "had_a_rep_assigned": {
                "type": "integer"
              },
              "line": {
                "type": "string"
              },
              "how_to_quote": {
                "type": "string"
              }
            }
          },
          "page": {
            "$ref": "#/components/schemas/Page"
          }
        }
      },
      "Trust": {
        "type": "object",
        "required": [
          "answers",
          "page"
        ],
        "properties": {
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "answer": {
                  "type": "string"
                }
              }
            }
          },
          "dpa": {
            "type": "string"
          },
          "data_location": {
            "type": "string"
          },
          "training": {
            "type": "string"
          },
          "support": {
            "type": "string"
          },
          "channels": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/Page"
          }
        }
      },
      "Events": {
        "type": "object",
        "required": [
          "events"
        ],
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "days": {
                  "type": "string"
                },
                "stand": {
                  "type": "string"
                },
                "line": {
                  "type": "string"
                },
                "ends_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "page": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          }
        }
      },
      "Pages": {
        "type": "object",
        "required": [
          "pages"
        ],
        "properties": {
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "path",
                "url",
                "markdown"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "markdown": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "PilotRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "email",
          "company",
          "ai_first",
          "submitted_by_agent",
          "agent_name",
          "user_consent"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The person's name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "The person's work email."
          },
          "company": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "ai_first": {
            "type": "string",
            "enum": [
              "website",
              "phone",
              "handoff",
              "other"
            ],
            "description": "What AI should do first: website = Answer website visitors; phone = Answer the phone; handoff = Hand buyers to the right rep; other = Something else."
          },
          "phone": {
            "type": "string",
            "maxLength": 30,
            "description": "Optional."
          },
          "submitted_by_agent": {
            "type": "boolean",
            "const": true
          },
          "agent_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The name of your agent or product."
          },
          "user_consent": {
            "type": "boolean",
            "const": true,
            "description": "The person agreed that you share these details with Memox."
          }
        },
        "examples": [
          {
            "name": "Sara Malik",
            "email": "sara@example.com",
            "company": "Example Trading",
            "ai_first": "website",
            "submitted_by_agent": true,
            "agent_name": "Example Assistant",
            "user_consent": true
          }
        ]
      },
      "PilotRequestReceived": {
        "type": "object",
        "required": [
          "status",
          "id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "received"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "booking_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "booking_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
