{
  "openapi": "3.1.0",
  "info": {
    "title": "Automo connector",
    "version": "0.2.0",
    "summary": "Create designs, videos and docs; search files, brand, mail and CRM",
    "description": "Automo is one workspace for creating and running a business: designs, videos, documents and spreadsheets; files, brand kits, knowledge base, mail, meetings, tasks, customers and campaigns. Agents integrate through the MCP server at https://mo.automo.ai/mcp, not through a workspace REST API. OAuth 2.0 with PKCE is required. Human docs: https://automo.ai/developers. Auth walkthrough: https://automo.ai/auth.md.",
    "contact": {
      "name": "Automo",
      "url": "https://automo.ai",
      "email": "support@automo.ai"
    }
  },
  "servers": [
    {
      "url": "https://mo.automo.ai",
      "description": "Automo MCP and OAuth host"
    }
  ],
  "tags": [
    {
      "name": "mcp",
      "description": "Model Context Protocol Streamable HTTP"
    },
    {
      "name": "oauth",
      "description": "OAuth 2.0 authorization server"
    },
    {
      "name": "discovery",
      "description": "Well-known metadata"
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcpStreamableHttp",
        "tags": [
          "mcp"
        ],
        "summary": "MCP Streamable HTTP endpoint",
        "description": "JSON-RPC MCP messages over Streamable HTTP. Authenticate with a Bearer token from the OAuth token endpoint. GET is not supported (405).",
        "security": [
          {
            "oauth2": []
          },
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token. WWW-Authenticate points at protected-resource metadata."
          }
        }
      },
      "get": {
        "operationId": "mcpGetNotSupported",
        "tags": [
          "mcp"
        ],
        "summary": "MCP GET is not supported",
        "description": "Stateless Streamable HTTP. GET /mcp returns 405. Use POST.",
        "responses": {
          "405": {
            "description": "Method not allowed. Use POST."
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "oauthAuthorizationServerMetadata",
        "tags": [
          "discovery"
        ],
        "summary": "RFC 8414 authorization server metadata",
        "description": "Issuer, authorize, token, registration and PKCE S256 support for the Automo connector.",
        "security": [],
        "responses": {
          "200": {
            "description": "Authorization server metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "oauthProtectedResourceMetadata",
        "tags": [
          "discovery"
        ],
        "summary": "RFC 9728 protected resource metadata",
        "description": "Describes the MCP resource at /mcp and the authorization servers that protect it.",
        "security": [],
        "responses": {
          "200": {
            "description": "Protected resource metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/mcp": {
      "get": {
        "operationId": "oauthProtectedResourceMetadataMcp",
        "tags": [
          "discovery"
        ],
        "summary": "RFC 9728 metadata for the /mcp resource path",
        "description": "Same body as /.well-known/oauth-protected-resource, located for an endpoint at /mcp.",
        "security": [],
        "responses": {
          "200": {
            "description": "Protected resource metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/oauth/register": {
      "post": {
        "operationId": "oauthRegisterClient",
        "tags": [
          "oauth"
        ],
        "summary": "RFC 7591 dynamic client registration",
        "description": "Register an OAuth client. No prior credential is required.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "operationId": "oauthAuthorize",
        "tags": [
          "oauth"
        ],
        "summary": "Authorization endpoint",
        "description": "Authorization-code flow with PKCE S256. The person signs in to Automo and consents. Response type is code.",
        "security": [],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the client with code, or to sign-in."
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "oauthToken",
        "tags": [
          "oauth"
        ],
        "summary": "Token endpoint",
        "description": "Exchange an authorization code (or a refresh token) for an access token. Supports authorization_code and refresh_token.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "authorization_code",
                      "refresh_token"
                    ]
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "refresh_token": {
                    "type": "string"
                  }
                },
                "required": [
                  "grant_type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_grant or invalid_request"
          }
        }
      }
    },
    "/oauth/userinfo": {
      "get": {
        "operationId": "oauthUserinfo",
        "tags": [
          "oauth"
        ],
        "summary": "OIDC userinfo",
        "description": "Returns sub, email and email_verified for the connected Automo user.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Userinfo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.0 authorization code with PKCE S256. The authorization server is mo.automo.ai. Dynamic client registration is available.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://mo.automo.ai/oauth/authorize",
            "tokenUrl": "https://mo.automo.ai/oauth/token",
            "refreshUrl": "https://mo.automo.ai/oauth/token",
            "scopes": {
              "files:read": "Read files (media library)",
              "files:write": "Upload files (media library)",
              "files:admin": "Open restricted folders & change folder access",
              "kb:read": "Read knowledge base",
              "kb:write": "Write knowledge base pages",
              "chat:read": "Read chat channels",
              "chat:write": "Post chat messages",
              "brand:read": "Read brand kits & brand assets",
              "brand:write": "Create & edit brand kits (colours, fonts, logos, guidelines)",
              "templates:read": "Read templates",
              "projects:read": "Read projects, designs, videos & spreadsheets",
              "projects:write": "Create and edit projects, designs, videos & spreadsheets",
              "campaigns:read": "Read Automo Connect campaigns",
              "campaigns:write": "Build and edit Automo Connect campaigns",
              "mail:read": "Read your mail",
              "mail:send": "Send mail as you",
              "meetings:read": "Read meeting transcripts",
              "contacts:read": "Read contacts",
              "crm:read": "Read companies & deals",
              "crm:write": "Create and update contacts, companies & deals",
              "support:read": "Read support tickets",
              "support:write": "Update support tickets",
              "tasks:read": "Read tasks",
              "tasks:write": "Create and update tasks",
              "calendar:read": "Read your calendar",
              "calendar:write": "Add events to your calendar, invite people, edit & remove your own",
              "calendar:team": "See teammates' free/busy time (busy windows only)",
              "esign:read": "Read envelopes sent for signature",
              "esign:write": "Prepare documents for signature",
              "esign:send": "Send or void documents for signature",
              "marketing:read": "Read marketing email sequences",
              "marketing:write": "Draft marketing email sequences (never activate them)",
              "sharing:read": "See a project's public share links",
              "sharing:write": "Create & revoke public share links",
              "retail:read": "Read venues & menus",
              "retail:write": "Set up venues & edit menus",
              "screens:read": "Read venue screens",
              "screens:write": "Put designs on venue screens",
              "openid": "OpenID Connect identifier",
              "email": "Email address of the connected user",
              "profile": "Display name of the connected user",
              "offline_access": "Refresh tokens so the connector stays connected"
            }
          }
        }
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "description": "Access token from POST /oauth/token on mo.automo.ai."
      }
    }
  }
}
