{"openapi":"3.1.0","info":{"title":"Mindmap API","version":"1.0.0","summary":"Leitura e escrita de mapas mentais do Mindmap por agentes de IA e automações.","description":"API REST do Mindmap (www.mindmap.app.br). A mesma funcionalidade está disponível por MCP em /api/mcp/mcp. Autenticação por chave pessoal criada em /settings; o acesso programático faz parte dos planos Pro e Teams. Limites por chave: 600 leituras/hora, 120 escritas/hora, corpo de até 1 MB e 2000 nós por mapa.","contact":{"name":"Suporte Mindmap","email":"contato@mindmap.app.br","url":"https://www.mindmap.app.br/contact"},"termsOfService":"https://www.mindmap.app.br/terms"},"externalDocs":{"description":"Documentação para desenvolvedores e agentes","url":"https://www.mindmap.app.br/docs"},"servers":[{"url":"https://www.mindmap.app.br/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/maps":{"get":{"operationId":"listMaps","summary":"Lista os mapas visíveis para o dono da chave","responses":{"200":{"description":"Mapas próprios e compartilhados","content":{"application/json":{"schema":{"type":"object","properties":{"maps":{"type":"array","items":{"$ref":"#/components/schemas/MapSummary"}}},"required":["maps"]}}}},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createMap","summary":"Cria um mapa a partir de markdown ou de uma árvore","description":"Envie markdown OU tree, nunca os dois. Sem nenhum dos dois, cria um mapa vazio. Exige escopo write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapContent"}}}},"responses":{"201":{"description":"Mapa criado","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id","title","url"]}}}},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/maps/{id}":{"get":{"operationId":"getMap","summary":"Lê um mapa","parameters":[{"name":"id","in":"path","required":true,"description":"Identificador do mapa (UUID).","schema":{"type":"string","format":"uuid"}},{"name":"format","in":"query","required":false,"description":"markdown devolve texto legível; tree devolve a árvore com os ids dos nós; both devolve os dois.","schema":{"type":"string","enum":["markdown","tree","both"],"default":"markdown"}}],"responses":{"200":{"description":"Conteúdo do mapa","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/MapSummary"},"markdown":{"type":"string"},"tree":{"$ref":"#/components/schemas/ApiTreeNode"}},"required":["meta"]}}}},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"replaceMap","summary":"Substitui todo o conteúdo de um mapa","description":"Exige escopo write. Para edições pontuais, use POST /maps/{id}/ops.","parameters":[{"name":"id","in":"path","required":true,"description":"Identificador do mapa (UUID).","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapContent"}}}},"responses":{"200":{"description":"Mapa substituído","content":{"application/json":{"schema":{"type":"object","properties":{"tree":{"$ref":"#/components/schemas/ApiTreeNode"}},"required":["tree"]}}}},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"O mapa mudou durante a escrita","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteMap","summary":"Exclui um mapa","description":"Apenas o dono pode excluir. Exige escopo write.","parameters":[{"name":"id","in":"path","required":true,"description":"Identificador do mapa (UUID).","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Excluído"},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/maps/{id}/ops":{"post":{"operationId":"applyNodeOps","summary":"Aplica um lote atômico de operações em nós","description":"De 1 a 100 operações; ou todas passam, ou nenhuma. Um add_node pode declarar ref no formato $nome, usável como parentId ou nodeId por operações seguintes do mesmo lote. Exige escopo write.","parameters":[{"name":"id","in":"path","required":true,"description":"Identificador do mapa (UUID).","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsBody"}}}},"responses":{"200":{"description":"Operações aplicadas","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"object","description":"Mapeia cada ref declarado (sem o $) para o id do nó criado.","additionalProperties":{"type":"string"}},"tree":{"$ref":"#/components/schemas/ApiTreeNode"}},"required":["created","tree"]}}}},"400":{"description":"Corpo ou parâmetro inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave de API ausente, inválida ou revogada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"O plano da conta não inclui acesso programático","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Chave somente leitura ou sem permissão no mapa","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapa não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Uma operação do lote não pôde ser aplicada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite por hora atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Chave pessoal criada em /settings, no formato \"mm_\" seguido de 43 caracteres. Envie como Authorization: Bearer mm_..."}},"schemas":{"MapContent":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"markdown":{"type":"string","maxLength":500000},"tree":{"$ref":"#/components/schemas/TreeNodeInput"}}},"OpsBody":{"type":"object","properties":{"ops":{"minItems":1,"maxItems":100,"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"add_node"},"parentId":{"type":"string","minLength":1,"maxLength":64},"text":{"type":"string","maxLength":500},"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"note":{"type":"string","maxLength":10000},"link":{"type":"string","maxLength":2048},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"ref":{"type":"string","pattern":"^\\$[\\w-]{1,32}$"}},"required":["op","parentId","text"]},{"type":"object","properties":{"op":{"type":"string","const":"update_node"},"nodeId":{"type":"string","minLength":1,"maxLength":64},"text":{"type":"string","maxLength":500},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"link":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"collapsed":{"type":"boolean"}},"required":["op","nodeId"]},{"type":"object","properties":{"op":{"type":"string","const":"move_node"},"nodeId":{"type":"string","minLength":1,"maxLength":64},"newParentId":{"type":"string","minLength":1,"maxLength":64},"index":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["op","nodeId"]},{"type":"object","properties":{"op":{"type":"string","const":"delete_node"},"nodeId":{"type":"string","minLength":1,"maxLength":64}},"required":["op","nodeId"]}]}}},"required":["ops"]},"TreeNodeInput":{"type":"object","properties":{"text":{"type":"string","maxLength":500},"note":{"type":"string","maxLength":10000},"link":{"type":"string","maxLength":2048},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"children":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/TreeNodeInput"}}},"required":["text"]},"MapSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"folder":{"type":["string","null"]},"role":{"type":"string","enum":["owner","editor","viewer"]},"isPublic":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","folder","role","isPublic","createdAt","updatedAt"]},"ApiTreeNode":{"type":"object","description":"Nó da árvore como devolvido pela API, com o id necessário para /ops.","properties":{"id":{"type":"string"},"text":{"type":"string"},"note":{"type":"string"},"link":{"type":"string"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"collapsed":{"type":"boolean"},"children":{"type":"array","items":{"$ref":"#/components/schemas/ApiTreeNode"}}},"required":["id","text"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_key","forbidden","not_found","validation_error","payload_too_large","op_failed","conflict","rate_limited","plan_limit","internal"]},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]}}}}