{
  "openapi": "3.1.0",
  "info": {
    "title": "Chatfuel Docs API",
    "version": "1.0.0",
    "description": "Read-only search over the Chatfuel Help Center and the Chatfuel Public API reference, for AI agents. No authentication. Guide: https://chatfuel.com/docs/api"
  },
  "servers": [
    {
      "url": "https://chatfuel.com"
    }
  ],
  "paths": {
    "/docs/api/v1/search": {
      "get": {
        "operationId": "searchDocs",
        "summary": "Search help articles and the Public API reference",
        "description": "Results are grouped by page, with up to three matching sections each. Open a section with its section_url. When q is an operation name, `operation` holds it.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Words, a question or an operation name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "description": "help: help articles; developers: Public API and Chatfuel MCP. Default: both.",
            "schema": {
              "type": "string",
              "enum": [
                "help",
                "developers"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Pages to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language of the docs: en (default), es or pt.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "pt"
              ],
              "default": "en"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "md (default) returns Markdown; json returns JSON.",
            "schema": {
              "type": "string",
              "enum": [
                "md",
                "json"
              ],
              "default": "md"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    },
                    "section": {
                      "type": "string"
                    },
                    "operation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "contactsConnection, or Bot.contactsCount for fields of Bot"
                            },
                            "field": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "description": "GraphQL type the field belongs to: Query, Mutation, Subscription, Bot, CurrentUserAccount"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "query",
                                "mutation",
                                "subscription"
                              ]
                            },
                            "role": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Lowest role that may call it"
                            },
                            "description": {
                              "type": "string"
                            },
                            "errors": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "signature": {
                              "type": "string"
                            },
                            "reference_url": {
                              "type": "string",
                              "description": "Help center section that documents it"
                            },
                            "url": {
                              "type": "string",
                              "description": "This operation in the Docs API"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "markdown_url": {
                            "type": "string"
                          },
                          "section": {
                            "type": "string",
                            "enum": [
                              "help",
                              "developers"
                            ]
                          },
                          "breadcrumbs": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "last_updated": {
                            "type": "string"
                          },
                          "matches": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "heading": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "section_url": {
                                  "type": "string"
                                },
                                "snippet": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters or nothing found. The body says what to call instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "guide": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/docs/api/v1/operations": {
      "get": {
        "operationId": "listOperations",
        "summary": "List Public API operations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Filter by name and description; every word must match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "query",
                "mutation",
                "subscription"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language of the docs: en (default), es or pt.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "pt"
              ],
              "default": "en"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "md (default) returns Markdown; json returns JSON.",
            "schema": {
              "type": "string",
              "enum": [
                "md",
                "json"
              ],
              "default": "md"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lang": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "contactsConnection, or Bot.contactsCount for fields of Bot"
                          },
                          "field": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "description": "GraphQL type the field belongs to: Query, Mutation, Subscription, Bot, CurrentUserAccount"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "query",
                              "mutation",
                              "subscription"
                            ]
                          },
                          "role": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Lowest role that may call it"
                          },
                          "description": {
                            "type": "string"
                          },
                          "errors": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "signature": {
                            "type": "string"
                          },
                          "reference_url": {
                            "type": "string",
                            "description": "Help center section that documents it"
                          },
                          "url": {
                            "type": "string",
                            "description": "This operation in the Docs API"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters or nothing found. The body says what to call instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "guide": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/docs/api/v1/operations/{name}": {
      "get": {
        "operationId": "getOperation",
        "summary": "One Public API operation with its reference section",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "contactsConnection, Bot.contactsCount or Mutation.renameBot; any case.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language of the docs: en (default), es or pt.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "pt"
              ],
              "default": "en"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "md (default) returns Markdown; json returns JSON.",
            "schema": {
              "type": "string",
              "enum": [
                "md",
                "json"
              ],
              "default": "md"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "contactsConnection, or Bot.contactsCount for fields of Bot"
                    },
                    "field": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "description": "GraphQL type the field belongs to: Query, Mutation, Subscription, Bot, CurrentUserAccount"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "query",
                        "mutation",
                        "subscription"
                      ]
                    },
                    "role": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Lowest role that may call it"
                    },
                    "description": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "signature": {
                      "type": "string"
                    },
                    "reference_url": {
                      "type": "string",
                      "description": "Help center section that documents it"
                    },
                    "url": {
                      "type": "string",
                      "description": "This operation in the Docs API"
                    },
                    "reference_section": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "markdown": {
                          "type": "string"
                        }
                      }
                    },
                    "same_page": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Bad parameters or nothing found. The body says what to call instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "guide": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/docs/api/v1/page": {
      "get": {
        "operationId": "getPage",
        "summary": "A help center page, or one section of it, as Markdown",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Slug such as whatsapp/24-hour-messaging-window, or a help center URL; an #anchor selects the section.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "description": "Heading id of one section.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language of the docs: en (default), es or pt.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "pt"
              ],
              "default": "en"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "md (default) returns Markdown; json returns JSON.",
            "schema": {
              "type": "string",
              "enum": [
                "md",
                "json"
              ],
              "default": "md"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "last_updated": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    },
                    "section": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters or nothing found. The body says what to call instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "guide": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Bad parameters or nothing found. The body says what to call instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "guide": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}