{
  "openapi": "3.1.0",
  "info": {
    "title": "MindCloud Public API",
    "version": "2.0.0",
    "description": "REST surface under /v2. Authenticate with a MindCloud API key sent as a bearer token."
  },
  "servers": [
    {
      "url": "https://connect.mindcloud.co"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v2/workflows": {
      "get": {
        "operationId": "v2-list-workflows",
        "summary": "List workflows for the company with filtering, sorting, and pagination",
        "description": "List workflows for the company with filtering, sorting, and pagination. The workflow definition is only available on the detail endpoint.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, name, type, isActive, isTemplate, stage, size, createdOn, createdBy, updatedOn, updatedBy. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "name": {},
                          "type": {},
                          "isActive": {},
                          "isTemplate": {},
                          "stage": {},
                          "size": {},
                          "createdOn": {},
                          "createdBy": {},
                          "updatedOn": {},
                          "updatedBy": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/workflows/{workflowId}": {
      "get": {
        "operationId": "v2-get-workflow",
        "summary": "Get one workflow, including its full definition and summary",
        "description": "Get one workflow, including its full definition and summary.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/workflows/{workflowId}/versions": {
      "get": {
        "operationId": "v2-list-workflow-versions",
        "summary": "List versions of a workflow: the mutable draft (version \"draft\") plus published and unpublished snapshots, newest first",
        "description": "List versions of a workflow: the mutable draft (version \"draft\") plus published and unpublished snapshots, newest first.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/workflows/{workflowId}/runs": {
      "get": {
        "operationId": "v2-list-runs",
        "summary": "List runs of one workflow with filtering, sorting, and pagination",
        "description": "List runs of one workflow with filtering, sorting, and pagination. Filter by status, version, environmentId, startedOn range, endUserId, or installationId.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, workflowId, status, version, environmentId, environmentName, startedOn, finishedOn, durationMs, operations, errorCount, warningCount, infoCount, endUserId, installationId, triggerAppSlug. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "workflowId": {},
                          "status": {},
                          "version": {},
                          "environmentId": {},
                          "environmentName": {},
                          "startedOn": {},
                          "finishedOn": {},
                          "durationMs": {},
                          "operations": {},
                          "errorCount": {},
                          "warningCount": {},
                          "infoCount": {},
                          "endUserId": {},
                          "installationId": {},
                          "triggerAppSlug": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/runs/{runId}": {
      "get": {
        "operationId": "v2-get-run",
        "summary": "Get one workflow run, including its summary and, while running, the active step and message",
        "description": "Get one workflow run, including its summary and, while running, the active step and message.",
        "tags": [
          "runs"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/runs/{runId}/operations": {
      "get": {
        "operationId": "v2-list-run-operations",
        "summary": "List record-level operations (creates, updates, errors, warnings) for one run",
        "description": "List record-level operations (creates, updates, errors, warnings) for one run. Filter by actionStatus or operation.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "runs"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, workflowLogId, stepId, stepInstanceId, actionId, appId, model, operation, actionStatus, primaryKey, message, createdOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "workflowLogId": {},
                          "stepId": {},
                          "stepInstanceId": {},
                          "actionId": {},
                          "appId": {},
                          "model": {},
                          "operation": {},
                          "actionStatus": {},
                          "primaryKey": {},
                          "message": {},
                          "createdOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/runs/{runId}/steps": {
      "get": {
        "operationId": "v2-list-run-steps",
        "summary": "List the executed steps of one run as a flat index (no payloads)",
        "description": "List the executed steps of one run as a flat index (no payloads). Fetch a single step for its full request and response.",
        "tags": [
          "runs"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/runs/{runId}/steps/{stepInstanceId}": {
      "get": {
        "operationId": "v2-get-run-step",
        "summary": "Get one executed step of a run, including its full request and response payloads",
        "description": "Get one executed step of a run, including its full request and response payloads.",
        "tags": [
          "runs"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "stepInstanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/connections": {
      "get": {
        "operationId": "v2-list-connections",
        "summary": "List connections (credentials) for the company",
        "description": "List connections (credentials) for the company. Secrets are never included. Filter by appId, status, valid, or expiresOn for expiry monitoring.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "connections"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, appId, status, valid, validOn, isDefault, isCompany, endUserId, installationId, userId, testedOn, expiresOn, authenticatedOn, createdOn, createdBy, updatedOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "appId": {},
                          "status": {},
                          "valid": {},
                          "validOn": {},
                          "isDefault": {},
                          "isCompany": {},
                          "endUserId": {},
                          "installationId": {},
                          "userId": {},
                          "testedOn": {},
                          "expiresOn": {},
                          "authenticatedOn": {},
                          "createdOn": {},
                          "createdBy": {},
                          "updatedOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/connections/{connectionId}": {
      "get": {
        "operationId": "v2-get-connection",
        "summary": "Get one connection (credential)",
        "description": "Get one connection (credential). Secrets are never included.",
        "tags": [
          "connections"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/users": {
      "get": {
        "operationId": "v2-list-users",
        "summary": "List members of the company",
        "description": "List members of the company.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: userId, name, email, isPending, roleId, roleName, createdOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {},
                          "name": {},
                          "email": {},
                          "isPending": {},
                          "roleId": {},
                          "roleName": {},
                          "createdOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/roles": {
      "get": {
        "operationId": "v2-list-roles",
        "summary": "List roles available to the company, including global platform roles (isGlobal)",
        "description": "List roles available to the company, including global platform roles (isGlobal). Fetch a single role for its permissions.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "roles"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, name, isAdmin, isGlobal, createdOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "name": {},
                          "isAdmin": {},
                          "isGlobal": {},
                          "createdOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/roles/{roleId}": {
      "get": {
        "operationId": "v2-get-role",
        "summary": "Get one role with its permissions",
        "description": "Get one role with its permissions.",
        "tags": [
          "roles"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/companies": {
      "get": {
        "operationId": "v2-list-companies",
        "summary": "List companies with subscription info (plan, Stripe product id, legacy flag, member count)",
        "description": "List companies with subscription info (plan, Stripe product id, legacy flag, member count).\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "companies"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, name, description, isPersonal, timezone, settings, isDeleted, createdOn, updatedOn, plan, stripeSubscriptionProductId, subscriptionIsLegacy, subscriptionUpdatedOn, memberCount. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "name": {},
                          "description": {},
                          "isPersonal": {},
                          "timezone": {},
                          "settings": {},
                          "isDeleted": {},
                          "createdOn": {},
                          "updatedOn": {},
                          "plan": {},
                          "stripeSubscriptionProductId": {},
                          "subscriptionIsLegacy": {},
                          "subscriptionUpdatedOn": {},
                          "memberCount": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/environments": {
      "get": {
        "operationId": "v2-list-environments",
        "summary": "List company environments with the number of scheduled workflows targeting each",
        "description": "List company environments with the number of scheduled workflows targeting each. Use environment ids to filter runs.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "environments"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, name, isDefault, workflowCount, createdOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "name": {},
                          "isDefault": {},
                          "workflowCount": {},
                          "createdOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/api-keys": {
      "get": {
        "operationId": "v2-list-api-keys",
        "summary": "List API keys for the company: name, last use, and revocation state",
        "description": "List API keys for the company: name, last use, and revocation state. Key material is never included.\n\nEach listed field can also be used directly as a filter query parameter, with optional bracket operators (eq, ne, gt, gte, lt, lte, contains, starts, ends, in, nin), e.g. `status=active` or `createdOn[gte]=2026-01-01`.",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "RSQL filter expression. Available fields: id, name, usedOn, revokedOn, createdOn, createdBy, updatedOn. Operators: ==, !=, >, >=, <, <=, =in=, =out=, =like=. Logical: ; (AND), , (OR). Example: \"status==active;name=like=Sales\""
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {},
                          "name": {},
                          "usedOn": {},
                          "revokedOn": {},
                          "createdOn": {},
                          "createdBy": {},
                          "updatedOn": {}
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "v2-create-api-key",
        "summary": "Create an API key for the company",
        "description": "Create an API key for the company. The key material is returned once, in this response, and can never be retrieved again.",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/api-keys/{apiKeyId}": {
      "delete": {
        "operationId": "v2-revoke-api-key",
        "summary": "Revoke an API key",
        "description": "Revoke an API key. The key stops working immediately. Revoking an already revoked key changes nothing and succeeds.",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "apiKeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/me": {
      "get": {
        "operationId": "v2-get-me",
        "summary": "Describe the calling API key and its effective company scope",
        "description": "Describe the calling API key and its effective company scope. Useful to verify credentials.",
        "tags": [
          "me"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/usage": {
      "get": {
        "operationId": "v2-get-usage",
        "summary": "Get the company task usage summary for the current accounting period (trailing 30 days): used tasks, task limit, and soft-limit flag",
        "description": "Get the company task usage summary for the current accounting period (trailing 30 days): used tasks, task limit, and soft-limit flag.",
        "tags": [
          "usage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/usage/daily": {
      "get": {
        "operationId": "v2-get-usage-daily",
        "summary": "Get the daily task usage series",
        "description": "Get the daily task usage series. Defaults to the trailing 30 days; pass from/to (YYYY-MM-DD) to re-window. The window is capped at 45 days.",
        "tags": [
          "usage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/usage/workflows": {
      "get": {
        "operationId": "v2-get-usage-workflows",
        "summary": "Get task usage broken down by workflow, highest first",
        "description": "Get task usage broken down by workflow, highest first. Defaults to the trailing 30 days; pass from/to (YYYY-MM-DD) to re-window. The window is capped at 45 days.",
        "tags": [
          "usage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "description": "Endpoint-specific payload. See the endpoint description."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/openapi.json": {
      "get": {
        "operationId": "v2-get-openapi-document",
        "summary": "Get this OpenAPI document",
        "description": "The OpenAPI 3.1 document describing the v2 surface, generated from the endpoint registry. No authentication required.",
        "tags": [
          "meta"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The OpenAPI document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "MindCloud API key, sent as a bearer token."
      }
    },
    "parameters": {
      "fields": {
        "name": "fields",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Comma-separated list of fields to return (e.g. \"id,name,status\")."
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 100
        },
        "description": "Maximum number of results to return (1-1000, default 100)."
      },
      "offset": {
        "name": "offset",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "description": "Number of results to skip for pagination (default 0)."
      },
      "sort": {
        "name": "sort",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Comma-separated sort fields. Prefix with - for descending (e.g. \"-createdOn,name\")."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "ListMeta": {
        "type": "object",
        "properties": {
          "pagination": {
            "type": "object",
            "properties": {
              "totalCount": {
                "type": "integer"
              },
              "hasNextPage": {
                "type": "boolean"
              },
              "hasPreviousPage": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}