{
  "openapi": "3.1.0",
  "info": {
    "title": "MintMCP Admin API",
    "version": "1.0.0",
    "description": "Create an Admin API key under Enterprise → API keys and send it as `Authorization: Bearer <Admin API key>`. Requests run with exactly the permissions granted to the key."
  },
  "servers": [
    {
      "url": "https://app.mintmcp.com"
    }
  ],
  "security": [
    {
      "adminApiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "adminApiKey": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/api/admin/v1/mcp-activity/summary": {
      "get": {
        "operationId": "getMcpActivitySummary",
        "summary": "Summarize MCP tool activity",
        "description": "Tool-call totals, a call timeline, activity per virtual MCP and per connector, and the most-called tools for the organization, over a window of up to 90 days. The same data as the MCP activity dashboard. Responses are cached for up to 5 minutes per set of query parameters, so with `end` omitted, a repeated request can return the same window. Requires `org:activity-metadata:view` or `view-organization-logs`.",
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (ISO 8601). Defaults to 24 hours before end.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (ISO 8601). Defaults to now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "window": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "end": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ]
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "calls": {
                          "type": "integer"
                        },
                        "successfulCalls": {
                          "type": "integer"
                        },
                        "failedCalls": {
                          "type": "integer"
                        },
                        "activeActors": {
                          "type": "integer"
                        },
                        "averageResponseTimeMs": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "calls",
                        "successfulCalls",
                        "failedCalls",
                        "activeActors",
                        "averageResponseTimeMs"
                      ]
                    },
                    "timeline": {
                      "type": "object",
                      "properties": {
                        "bucketMinutes": {
                          "type": "integer"
                        },
                        "buckets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "calls": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "start",
                              "calls"
                            ]
                          }
                        }
                      },
                      "required": [
                        "bucketMinutes",
                        "buckets"
                      ]
                    },
                    "vmcps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "calls": {
                            "type": "integer"
                          },
                          "successfulCalls": {
                            "type": "integer"
                          },
                          "activeActors": {
                            "type": "integer"
                          },
                          "averageResponseTimeMs": {
                            "type": "integer"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "deleted": {
                            "type": "boolean"
                          },
                          "connectors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "calls": {
                                  "type": "integer"
                                },
                                "successfulCalls": {
                                  "type": "integer"
                                },
                                "activeActors": {
                                  "type": "integer"
                                },
                                "averageResponseTimeMs": {
                                  "type": "integer"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "calls",
                                "successfulCalls",
                                "activeActors",
                                "averageResponseTimeMs",
                                "id",
                                "name"
                              ]
                            }
                          }
                        },
                        "required": [
                          "calls",
                          "successfulCalls",
                          "activeActors",
                          "averageResponseTimeMs",
                          "id",
                          "name",
                          "deleted",
                          "connectors"
                        ]
                      }
                    },
                    "connectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "calls": {
                            "type": "integer"
                          },
                          "successfulCalls": {
                            "type": "integer"
                          },
                          "activeActors": {
                            "type": "integer"
                          },
                          "averageResponseTimeMs": {
                            "type": "integer"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "calls",
                          "successfulCalls",
                          "activeActors",
                          "averageResponseTimeMs",
                          "id",
                          "name"
                        ]
                      }
                    },
                    "topTools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "connectorId": {
                            "type": "string"
                          },
                          "connectorName": {
                            "type": "string"
                          },
                          "calls": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "name",
                          "connectorId",
                          "connectorName",
                          "calls"
                        ]
                      }
                    }
                  },
                  "required": [
                    "window",
                    "totals",
                    "timeline",
                    "vmcps",
                    "connectors",
                    "topTools"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/v1/mcp-activity/users": {
      "get": {
        "operationId": "listMcpActivityUsers",
        "summary": "List MCP activity per user",
        "description": "Per-user MCP tool activity over a window of up to 90 days: each member's tool calls, how many virtual MCPs and distinct tools they used, when they were last active, and their most-used tools and virtual MCPs. The same data as the Team usage table. Agents are not included. By default only members with activity are listed, most calls first; with `includeInactive=true`, every current member is listed in user ID order. To page, pass `nextCursor` back as `cursor` until it is absent. Requires `org:activity-metadata:view` or `view-organization-logs`.",
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (ISO 8601). Defaults to 24 hours before end.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (ISO 8601). Defaults to now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "required": false,
            "description": "`true` lists every current member, including members with no activity in the window. Defaults to `false`.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum users per page. Defaults to 25. Applies to each request, including ones that pass `cursor`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "topItemsPerUser",
            "in": "query",
            "required": false,
            "description": "How many top tools and virtual MCPs to return per user. Defaults to 5.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`nextCursor` from the previous page. The cursor keeps the window and `includeInactive`: pass the first request's values or omit them; a different value is a 400.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "window": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "end": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ]
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "maxLength": 40
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "Admin",
                              "Member"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "Active",
                              "Invited"
                            ]
                          },
                          "lastActive": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "calls": {
                            "type": "integer"
                          },
                          "vmcpsUsed": {
                            "type": "integer"
                          },
                          "toolsUsed": {
                            "type": "integer"
                          },
                          "topTools": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "calls": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "name",
                                "calls"
                              ]
                            }
                          },
                          "topVmcps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "calls": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "calls"
                              ]
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "email",
                          "role",
                          "status",
                          "lastActive",
                          "calls",
                          "vmcpsUsed",
                          "toolsUsed",
                          "topTools",
                          "topVmcps"
                        ]
                      }
                    },
                    "nextCursor": {
                      "description": "Present when more pages remain. Pass it back as `cursor`.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "window",
                    "users"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/v1/organizations/me": {
      "get": {
        "operationId": "getOrganizationsMe",
        "summary": "Get the calling key's organization",
        "description": "Returns the organization the Admin API key belongs to, along with the key's ID, permissions, and expiry. Requires no permission, so it is a safe way to check a key.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organization": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "adminApiKey": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "permissions": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "org:activity-metadata:view",
                              "view-organization-logs"
                            ]
                          }
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "permissions",
                        "expiresAt"
                      ]
                    }
                  },
                  "required": [
                    "organization",
                    "adminApiKey"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "invalid_request",
                            "unauthorized",
                            "forbidden",
                            "not_found",
                            "internal_error"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ]
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
