{
  "openapi": "3.1.0",
  "info": {
    "title": "Channelized API",
    "version": "1",
    "description": "The endpoints a company’s customers and their AI assistants call. Generated from the API’s source on every release."
  },
  "servers": [
    {
      "url": "https://api.{region}.channelized.ai",
      "description": "Production. Use the region your company was set up in.",
      "variables": {
        "region": {
          "default": "eu",
          "enum": [
            "eu",
            "us"
          ],
          "description": "`eu` (Belgium) or `us` (Iowa)."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Customer sign-in"
    },
    {
      "name": "MCP"
    }
  ],
  "paths": {
    "/.well-known/oauth-authorization-server/v1/{tenantKey}/oauth": {
      "get": {
        "operationId": "oauthMetadata",
        "summary": "Get the authorization server metadata",
        "description": "Authorization server metadata ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414)), served at the issuer-relative well-known path. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "registration_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "const": "code"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "authorization_code",
                          "refresh_token"
                        ]
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "S256"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "none"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "profile",
                          "email"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in."
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/v1/{tenantKey}/mcp": {
      "get": {
        "operationId": "mcpProtectedResource",
        "summary": "Get the sign-in discovery document",
        "description": "OAuth protected-resource metadata ([RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)) for the company’s MCP endpoint. An MCP client reads it after a `401` to find where to sign the customer in: the company’s authorization server under `/v1/{tenantKey}/oauth`.",
        "tags": [
          "MCP"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "resource",
                    "authorization_servers"
                  ],
                  "properties": {
                    "resource": {
                      "type": "string",
                      "format": "uri",
                      "description": "The MCP endpoint this document describes."
                    },
                    "authorization_servers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "profile",
                          "email"
                        ]
                      }
                    },
                    "bearer_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "header"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No active company has this key, or the company has not set up customer sign-in."
          }
        }
      }
    },
    "/.well-known/openid-configuration/v1/{tenantKey}/oauth": {
      "get": {
        "operationId": "oauthOpenIdConfiguration",
        "summary": "Get the OpenID configuration",
        "description": "Authorization server metadata ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414)), served at the OpenID well-known path. It is the same document. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "registration_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "const": "code"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "authorization_code",
                          "refresh_token"
                        ]
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "S256"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "none"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "profile",
                          "email"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in."
          }
        }
      }
    },
    "/v1/{tenantKey}/mcp": {
      "delete": {
        "operationId": "mcpEndSession",
        "summary": "End a session",
        "description": "Sessions hold no state on the server, so this only acknowledges the request.",
        "tags": [
          "MCP"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "description": "The session to end.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Acknowledged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mcpGet",
        "summary": "Open a stream (not supported)",
        "description": "The endpoint does not stream. Always answers `405`; send requests with POST.",
        "tags": [
          "MCP"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "405": {
            "description": "Use POST."
          }
        }
      },
      "post": {
        "operationId": "mcpRequest",
        "summary": "Send an MCP request",
        "description": "The company’s assistant as a [Model Context Protocol](https://modelcontextprotocol.io) server, over JSON-RPC 2.0.\nAny MCP client (ChatGPT, Claude, or your own) connects to this URL.\n\n- Send one request or a batch of up to 20, at most 256 KB in total.\n- `initialize` returns an `Mcp-Session-Id` header. Send it back on later requests.\n- Without a token the caller is a guest, and public tools work. A personal tool answers `401` with a\n  `WWW-Authenticate` header that points to the sign-in discovery document. Sign the customer in and retry.\n- A company that has not set up customer sign-in serves guests only: a personal tool answers with an error\n  saying so instead of `401`, and a request carrying a token is refused with `401`.\n- `tools/list` returns the tools this company offers. They differ from company to company. With customer\n  sign-in set up, a guest sees the personal tools too. Every tool's `securitySchemes` then lists both `noauth`\n  and `oauth2`, and a personal tool called as a guest answers `401`. Its result also carries the challenge in\n  `_meta[\"mcp/www_authenticate\"]`.",
        "tags": [
          "MCP"
        ],
        "security": [
          {},
          {
            "customerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "description": "The session id `initialize` returned. Omit on `initialize`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "One JSON-RPC request, or a batch of them.",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "jsonrpc",
                      "method"
                    ],
                    "properties": {
                      "jsonrpc": {
                        "const": "2.0"
                      },
                      "id": {
                        "type": [
                          "string",
                          "integer"
                        ],
                        "description": "Omit for a notification, which gets no reply."
                      },
                      "method": {
                        "type": "string",
                        "description": "An MCP method.",
                        "examples": [
                          "initialize",
                          "tools/list",
                          "tools/call",
                          "resources/list",
                          "resources/read",
                          "ping"
                        ]
                      },
                      "params": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "jsonrpc",
                        "method"
                      ],
                      "properties": {
                        "jsonrpc": {
                          "const": "2.0"
                        },
                        "id": {
                          "type": [
                            "string",
                            "integer"
                          ],
                          "description": "Omit for a notification, which gets no reply."
                        },
                        "method": {
                          "type": "string",
                          "description": "An MCP method.",
                          "examples": [
                            "initialize",
                            "tools/list",
                            "tools/call",
                            "resources/list",
                            "resources/read",
                            "ping"
                          ]
                        },
                        "params": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "minItems": 1,
                    "maxItems": 20
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The reply, or one reply per request in a batch.",
            "headers": {
              "Mcp-Session-Id": {
                "description": "Returned by `initialize`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "jsonrpc",
                        "id"
                      ],
                      "properties": {
                        "jsonrpc": {
                          "const": "2.0"
                        },
                        "id": {
                          "type": [
                            "string",
                            "integer",
                            "null"
                          ]
                        },
                        "result": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "error": {
                          "type": "object",
                          "required": [
                            "code",
                            "message"
                          ],
                          "properties": {
                            "code": {
                              "type": "integer"
                            },
                            "message": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "jsonrpc",
                          "id"
                        ],
                        "properties": {
                          "jsonrpc": {
                            "const": "2.0"
                          },
                          "id": {
                            "type": [
                              "string",
                              "integer",
                              "null"
                            ]
                          },
                          "result": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 1,
                      "maxItems": 20
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "The request held only notifications, which get no reply."
          },
          "400": {
            "description": "The body is not valid JSON-RPC.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc",
                    "id"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "const": "2.0"
                    },
                    "id": {
                      "type": [
                        "string",
                        "integer",
                        "null"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "A personal tool needs a signed-in customer, or the token sent was expired or revoked. The body still carries every reply, and `WWW-Authenticate` names the discovery document. A token sent to a company without customer sign-in is refused with `error=\"invalid_token\"` and no discovery document.",
            "headers": {
              "WWW-Authenticate": {
                "description": "Bearer, with `resource_metadata` pointing to the discovery document.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "The session id is unknown. Call `initialize` again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc",
                    "id"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "const": "2.0"
                    },
                    "id": {
                      "type": [
                        "string",
                        "integer",
                        "null"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 256 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc",
                    "id"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "const": "2.0"
                    },
                    "id": {
                      "type": [
                        "string",
                        "integer",
                        "null"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this caller.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc",
                    "id"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "const": "2.0"
                    },
                    "id": {
                      "type": [
                        "string",
                        "integer",
                        "null"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "oauthMetadataAppended",
        "summary": "Get the authorization server metadata (appended path)",
        "description": "Authorization server metadata ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414)), served at the issuer with the well-known suffix appended, for clients that look there. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "registration_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "const": "code"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "authorization_code",
                          "refresh_token"
                        ]
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "S256"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "none"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "profile",
                          "email"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in."
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/.well-known/openid-configuration": {
      "get": {
        "operationId": "oauthOpenIdConfigurationAppended",
        "summary": "Get the OpenID configuration (appended path)",
        "description": "Authorization server metadata ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414)), served at the issuer with the OpenID suffix appended. It is the same document. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "registration_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "const": "code"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "authorization_code",
                          "refresh_token"
                        ]
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "S256"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "const": "none"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "profile",
                          "email"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in."
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/authorize": {
      "get": {
        "operationId": "oauthAuthorize",
        "summary": "Start a sign-in",
        "description": "Opened in the customer's browser. Asks the customer to allow the client, then sends them to the company's own login, and back to the client's `redirect_uri` with a code. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "Must be `code`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "From client registration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "Exactly one of the URIs the client registered.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "description": "PKCE challenge.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "description": "Must be `S256`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Space-separated, from: profile, email.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Returned to the client unchanged.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "description": "If given, must be this company’s MCP endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The consent page (HTML)."
          },
          "303": {
            "description": "Back to the client’s `redirect_uri` with an OAuth error."
          },
          "400": {
            "description": "An unknown client, or a `redirect_uri` it did not register (HTML)."
          },
          "404": {
            "description": "The company has not set up customer sign-in (HTML)."
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/register": {
      "post": {
        "operationId": "oauthRegister",
        "summary": "Register a client",
        "description": "Dynamic client registration ([RFC 7591](https://www.rfc-editor.org/rfc/rfc7591)). Public clients only: there is no client secret, and every client uses PKCE. Redirect URIs must be https, or http on a loopback host. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "redirect_uris"
                ],
                "properties": {
                  "redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "minItems": 1
                  },
                  "client_name": {
                    "type": "string",
                    "description": "Shown to the customer on the consent page."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The registered client.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "client_id_issued_at": {
                      "type": "integer"
                    },
                    "redirect_uris": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "client_name": {
                      "type": "string"
                    },
                    "token_endpoint_auth_method": {
                      "const": "none"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The registration is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/revoke": {
      "post": {
        "operationId": "oauthRevoke",
        "summary": "Revoke a token",
        "description": "Token revocation ([RFC 7009](https://www.rfc-editor.org/rfc/rfc7009)). Answers `200` whether or not the token was known. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "description": "HTTP Basic, with the client id as the username. Send this or `client_id` in the form.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Required unless sent as the HTTP Basic username."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked, or never known."
          }
        }
      }
    },
    "/v1/{tenantKey}/oauth/token": {
      "post": {
        "operationId": "oauthToken",
        "summary": "Exchange a code or refresh a token",
        "description": "The token endpoint. Access tokens last up to 60 minutes and refresh tokens up to 30 days. A refresh token works once: each refresh returns a new one. Only for a company that has set up customer sign-in; for any other company it answers `404`.",
        "tags": [
          "Customer sign-in"
        ],
        "security": [],
        "parameters": [
          {
            "name": "tenantKey",
            "in": "path",
            "required": true,
            "description": "The company’s key: the short name in its assistant’s address. It appears in the console’s address and on its Connect an assistant page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "description": "HTTP Basic, with the client id as the username. Send this or `client_id` in the form.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type"
                ],
                "properties": {
                  "grant_type": {
                    "enum": [
                      "authorization_code",
                      "refresh_token"
                    ]
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Required unless sent as the HTTP Basic username."
                  },
                  "code": {
                    "type": "string",
                    "description": "For `authorization_code`."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "For `authorization_code`: the same as on authorize."
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "For `authorization_code`: the PKCE verifier."
                  },
                  "refresh_token": {
                    "type": "string",
                    "description": "For `refresh_token`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "const": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "refresh_token": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An invalid grant or request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "An unknown client.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The company has not set up customer sign-in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "customerBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An OAuth access token for one of the company’s customers, obtained through the sign-in the MCP client runs. Optional: without it the caller is a guest and only public tools work."
      }
    }
  }
}
