{
  "openapi": "3.0.3",
  "info": {
    "title": "Auto Appy CRM API",
    "version": "2026-09-22.2",
    "description": "Auto Appy native application API reference, independent of workflow actions. Use the coverage report and exclusions to audit available endpoints. Third-party adapter endpoints are internal-only. Authentication and resource permissions still apply; see each operation for its authentication contract."
  },
  "servers": [
    {
      "url": "https://crmapi.autoappy.com"
    }
  ],
  "security": [
    {
      "ApiKeyBearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Auto Appy application API key"
      },
      "UserBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "OAuth access token",
        "description": "Signed-in Auto Appy actor with platform scope and access to the requested products and records. Connector credentials are not accepted."
      }
    }
  },
  "paths": {
    "/me": {
      "get": {
        "summary": "Me auto appy auth",
        "operationId": "GET_me",
        "tags": [
          "Auto appy auth"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\AutoAppyAuthController@me",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "autoappy.session:force"
        ],
        "description": "Me for auto appy auth. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "data",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email",
              "description": "Data. Optional. "
            },
            "description": "Data. Optional. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/api/auth/me": {
      "get": {
        "summary": "Resolve selected organisation",
        "description": "",
        "operationId": "crm_get_me",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "data",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email",
              "description": "Data. Optional. "
            },
            "description": "Data. Optional. "
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Connection"
        ],
        "x-controller": "App\\Http\\Controllers\\AutoAppyAuthController@me",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "autoappy.session:force"
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces": {
      "get": {
        "summary": "List workspace",
        "operationId": "GET_workspaces",
        "tags": [
          "Workspace"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\WorkspaceController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "AutoAppy\\Platform\\CentralManagementOnly"
        ],
        "description": "Index for workspace. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}": {
      "get": {
        "summary": "Get workspace",
        "operationId": "GET_workspaces__workspace_",
        "tags": [
          "Workspace"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\WorkspaceController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "AutoAppy\\Platform\\CentralManagementOnly"
        ],
        "description": "Show for workspace. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/overview": {
      "get": {
        "summary": "Overview workspace",
        "operationId": "GET_workspaces__workspace__overview",
        "tags": [
          "Workspace"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\WorkspaceController@overview",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Overview for workspace. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/organisation-link": {
      "get": {
        "summary": "Get organisation connection",
        "operationId": "GET_workspaces__workspace__organisation_link",
        "tags": [
          "Organisation connection"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\OrganisationConnectionController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Show for organisation connection. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/organisation-link/preview": {
      "get": {
        "summary": "Preview organisation connection",
        "operationId": "GET_workspaces__workspace__organisation_link_preview",
        "tags": [
          "Organisation connection"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\OrganisationConnectionController@preview",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Preview for organisation connection. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisation_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Organisation id. Required. "
            },
            "description": "Organisation id. Required. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/users": {
      "get": {
        "summary": "List workspace user",
        "operationId": "GET_workspaces__workspace__users",
        "tags": [
          "Workspace user"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "examples": {
                  "assigned_user_id": {
                    "summary": "Lookup fields for assigned_user_id",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "user_id": "example-assigned_user_id",
                          "user": {
                            "name": "Example assigned user id"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\WorkspaceUserController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "AutoAppy\\Platform\\CentralManagementOnly"
        ],
        "description": "Index for workspace user. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. \n\nLookup `assigned_user_id`: read `data[].user_id` as the value and `data[].user.name` as the label. Use identifiers only within their authorised workspace.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/users/{workspaceUser}": {
      "get": {
        "summary": "Get workspace user",
        "operationId": "GET_workspaces__workspace__users__workspaceUser_",
        "tags": [
          "Workspace user"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\WorkspaceUserController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "AutoAppy\\Platform\\CentralManagementOnly"
        ],
        "description": "Show for workspace user. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspaceUser",
            "in": "path",
            "required": true,
            "description": "Workspace user identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/team/{user}/performance": {
      "get": {
        "summary": "Get team performance",
        "operationId": "GET_workspaces__workspace__team__user__performance",
        "tags": [
          "Team performance"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\TeamPerformanceController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Show for team performance. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "description": "User identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "From. Optional. "
            },
            "description": "From. Optional. "
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "To. Optional. "
            },
            "description": "To. Optional. "
          },
          {
            "name": "data",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email",
              "description": "Data. Optional. "
            },
            "description": "Data. Optional. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/lead-fields": {
      "get": {
        "summary": "Get field definitions",
        "description": "\n\nLookup `lookup_field`: read `data[].key` as the value and `data[].label` as the label. Use identifiers only within their authorised workspace.\n\nLookup `lookup_field_2`: read `data[].key` as the value and `data[].label` as the label. Use identifiers only within their authorised workspace.",
        "operationId": "crm_get_workspaces_workspace_lead_fields",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Local resource identifier; see README."
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "examples": {
                  "lookup_field": {
                    "summary": "Lookup fields for lookup_field",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "key": "example-lookup_field",
                          "label": "Example lookup field"
                        }
                      ]
                    }
                  },
                  "lookup_field_2": {
                    "summary": "Lookup fields for lookup_field_2",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "key": "example-lookup_field_2",
                          "label": "Example lookup field 2"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Pipelines & fields"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create lead field",
        "operationId": "POST_workspaces__workspace__lead_fields",
        "tags": [
          "Lead field"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Store for lead field. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pipeline_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Pipeline id. Optional. "
                  },
                  "key": {
                    "type": "string",
                    "description": "Key. Required. Limits: max:100."
                  },
                  "label": {
                    "type": "string",
                    "description": "Label. Required. Limits: max:255."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "section": {
                    "type": "string",
                    "description": "Section. Optional. Limits: max:255."
                  },
                  "field_type": {
                    "type": "string",
                    "description": "Field type. Required. "
                  },
                  "options": {
                    "type": "array",
                    "items": {},
                    "description": "Options. Optional. Limits: max:100."
                  },
                  "is_required": {
                    "type": "string",
                    "description": "Is required. Optional. "
                  },
                  "default_value": {
                    "type": "string",
                    "description": "Default value. Optional. "
                  },
                  "validation_rules": {
                    "type": "string",
                    "description": "Validation rules. Optional. "
                  },
                  "is_searchable": {
                    "type": "string",
                    "description": "Is searchable. Optional. "
                  },
                  "is_filterable": {
                    "type": "string",
                    "description": "Is filterable. Optional. "
                  },
                  "is_table_visible": {
                    "type": "string",
                    "description": "Is table visible. Optional. "
                  },
                  "display_order": {
                    "type": "integer",
                    "description": "Display order. Optional. Limits: min:0, max:100000."
                  },
                  "is_active": {
                    "type": "string",
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "key",
                  "label",
                  "field_type"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/lead-fields/reorder": {
      "put": {
        "summary": "Reorder lead field",
        "operationId": "PUT_workspaces__workspace__lead_fields_reorder",
        "tags": [
          "Lead field"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@reorder",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Reorder for lead field. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "field_ids": {
                    "type": "array",
                    "items": {},
                    "description": "Field ids. Required. Limits: min:1, max:500."
                  }
                },
                "required": [
                  "field_ids"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/lead-fields/{field}": {
      "put": {
        "summary": "Update lead field",
        "operationId": "PUT_workspaces__workspace__lead_fields__field_",
        "tags": [
          "Lead field"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Update for lead field. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "description": "Field identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pipeline_id": {
                    "type": "string",
                    "format": "uuid",
                    "nullable": true,
                    "description": "Pipeline id. Optional. "
                  },
                  "key": {
                    "type": "string",
                    "description": "Key. Required. Limits: max:100."
                  },
                  "label": {
                    "type": "string",
                    "description": "Label. Required. Limits: max:255."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "section": {
                    "type": "string",
                    "nullable": true,
                    "description": "Section. Optional. Limits: max:255."
                  },
                  "field_type": {
                    "type": "string",
                    "description": "Field type. Optional. "
                  },
                  "options": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Options. Optional. Limits: max:100."
                  },
                  "is_required": {
                    "type": "string",
                    "description": "Is required. Optional. "
                  },
                  "default_value": {
                    "type": "string",
                    "description": "Default value. Optional. "
                  },
                  "validation_rules": {
                    "type": "string",
                    "nullable": true,
                    "description": "Validation rules. Optional. "
                  },
                  "is_searchable": {
                    "type": "string",
                    "description": "Is searchable. Optional. "
                  },
                  "is_filterable": {
                    "type": "string",
                    "description": "Is filterable. Optional. "
                  },
                  "is_table_visible": {
                    "type": "string",
                    "description": "Is table visible. Optional. "
                  },
                  "display_order": {
                    "type": "integer",
                    "description": "Display order. Optional. Limits: min:0, max:100000."
                  },
                  "is_active": {
                    "type": "string",
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "key",
                  "label"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete lead field",
        "operationId": "DELETE_workspaces__workspace__lead_fields__field_",
        "tags": [
          "Lead field"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Destroy for lead field. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "description": "Field identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads/import/google-sheet": {
      "post": {
        "summary": "Google sheet lead import",
        "operationId": "POST_leads_import_google_sheet",
        "tags": [
          "Lead import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadImportController@googleSheet",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Google sheet for lead import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Url. Required. Limits: max:2048."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/document-storage": {
      "get": {
        "summary": "List document storage",
        "operationId": "GET_workspaces__workspace__document_storage",
        "tags": [
          "Document storage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentStorageController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Index for document storage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/document-categories": {
      "get": {
        "summary": "List document category",
        "operationId": "GET_workspaces__workspace__document_categories",
        "tags": [
          "Document category"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentCategoryController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Index for document category. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create document category",
        "operationId": "POST_workspaces__workspace__document_categories",
        "tags": [
          "Document category"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentCategoryController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Store for document category. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:1000."
                  },
                  "is_active": {
                    "type": "string",
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/document-categories/{category}": {
      "put": {
        "summary": "Update document category",
        "operationId": "PUT_workspaces__workspace__document_categories__category_",
        "tags": [
          "Document category"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentCategoryController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Update for document category. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "path",
            "required": true,
            "description": "Category identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:1000."
                  },
                  "is_active": {
                    "type": "string",
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "patch": {
        "summary": "Update document category",
        "operationId": "PATCH_workspaces__workspace__document_categories__category_",
        "tags": [
          "Document category"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentCategoryController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Update for document category. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "path",
            "required": true,
            "description": "Category identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:1000."
                  },
                  "is_active": {
                    "type": "string",
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete document category",
        "operationId": "DELETE_workspaces__workspace__document_categories__category_",
        "tags": [
          "Document category"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\DocumentCategoryController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Destroy for document category. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "path",
            "required": true,
            "description": "Category identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/options": {
      "get": {
        "summary": "Options lead document",
        "operationId": "GET_workspaces__workspace__documents_options",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@options",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Options for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents": {
      "get": {
        "summary": "List lead document",
        "operationId": "GET_workspaces__workspace__documents",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Index for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "index",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Index. Optional. Limits: max:150."
            },
            "description": "Index. Optional. Limits: max:150."
          },
          {
            "name": "lead_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "nullable": true,
              "description": "Lead id. Optional. Limits: min:1."
            },
            "description": "Lead id. Optional. Limits: min:1."
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Category id. Optional. "
            },
            "description": "Category id. Optional. "
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Kind. Optional. ",
              "enum": [
                "audio",
                "video",
                "document",
                "spreadsheet",
                "image",
                "archive"
              ]
            },
            "description": "Kind. Optional. "
          },
          {
            "name": "assignment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Assignment. Optional. ",
              "enum": [
                "all",
                "assigned",
                "unassigned"
              ]
            },
            "description": "Assignment. Optional. "
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Archived. Optional. "
            },
            "description": "Archived. Optional. "
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort. Optional. ",
              "enum": [
                "newest",
                "oldest",
                "name",
                "largest"
              ]
            },
            "description": "Sort. Optional. "
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Page. Optional. Limits: min:1."
            },
            "description": "Page. Optional. Limits: min:1."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Per page. Optional. Limits: min:1, max:100."
            },
            "description": "Per page. Optional. Limits: min:1, max:100."
          },
          {
            "name": "initiate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Initiate. Required. "
            },
            "description": "Initiate. Required. "
          },
          {
            "name": "file_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "File name. Required. Limits: max:200."
            },
            "description": "File name. Required. Limits: max:200."
          },
          {
            "name": "size_bytes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Size bytes. Required. Limits: min:1."
            },
            "description": "Size bytes. Required. Limits: min:1."
          },
          {
            "name": "update",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Update. Required. Limits: max:200."
            },
            "description": "Update. Required. Limits: max:200."
          },
          {
            "name": "description",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Description. Optional. Limits: max:2000."
            },
            "description": "Description. Optional. Limits: max:2000."
          },
          {
            "name": "assign",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Assign. Required. Limits: min:1, max:100."
            },
            "description": "Assign. Required. Limits: min:1, max:100."
          },
          {
            "name": "matches",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Matches. Required. Limits: min:1, max:100."
            },
            "description": "Matches. Required. Limits: min:1, max:100."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Refresh. Optional. "
            },
            "description": "Refresh. Optional. "
          },
          {
            "name": "approveMatches",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Approve matches. Required. Limits: min:1, max:100."
            },
            "description": "Approve matches. Required. Limits: min:1, max:100."
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/uploads": {
      "post": {
        "summary": "Initiate lead document",
        "operationId": "POST_workspaces__workspace__documents_uploads",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@initiate",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:120,1"
        ],
        "description": "Initiate for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "string",
                    "description": "Index. Optional. Limits: max:150."
                  },
                  "lead_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Lead id. Optional. Limits: min:1."
                  },
                  "category_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Category id. Optional. "
                  },
                  "kind": {
                    "type": "string",
                    "description": "Kind. Optional. ",
                    "enum": [
                      "audio",
                      "video",
                      "document",
                      "spreadsheet",
                      "image",
                      "archive"
                    ]
                  },
                  "assignment": {
                    "type": "string",
                    "description": "Assignment. Optional. ",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned"
                    ]
                  },
                  "archived": {
                    "type": "string",
                    "description": "Archived. Optional. "
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort. Optional. ",
                    "enum": [
                      "newest",
                      "oldest",
                      "name",
                      "largest"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page. Optional. Limits: min:1."
                  },
                  "per_page": {
                    "type": "integer",
                    "description": "Per page. Optional. Limits: min:1, max:100."
                  },
                  "initiate": {
                    "type": "string",
                    "description": "Initiate. Required. "
                  },
                  "file_name": {
                    "type": "string",
                    "format": "binary",
                    "description": "File name. Optional. "
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "Size bytes. Required. Limits: min:1."
                  },
                  "update": {
                    "type": "string",
                    "description": "Update. Required. Limits: max:200."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "assign": {
                    "type": "array",
                    "items": {},
                    "description": "Assign. Required. Limits: min:1, max:100."
                  },
                  "matches": {
                    "type": "array",
                    "items": {},
                    "description": "Matches. Required. Limits: min:1, max:100."
                  },
                  "refresh": {
                    "type": "string",
                    "description": "Refresh. Optional. "
                  },
                  "approveMatches": {
                    "type": "array",
                    "items": {},
                    "description": "Approve matches. Required. Limits: min:1, max:100."
                  }
                },
                "required": [
                  "initiate",
                  "size_bytes",
                  "update",
                  "assign",
                  "matches",
                  "approveMatches"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/assignment": {
      "put": {
        "summary": "Assign lead document",
        "operationId": "PUT_workspaces__workspace__documents_assignment",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@assign",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Assign for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "string",
                    "description": "Index. Optional. Limits: max:150."
                  },
                  "lead_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Lead id. Optional. Limits: min:1."
                  },
                  "category_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Category id. Optional. "
                  },
                  "kind": {
                    "type": "string",
                    "description": "Kind. Optional. ",
                    "enum": [
                      "audio",
                      "video",
                      "document",
                      "spreadsheet",
                      "image",
                      "archive"
                    ]
                  },
                  "assignment": {
                    "type": "string",
                    "description": "Assignment. Optional. ",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned"
                    ]
                  },
                  "archived": {
                    "type": "string",
                    "description": "Archived. Optional. "
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort. Optional. ",
                    "enum": [
                      "newest",
                      "oldest",
                      "name",
                      "largest"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page. Optional. Limits: min:1."
                  },
                  "per_page": {
                    "type": "integer",
                    "description": "Per page. Optional. Limits: min:1, max:100."
                  },
                  "initiate": {
                    "type": "string",
                    "description": "Initiate. Required. "
                  },
                  "file_name": {
                    "type": "string",
                    "description": "File name. Required. Limits: max:200."
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "Size bytes. Required. Limits: min:1."
                  },
                  "update": {
                    "type": "string",
                    "description": "Update. Required. Limits: max:200."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "assign": {
                    "type": "array",
                    "items": {},
                    "description": "Assign. Required. Limits: min:1, max:100."
                  },
                  "matches": {
                    "type": "array",
                    "items": {},
                    "description": "Matches. Required. Limits: min:1, max:100."
                  },
                  "refresh": {
                    "type": "string",
                    "description": "Refresh. Optional. "
                  },
                  "approveMatches": {
                    "type": "array",
                    "items": {},
                    "description": "Approve matches. Required. Limits: min:1, max:100."
                  }
                },
                "required": [
                  "initiate",
                  "file_name",
                  "size_bytes",
                  "update",
                  "assign",
                  "matches",
                  "approveMatches"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/matches": {
      "post": {
        "summary": "Matches lead document",
        "operationId": "POST_workspaces__workspace__documents_matches",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@matches",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:60,1"
        ],
        "description": "Matches for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "string",
                    "description": "Index. Optional. Limits: max:150."
                  },
                  "lead_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Lead id. Optional. Limits: min:1."
                  },
                  "category_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Category id. Optional. "
                  },
                  "kind": {
                    "type": "string",
                    "description": "Kind. Optional. ",
                    "enum": [
                      "audio",
                      "video",
                      "document",
                      "spreadsheet",
                      "image",
                      "archive"
                    ]
                  },
                  "assignment": {
                    "type": "string",
                    "description": "Assignment. Optional. ",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned"
                    ]
                  },
                  "archived": {
                    "type": "string",
                    "description": "Archived. Optional. "
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort. Optional. ",
                    "enum": [
                      "newest",
                      "oldest",
                      "name",
                      "largest"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page. Optional. Limits: min:1."
                  },
                  "per_page": {
                    "type": "integer",
                    "description": "Per page. Optional. Limits: min:1, max:100."
                  },
                  "initiate": {
                    "type": "string",
                    "description": "Initiate. Required. "
                  },
                  "file_name": {
                    "type": "string",
                    "description": "File name. Required. Limits: max:200."
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "Size bytes. Required. Limits: min:1."
                  },
                  "update": {
                    "type": "string",
                    "description": "Update. Required. Limits: max:200."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "assign": {
                    "type": "array",
                    "items": {},
                    "description": "Assign. Required. Limits: min:1, max:100."
                  },
                  "matches": {
                    "type": "array",
                    "items": {},
                    "description": "Matches. Required. Limits: min:1, max:100."
                  },
                  "refresh": {
                    "type": "string",
                    "description": "Refresh. Optional. "
                  },
                  "approveMatches": {
                    "type": "array",
                    "items": {},
                    "description": "Approve matches. Required. Limits: min:1, max:100."
                  }
                },
                "required": [
                  "initiate",
                  "file_name",
                  "size_bytes",
                  "update",
                  "assign",
                  "matches",
                  "approveMatches"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/matches/approve": {
      "put": {
        "summary": "Approve matches lead document",
        "operationId": "PUT_workspaces__workspace__documents_matches_approve",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@approveMatches",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:60,1"
        ],
        "description": "Approve matches for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "string",
                    "description": "Index. Optional. Limits: max:150."
                  },
                  "lead_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Lead id. Optional. Limits: min:1."
                  },
                  "category_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Category id. Optional. "
                  },
                  "kind": {
                    "type": "string",
                    "description": "Kind. Optional. ",
                    "enum": [
                      "audio",
                      "video",
                      "document",
                      "spreadsheet",
                      "image",
                      "archive"
                    ]
                  },
                  "assignment": {
                    "type": "string",
                    "description": "Assignment. Optional. ",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned"
                    ]
                  },
                  "archived": {
                    "type": "string",
                    "description": "Archived. Optional. "
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort. Optional. ",
                    "enum": [
                      "newest",
                      "oldest",
                      "name",
                      "largest"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page. Optional. Limits: min:1."
                  },
                  "per_page": {
                    "type": "integer",
                    "description": "Per page. Optional. Limits: min:1, max:100."
                  },
                  "initiate": {
                    "type": "string",
                    "description": "Initiate. Required. "
                  },
                  "file_name": {
                    "type": "string",
                    "description": "File name. Required. Limits: max:200."
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "Size bytes. Required. Limits: min:1."
                  },
                  "update": {
                    "type": "string",
                    "description": "Update. Required. Limits: max:200."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "assign": {
                    "type": "array",
                    "items": {},
                    "description": "Assign. Required. Limits: min:1, max:100."
                  },
                  "matches": {
                    "type": "array",
                    "items": {},
                    "description": "Matches. Required. Limits: min:1, max:100."
                  },
                  "refresh": {
                    "type": "string",
                    "description": "Refresh. Optional. "
                  },
                  "approveMatches": {
                    "type": "array",
                    "items": {},
                    "description": "Approve matches. Required. Limits: min:1, max:100."
                  }
                },
                "required": [
                  "initiate",
                  "file_name",
                  "size_bytes",
                  "update",
                  "assign",
                  "matches",
                  "approveMatches"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}/complete": {
      "post": {
        "summary": "Complete lead document",
        "operationId": "POST_workspaces__workspace__documents__document__complete",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@complete",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:120,1"
        ],
        "description": "Complete for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}/upload": {
      "delete": {
        "summary": "Cancel lead document",
        "operationId": "DELETE_workspaces__workspace__documents__document__upload",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@cancel",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Cancel for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}/download": {
      "post": {
        "summary": "Download lead document",
        "operationId": "POST_workspaces__workspace__documents__document__download",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@download",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:120,1"
        ],
        "description": "Download for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}/playback": {
      "post": {
        "summary": "Playback lead document",
        "operationId": "POST_workspaces__workspace__documents__document__playback",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@playback",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "throttle:120,1"
        ],
        "description": "Playback for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}": {
      "patch": {
        "summary": "Update lead document",
        "operationId": "PATCH_workspaces__workspace__documents__document_",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Update for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "string",
                    "description": "Index. Optional. Limits: max:150."
                  },
                  "lead_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Lead id. Optional. Limits: min:1."
                  },
                  "category_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Category id. Optional. "
                  },
                  "kind": {
                    "type": "string",
                    "description": "Kind. Optional. ",
                    "enum": [
                      "audio",
                      "video",
                      "document",
                      "spreadsheet",
                      "image",
                      "archive"
                    ]
                  },
                  "assignment": {
                    "type": "string",
                    "description": "Assignment. Optional. ",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned"
                    ]
                  },
                  "archived": {
                    "type": "string",
                    "description": "Archived. Optional. "
                  },
                  "sort": {
                    "type": "string",
                    "description": "Sort. Optional. ",
                    "enum": [
                      "newest",
                      "oldest",
                      "name",
                      "largest"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page. Optional. Limits: min:1."
                  },
                  "per_page": {
                    "type": "integer",
                    "description": "Per page. Optional. Limits: min:1, max:100."
                  },
                  "initiate": {
                    "type": "string",
                    "description": "Initiate. Required. "
                  },
                  "file_name": {
                    "type": "string",
                    "description": "File name. Required. Limits: max:200."
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "Size bytes. Required. Limits: min:1."
                  },
                  "update": {
                    "type": "string",
                    "description": "Update. Required. Limits: max:200."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:2000."
                  },
                  "assign": {
                    "type": "array",
                    "items": {},
                    "description": "Assign. Required. Limits: min:1, max:100."
                  },
                  "matches": {
                    "type": "array",
                    "items": {},
                    "description": "Matches. Required. Limits: min:1, max:100."
                  },
                  "refresh": {
                    "type": "string",
                    "description": "Refresh. Optional. "
                  },
                  "approveMatches": {
                    "type": "array",
                    "items": {},
                    "description": "Approve matches. Required. Limits: min:1, max:100."
                  }
                },
                "required": [
                  "initiate",
                  "file_name",
                  "size_bytes",
                  "update",
                  "assign",
                  "matches",
                  "approveMatches"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete lead document",
        "operationId": "DELETE_workspaces__workspace__documents__document_",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Destroy for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/documents/{document}/restore": {
      "post": {
        "summary": "Restore lead document",
        "operationId": "POST_workspaces__workspace__documents__document__restore",
        "tags": [
          "Lead document"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadDocumentController@restore",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Restore for lead document. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "description": "Workspace identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "description": "Document identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads/import": {
      "post": {
        "summary": "Create lead import",
        "operationId": "POST_leads_import",
        "tags": [
          "Lead import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadImportController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Store for lead import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pipeline_id": {
                    "type": "string",
                    "format": "uuid",
                    "nullable": true,
                    "description": "Pipeline id. Optional. "
                  },
                  "mapping": {
                    "type": "string",
                    "description": "Mapping. Required. "
                  },
                  "rows": {
                    "type": "array",
                    "items": {},
                    "description": "Rows. Required. Limits: min:1."
                  }
                },
                "required": [
                  "mapping",
                  "rows"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/leads/export": {
      "get": {
        "summary": "Export lead",
        "operationId": "GET_leads_export",
        "tags": [
          "Lead"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@export",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Export for lead. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Page. Optional. Limits: min:1."
            },
            "description": "Page. Optional. Limits: min:1."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Per page. Optional. Limits: min:1, max:100."
            },
            "description": "Per page. Optional. Limits: min:1, max:100."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Search. Optional. Limits: max:255."
            },
            "description": "Search. Optional. Limits: max:255."
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Pipeline id. Optional. "
            },
            "description": "Pipeline id. Optional. "
          },
          {
            "name": "lead_stage_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "nullable": true,
              "description": "Lead stage id. Optional. Limits: min:1."
            },
            "description": "Lead stage id. Optional. Limits: min:1."
          },
          {
            "name": "stage_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Stage ids. Optional. Limits: max:100."
            },
            "description": "Stage ids. Optional. Limits: max:100."
          },
          {
            "name": "node_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Node ids. Optional. Limits: max:100."
            },
            "description": "Node ids. Optional. Limits: max:100."
          },
          {
            "name": "assigned_user_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Assigned user id. Optional. "
            },
            "description": "Assigned user id. Optional. "
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Assigned to. Optional. Limits: max:100."
            },
            "description": "Assigned to. Optional. Limits: max:100."
          },
          {
            "name": "lead_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Lead ids. Optional. Limits: max:500."
            },
            "description": "Lead ids. Optional. Limits: max:500."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Source. Optional. Limits: max:255."
            },
            "description": "Source. Optional. Limits: max:255."
          },
          {
            "name": "custom_filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Custom filters. Optional. Limits: max:25."
            },
            "description": "Custom filters. Optional. Limits: max:25."
          },
          {
            "name": "custom_sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Custom sort. Optional. Limits: max:100."
            },
            "description": "Custom sort. Optional. Limits: max:100."
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Created from. Optional. "
            },
            "description": "Created from. Optional. "
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Created to. Optional. "
            },
            "description": "Created to. Optional. "
          },
          {
            "name": "updated_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Updated from. Optional. "
            },
            "description": "Updated from. Optional. "
          },
          {
            "name": "updated_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Updated to. Optional. "
            },
            "description": "Updated to. Optional. "
          },
          {
            "name": "stage_changed_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Stage changed from. Optional. "
            },
            "description": "Stage changed from. Optional. "
          },
          {
            "name": "stage_changed_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Stage changed to. Optional. "
            },
            "description": "Stage changed to. Optional. "
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort by. Optional. "
            },
            "description": "Sort by. Optional. "
          },
          {
            "name": "sort_direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort direction. Optional. ",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Sort direction. Optional. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads": {
      "get": {
        "summary": "Find leads",
        "description": "\n\nLookup `lead_id`: read `data[].id` as the value and `data[].name` as the label. Use identifiers only within their authorised workspace.",
        "operationId": "crm_get_leads",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "lead_stage_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assigned_user_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stage_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Stage ids. Optional. Limits: max:100."
            },
            "description": "Stage ids. Optional. Limits: max:100."
          },
          {
            "name": "node_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Node ids. Optional. Limits: max:100."
            },
            "description": "Node ids. Optional. Limits: max:100."
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Assigned to. Optional. Limits: max:100."
            },
            "description": "Assigned to. Optional. Limits: max:100."
          },
          {
            "name": "lead_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Lead ids. Optional. Limits: max:500."
            },
            "description": "Lead ids. Optional. Limits: max:500."
          },
          {
            "name": "custom_filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {},
              "description": "Custom filters. Optional. Limits: max:25."
            },
            "description": "Custom filters. Optional. Limits: max:25."
          },
          {
            "name": "custom_sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Custom sort. Optional. Limits: max:100."
            },
            "description": "Custom sort. Optional. Limits: max:100."
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Created from. Optional. "
            },
            "description": "Created from. Optional. "
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Created to. Optional. "
            },
            "description": "Created to. Optional. "
          },
          {
            "name": "updated_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Updated from. Optional. "
            },
            "description": "Updated from. Optional. "
          },
          {
            "name": "updated_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Updated to. Optional. "
            },
            "description": "Updated to. Optional. "
          },
          {
            "name": "stage_changed_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Stage changed from. Optional. "
            },
            "description": "Stage changed from. Optional. "
          },
          {
            "name": "stage_changed_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true,
              "description": "Stage changed to. Optional. "
            },
            "description": "Stage changed to. Optional. "
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort by. Optional. "
            },
            "description": "Sort by. Optional. "
          },
          {
            "name": "sort_direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort direction. Optional. ",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Sort direction. Optional. "
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "examples": {
                  "lead_id": {
                    "summary": "Lookup fields for lead_id",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "id": "example-lead_id",
                          "name": "Example lead id"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Leads"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create lead",
        "description": "Create one lead in the current workspace. To safely retry the same website enquiry, send a stable, source-prefixed Idempotency-Key such as website:enquiry-123. Reuse the key with the same validated request details and the same signed-in/API-key user. The first request returns 201; a retry returns 200 with the current accessible lead and Idempotency-Replayed: true. A new enquiry, even from the same person, needs a new key. Requests without a key create a lead each time. This does not merge existing leads or synchronize customer profiles. Deleted leads are not recreated by a replay.",
        "operationId": "crm_post_leads",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
            },
            "example": "website:enquiry-123",
            "description": "Stable identity of the source event, unique within this workspace. Prefix with the source/application. Keep the same key and payload across transport retries; do not use a phone number as an enquiry key."
          }
        ],
        "responses": {
          "201": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotency-Replayed": {
                "description": "Whether the event had already created a lead.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "example": "false"
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Current workspace/resource access denied, or this event key belongs to a different actor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The key was already used with different validated details, or its lead was removed. Review the existing enquiry; do not generate a new key merely to bypass this conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Previously created lead returned after current access checks. No additional lead was created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotency-Replayed": {
                "description": "Whether the event had already created a lead.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "example": "true"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "designation": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company_location": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "team_size": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "revenue": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area_type": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "assigned_user_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "custom_fields": {
                    "type": "object",
                    "properties": {}
                  },
                  "additional_details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "value": {
                          "type": "string",
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "key",
                        "value"
                      ]
                    }
                  },
                  "lead_stage_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Example customer",
                "email": "customer@example.invalid",
                "custom_fields": {}
              }
            }
          }
        },
        "tags": [
          "Leads"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads/{lead}": {
      "get": {
        "summary": "Get lead",
        "description": "",
        "operationId": "crm_get_leads_lead",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Local resource identifier; see README."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Leads"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update lead",
        "description": "Partial update; lead_stage_id/stage_changed_at prohibited. Use lead-workflow APIs to move stages.",
        "operationId": "crm_put_leads_lead",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Local resource identifier; see README."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "designation": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company_location": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "team_size": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "revenue": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area_type": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "assigned_user_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "custom_fields": {
                    "type": "object",
                    "properties": {}
                  },
                  "additional_details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "value": {
                          "type": "string",
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "key",
                        "value"
                      ]
                    }
                  }
                }
              },
              "example": {
                "company": "Example Ltd"
              }
            }
          }
        },
        "tags": [
          "Leads"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      },
      "patch": {
        "summary": "Update lead",
        "operationId": "PATCH_leads__lead_",
        "tags": [
          "Lead"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Update for lead. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "custom_fields": {
                    "type": "array",
                    "items": {},
                    "description": "Custom fields. Optional. Limits: max:100."
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete lead",
        "operationId": "DELETE_leads__lead_",
        "tags": [
          "Lead"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Destroy for lead. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/analytics/lead-summary": {
      "get": {
        "summary": "Summary lead analytics",
        "operationId": "GET_analytics_lead_summary",
        "tags": [
          "Lead analytics"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadAnalyticsController@summary",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Summary for lead analytics. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Pipeline id. Optional. "
            },
            "description": "Pipeline id. Optional. "
          },
          {
            "name": "call_preset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Call preset. Optional. ",
              "enum": [
                "today",
                "yesterday",
                "last_7_days",
                "last_30_days",
                "this_month",
                "custom_range"
              ]
            },
            "description": "Call preset. Optional. "
          },
          {
            "name": "custom_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Custom start. Optional. "
            },
            "description": "Custom start. Optional. "
          },
          {
            "name": "custom_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Custom end. Optional. "
            },
            "description": "Custom end. Optional. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/analytics/crm-overview": {
      "get": {
        "summary": "Overview crm analytics",
        "operationId": "GET_analytics_crm_overview",
        "tags": [
          "Crm analytics"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\CrmAnalyticsController@overview",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Overview for crm analytics. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "nullable": true,
              "description": "Pipeline id. Optional. "
            },
            "description": "Pipeline id. Optional. "
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Days. Optional. "
            },
            "description": "Days. Optional. "
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Mode. Optional. ",
              "enum": [
                "full",
                "queue"
              ]
            },
            "description": "Mode. Optional. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-activities": {
      "get": {
        "summary": "List lead activity",
        "operationId": "GET_lead_activities",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Index for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "lead_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Lead id. Optional. Limits: min:1."
            },
            "description": "Lead id. Optional. Limits: min:1."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Type. Optional. "
            },
            "description": "Type. Optional. "
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Status. Optional. "
            },
            "description": "Status. Optional. "
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Page. Optional. Limits: min:1."
            },
            "description": "Page. Optional. Limits: min:1."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Per page. Optional. Limits: min:1, max:100."
            },
            "description": "Per page. Optional. Limits: min:1, max:100."
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create lead activity",
        "description": "Records activity only; does not send a message. Defaults to COMPLETED when status is omitted. Current lead access and activity policy apply.",
        "operationId": "crm_post_lead_activities",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          }
        ],
        "responses": {
          "401": {
            "description": "Invalid credential"
          },
          "403": {
            "description": "Insufficient access"
          },
          "404": {
            "description": "Resource unavailable"
          },
          "409": {
            "description": "Version conflict"
          },
          "422": {
            "description": "Validation failed"
          },
          "201": {
            "description": "Successful response. Inspect data and business state."
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lead_id": {
                    "type": "integer"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "CALL",
                      "EMAIL",
                      "WHATSAPP",
                      "MEETING",
                      "NOTE",
                      "FOLLOWUP"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PENDING",
                      "COMPLETED",
                      "CANCELLED"
                    ],
                    "nullable": true
                  },
                  "response_type": {
                    "type": "string",
                    "maxLength": 255,
                    "nullable": true
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 10000,
                    "nullable": true
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true
                  },
                  "meta": {
                    "type": "object",
                    "nullable": true
                  }
                },
                "required": [
                  "lead_id",
                  "type"
                ]
              },
              "example": {
                "lead_id": 1,
                "type": "FOLLOWUP",
                "status": "PENDING",
                "note": "Call tomorrow",
                "scheduled_at": "2026-09-23T10:00:00Z"
              }
            }
          }
        },
        "tags": [
          "Activities"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-activities/{leadActivity}": {
      "get": {
        "summary": "Get lead activity",
        "operationId": "GET_lead_activities__leadActivity_",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Show for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update lead activity",
        "operationId": "PUT_lead_activities__leadActivity_",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Update for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type. Optional. "
                  },
                  "status": {
                    "type": "string",
                    "description": "Status. Optional. "
                  },
                  "response_type": {
                    "type": "string",
                    "nullable": true,
                    "description": "Response type. Optional. Limits: max:255."
                  },
                  "note": {
                    "type": "string",
                    "nullable": true,
                    "description": "Note. Optional. Limits: max:10000."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "Scheduled at. Optional. "
                  },
                  "completed_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "Completed at. Optional. "
                  },
                  "meta": {
                    "type": "string",
                    "nullable": true,
                    "description": "Meta. Optional. "
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "patch": {
        "summary": "Update lead activity",
        "operationId": "PATCH_lead_activities__leadActivity_",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Update for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type. Optional. "
                  },
                  "status": {
                    "type": "string",
                    "description": "Status. Optional. "
                  },
                  "response_type": {
                    "type": "string",
                    "nullable": true,
                    "description": "Response type. Optional. Limits: max:255."
                  },
                  "note": {
                    "type": "string",
                    "nullable": true,
                    "description": "Note. Optional. Limits: max:10000."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "Scheduled at. Optional. "
                  },
                  "completed_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "Completed at. Optional. "
                  },
                  "meta": {
                    "type": "string",
                    "nullable": true,
                    "description": "Meta. Optional. "
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete lead activity",
        "operationId": "DELETE_lead_activities__leadActivity_",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Destroy for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-activities/{leadActivity}/complete": {
      "patch": {
        "summary": "Complete lead activity",
        "description": "",
        "operationId": "crm_patch_lead_activities_leadActivity_complete",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Inspect data and business state."
          },
          "401": {
            "description": "Invalid credential"
          },
          "403": {
            "description": "Insufficient access"
          },
          "404": {
            "description": "Resource unavailable"
          },
          "409": {
            "description": "Version conflict"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Activities"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@complete",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads/{lead}/timeline": {
      "get": {
        "summary": "Timeline lead activity",
        "operationId": "GET_leads__lead__timeline",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityController@timeline",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Timeline for lead activity. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lead_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Lead id. Optional. Limits: min:1."
            },
            "description": "Lead id. Optional. Limits: min:1."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Type. Optional. "
            },
            "description": "Type. Optional. "
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Status. Optional. "
            },
            "description": "Status. Optional. "
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Page. Optional. Limits: min:1."
            },
            "description": "Page. Optional. Limits: min:1."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Per page. Optional. Limits: min:1, max:100."
            },
            "description": "Per page. Optional. Limits: min:1, max:100."
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/start": {
      "post": {
        "summary": "Start lead workflow",
        "operationId": "POST_lead_workflow_start",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@start",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Start for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lead_id": {
                    "type": "string",
                    "description": "Lead id. Required. "
                  }
                },
                "required": [
                  "lead_id"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/workflow/stages": {
      "get": {
        "summary": "Workflow stages lead workflow",
        "operationId": "GET_lead_workflow_workflow_stages",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@workflowStages",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "description": "Workflow stages for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}": {
      "get": {
        "summary": "Current lead workflow",
        "operationId": "GET_lead_workflow__leadId_",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@current",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Current for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/complete-node": {
      "post": {
        "summary": "Complete node lead workflow",
        "operationId": "POST_lead_workflow__leadId__complete_node",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@completeNode",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Complete node for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "node_id": {
                    "type": "string",
                    "description": "Node id. Required. "
                  },
                  "next_node_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Next node id. Optional. "
                  },
                  "notes": {
                    "type": "string",
                    "nullable": true,
                    "description": "Notes. Optional. Limits: max:5000."
                  },
                  "metadata": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Metadata. Optional. "
                  }
                },
                "required": [
                  "node_id"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/skip-node": {
      "post": {
        "summary": "Skip node lead workflow",
        "operationId": "POST_lead_workflow__leadId__skip_node",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@skipNode",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Skip node for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "next_node_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Next node id. Optional. "
                  },
                  "notes": {
                    "type": "string",
                    "nullable": true,
                    "description": "Notes. Optional. Limits: max:5000."
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/move": {
      "post": {
        "summary": "Move lead workflow",
        "operationId": "POST_lead_workflow__leadId__move",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@move",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Move for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "node_id": {
                    "type": "string",
                    "description": "Node id. Required. "
                  }
                },
                "required": [
                  "node_id"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/available-transitions": {
      "get": {
        "summary": "Available transitions lead workflow",
        "operationId": "GET_lead_workflow__leadId__available_transitions",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@availableTransitions",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Available transitions for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/history": {
      "get": {
        "summary": "History lead workflow",
        "operationId": "GET_lead_workflow__leadId__history",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@history",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "History for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/workflow/current": {
      "get": {
        "summary": "Workflow current lead workflow",
        "operationId": "GET_lead_workflow__leadId__workflow_current",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@workflowCurrent",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Workflow current for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/workflow/options": {
      "get": {
        "summary": "Workflow options lead workflow",
        "operationId": "GET_lead_workflow__leadId__workflow_options",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@workflowOptions",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Workflow options for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/lead-workflow/{leadId}/workflow/update-current": {
      "put": {
        "summary": "Update current lead workflow",
        "operationId": "PUT_lead_workflow__leadId__workflow_update_current",
        "tags": [
          "Lead workflow"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadWorkflowController@updateCurrent",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Update current for lead workflow. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage_id": {
                    "type": "string",
                    "description": "Stage id. Required. "
                  },
                  "node_id": {
                    "type": "string",
                    "description": "Node id. Required. "
                  },
                  "notes": {
                    "type": "string",
                    "nullable": true,
                    "description": "Notes. Optional. Limits: max:5000."
                  }
                },
                "required": [
                  "stage_id",
                  "node_id"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/leads/{lead}/owners": {
      "get": {
        "summary": "List lead owner",
        "operationId": "GET_leads__lead__owners",
        "tags": [
          "Lead owner"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadOwnerController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Index for lead owner. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Sync lead owner",
        "operationId": "PUT_leads__lead__owners",
        "tags": [
          "Lead owner"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadOwnerController@sync",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Sync for lead owner. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owners": {
                    "type": "array",
                    "items": {},
                    "description": "Owners. Required. Limits: max:100."
                  }
                },
                "required": [
                  "owners"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/leads/{lead}/owners/{user}": {
      "delete": {
        "summary": "Delete lead owner",
        "operationId": "DELETE_leads__lead__owners__user_",
        "tags": [
          "Lead owner"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadOwnerController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.access"
        ],
        "description": "Destroy for lead owner. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "lead",
            "in": "path",
            "required": true,
            "description": "Lead identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "description": "User identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/import": {
      "post": {
        "summary": "Create pipeline import",
        "operationId": "POST_admin_pipelines_import",
        "tags": [
          "Pipeline import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\PipelineImportController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Store for pipeline import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description. Optional. Limits: max:500."
                  },
                  "is_default": {
                    "type": "string",
                    "description": "Is default. Optional. "
                  },
                  "mapping": {
                    "type": "string",
                    "description": "Mapping. Required. "
                  },
                  "rows": {
                    "type": "array",
                    "items": {},
                    "description": "Rows. Required. Limits: min:1."
                  }
                },
                "required": [
                  "name",
                  "mapping",
                  "rows"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/import/google-sheet": {
      "post": {
        "summary": "Google sheet pipeline import",
        "operationId": "POST_admin_pipelines_import_google_sheet",
        "tags": [
          "Pipeline import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\PipelineImportController@googleSheet",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Google sheet for pipeline import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Url. Required. Limits: max:2048."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/import/{pipeline}/export": {
      "get": {
        "summary": "Export pipeline import",
        "operationId": "GET_admin_pipelines_import__pipeline__export",
        "tags": [
          "Pipeline import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\PipelineImportController@export",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Export for pipeline import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "pipeline",
            "in": "path",
            "required": true,
            "description": "Pipeline identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/import/{pipeline}": {
      "put": {
        "summary": "Update pipeline import",
        "operationId": "PUT_admin_pipelines_import__pipeline_",
        "tags": [
          "Pipeline import"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\PipelineImportController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Update for pipeline import. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "pipeline",
            "in": "path",
            "required": true,
            "description": "Pipeline identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mapping": {
                    "type": "string",
                    "description": "Mapping. Required. "
                  },
                  "rows": {
                    "type": "array",
                    "items": {},
                    "description": "Rows. Required. Limits: min:1."
                  }
                },
                "required": [
                  "mapping",
                  "rows"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/workflow": {
      "get": {
        "summary": "List workflow builder",
        "operationId": "GET_admin_pipelines_workflow",
        "tags": [
          "Workflow builder"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\AdminMiniCRM\\WorkflowBuilderController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Index for workflow builder. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "pipeline_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Pipeline id. Required. "
            },
            "description": "Pipeline id. Required. "
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/pipelines": {
      "get": {
        "summary": "List pipelines",
        "description": "\n\nLookup `pipeline_id`: read `data[].id` as the value and `data[].name` as the label. Use identifiers only within their authorised workspace.",
        "operationId": "crm_get_admin_pipelines_pipelines",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "examples": {
                  "pipeline_id": {
                    "summary": "Lookup fields for pipeline_id",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "id": "example-pipeline_id",
                          "name": "Example pipeline id"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Pipelines & fields"
        ],
        "x-controller": "App\\Http\\Controllers\\PipelineController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create pipeline",
        "operationId": "POST_admin_pipelines_pipelines",
        "tags": [
          "Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\PipelineController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Store for pipeline. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description. Optional. Limits: max:500."
                  },
                  "is_default": {
                    "type": "string",
                    "description": "Is default. Optional. "
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/pipelines/{id}": {
      "get": {
        "summary": "Get pipeline",
        "operationId": "GET_admin_pipelines_pipelines__id_",
        "tags": [
          "Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\PipelineController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Show for pipeline. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update pipeline",
        "operationId": "PUT_admin_pipelines_pipelines__id_",
        "tags": [
          "Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\PipelineController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Update for pipeline. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. Limits: max:500."
                  },
                  "is_default": {
                    "type": "string",
                    "description": "Is default. Optional. "
                  },
                  "status": {
                    "type": "string",
                    "description": "Status. Optional. ",
                    "enum": [
                      "active",
                      "inactive"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete pipeline",
        "operationId": "DELETE_admin_pipelines_pipelines__id_",
        "tags": [
          "Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\PipelineController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Destroy for pipeline. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/stages": {
      "get": {
        "summary": "List stages",
        "description": "\n\nLookup `lead_stage_id`: read `data[].id` as the value and `data[].name` as the label. Use identifiers only within their authorised workspace.",
        "operationId": "crm_get_admin_pipelines_stages",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response; inspect resource/business state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "examples": {
                  "lead_stage_id": {
                    "summary": "Lookup fields for lead_stage_id",
                    "description": "Synthetic example showing the relevant identifier and label fields. Other response fields are omitted.",
                    "value": {
                      "data": [
                        {
                          "id": "example-lead_stage_id",
                          "name": "Example lead stage id"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Pipelines & fields"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create lead stage",
        "operationId": "POST_admin_pipelines_stages",
        "tags": [
          "Lead stage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Store for lead stage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pipeline_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Pipeline id. Required. "
                  },
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:100."
                  },
                  "slug": {
                    "type": "string",
                    "nullable": true,
                    "description": "Slug. Optional. Limits: max:255."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. "
                  },
                  "probability": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Probability. Optional. Limits: min:0, max:100."
                  },
                  "display_order": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "is_closed": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Is closed. Optional. "
                  },
                  "is_active": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Is active. Optional. "
                  }
                },
                "required": [
                  "pipeline_id",
                  "name"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/stages/reorder": {
      "put": {
        "summary": "Reorder lead stage",
        "operationId": "PUT_admin_pipelines_stages_reorder",
        "tags": [
          "Lead stage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@reorder",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Reorder for lead stage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pipeline_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Pipeline id. Required. "
                  },
                  "stages": {
                    "type": "array",
                    "items": {},
                    "description": "Stages. Required. Limits: min:1."
                  }
                },
                "required": [
                  "pipeline_id",
                  "stages"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/stages/{id}": {
      "get": {
        "summary": "Get lead stage",
        "operationId": "GET_admin_pipelines_stages__id_",
        "tags": [
          "Lead stage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Show for lead stage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update lead stage",
        "operationId": "PUT_admin_pipelines_stages__id_",
        "tags": [
          "Lead stage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Update for lead stage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name. Optional. Limits: max:100."
                  },
                  "slug": {
                    "type": "string",
                    "nullable": true,
                    "description": "Slug. Optional. Limits: max:255."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. "
                  },
                  "probability": {
                    "type": "integer",
                    "description": "Probability. Optional. Limits: min:0, max:100."
                  },
                  "display_order": {
                    "type": "integer",
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "is_closed": {
                    "type": "boolean",
                    "description": "Is closed. Optional. "
                  },
                  "is_active": {
                    "type": "boolean",
                    "description": "Is active. Optional. "
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete lead stage",
        "operationId": "DELETE_admin_pipelines_stages__id_",
        "tags": [
          "Lead stage"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadStageController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Destroy for lead stage. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/nodes": {
      "get": {
        "summary": "List stage node",
        "operationId": "GET_admin_pipelines_nodes",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Index for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create stage node",
        "operationId": "POST_admin_pipelines_nodes",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Store for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage_id": {
                    "type": "integer",
                    "description": "Stage id. Required. "
                  },
                  "name": {
                    "type": "string",
                    "description": "Name. Required. Limits: max:150."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. "
                  },
                  "node_type": {
                    "type": "string",
                    "description": "Node type. Required. "
                  },
                  "display_order": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "can_skip": {
                    "type": "boolean",
                    "description": "Can skip. Optional. "
                  },
                  "metadata": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Metadata. Optional. "
                  }
                },
                "required": [
                  "stage_id",
                  "name",
                  "node_type"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/nodes/reorder": {
      "put": {
        "summary": "Reorder stage node",
        "operationId": "PUT_admin_pipelines_nodes_reorder",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@reorder",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Reorder for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/nodes/{id}": {
      "get": {
        "summary": "Get stage node",
        "operationId": "GET_admin_pipelines_nodes__id_",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Show for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update stage node",
        "operationId": "PUT_admin_pipelines_nodes__id_",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Update for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage_id": {
                    "type": "integer",
                    "description": "Stage id. Optional. "
                  },
                  "name": {
                    "type": "string",
                    "description": "Name. Optional. Limits: max:150."
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description. Optional. "
                  },
                  "node_type": {
                    "type": "string",
                    "description": "Node type. Optional. "
                  },
                  "display_order": {
                    "type": "integer",
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "can_skip": {
                    "type": "boolean",
                    "description": "Can skip. Optional. "
                  },
                  "metadata": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Metadata. Optional. "
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete stage node",
        "operationId": "DELETE_admin_pipelines_nodes__id_",
        "tags": [
          "Stage node"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\StageNodeController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Destroy for stage node. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/transitions": {
      "get": {
        "summary": "List node transition",
        "operationId": "GET_admin_pipelines_transitions",
        "tags": [
          "Node transition"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\NodeTransitionController@index",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Index for node transition. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "post": {
        "summary": "Create node transition",
        "operationId": "POST_admin_pipelines_transitions",
        "tags": [
          "Node transition"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\NodeTransitionController@store",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Store for node transition. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from_node_id": {
                    "type": "integer",
                    "description": "From node id. Required. "
                  },
                  "to_node_id": {
                    "type": "integer",
                    "description": "To node id. Required. "
                  },
                  "action_group_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "Action group name. Optional. Limits: max:100."
                  },
                  "display_order": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "metadata": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Metadata. Optional. "
                  }
                },
                "required": [
                  "from_node_id",
                  "to_node_id"
                ]
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      }
    },
    "/admin/pipelines/transitions/{id}": {
      "get": {
        "summary": "Get node transition",
        "operationId": "GET_admin_pipelines_transitions__id_",
        "tags": [
          "Node transition"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\NodeTransitionController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Show for node transition. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "put": {
        "summary": "Update node transition",
        "operationId": "PUT_admin_pipelines_transitions__id_",
        "tags": [
          "Node transition"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\NodeTransitionController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Update for node transition. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action_group_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "Action group name. Optional. Limits: max:100."
                  },
                  "display_order": {
                    "type": "integer",
                    "description": "Display order. Optional. Limits: min:1."
                  },
                  "metadata": {
                    "type": "array",
                    "items": {},
                    "nullable": true,
                    "description": "Metadata. Optional. "
                  }
                }
              }
            }
          }
        },
        "x-authentication": "application-api-key"
      },
      "delete": {
        "summary": "Delete node transition",
        "operationId": "DELETE_admin_pipelines_transitions__id_",
        "tags": [
          "Node transition"
        ],
        "responses": {
          "200": {
            "description": "Successful response. Shape follows the resource returned by this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\NodeTransitionController@destroy",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "workspace.workflow"
        ],
        "description": "Destroy for node transition. Application API key (Bearer) with the matching application permission and workspace access. Resource access is checked by the server. A write changes application data; do not replay an uncertain request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/workspaces/{workspace}/lead-fields/schema": {
      "get": {
        "summary": "Get enabled pipeline lead columns",
        "description": "Read the selected pipeline’s enabled starter columns, labels and required flags. Removed starters must be omitted from lead writes, including empty/null values. Read custom definitions separately from /workspaces/{workspace}/lead-fields with the same pipeline_id. A missing pipeline returns the legacy starter profile.",
        "operationId": "crm_get_workspaces_workspace_lead_fields_schema",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          },
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Local resource identifier; see README."
          },
          {
            "name": "pipeline_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled columns; an empty starter_fields array means no optional starters are enabled. available_starter_fields is the full editable catalog, not the columns to send.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "pipeline_id": {
                          "type": "string",
                          "nullable": true
                        },
                        "configured": {
                          "type": "boolean"
                        },
                        "can_manage": {
                          "type": "boolean"
                        },
                        "fixed_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "starter_fields": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "available_starter_fields": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "pipeline_id": "11111111-1111-4111-8111-111111111111",
                    "configured": true,
                    "can_manage": false,
                    "fixed_fields": [
                      "id",
                      "name",
                      "assigned_user_id",
                      "lead_stage_id",
                      "created_at",
                      "updated_at"
                    ],
                    "starter_fields": [
                      {
                        "key": "email",
                        "label": "Student email",
                        "section": "Applicant",
                        "input_type": "email",
                        "is_required": true,
                        "is_table_visible": true
                      }
                    ],
                    "available_starter_fields": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or missing application API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or inaccessible.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Version conflict; read current state before updating.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed; inspect message and errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server failure; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable; check write outcome before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Pipelines & fields"
        ],
        "x-controller": "App\\Http\\Controllers\\Api\\LeadFieldController@schema",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform"
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/leads/enrich": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Fill missing details on an existing lead",
        "operationId": "enrichLead",
        "description": "Use for an optional second form or later questionnaire. Resolves an exact lead by ID or original enquiry reference; never searches by phone and never creates a lead. Fills empty fields only, preserving nonempty values, ownership and pipeline stage. Empty scalar/custom answers are ignored; false and zero are meaningful. Repeated submissions converge without overwriting. Existing field validation and update permissions apply. A missing original intake returns 409; complete or repair intake before retrying. This endpoint does not send messages. It does not provide historical answer revisions; use an activity for an immutable form submission record.",
        "parameters": [
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Central organisation UUID; never a local CRM/WhatsApp ID."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Local workspace UUID from /api/auth/me. Supply for deterministic CRM scope."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "designation": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "company_location": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "team_size": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "revenue": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "priority_area_type": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "custom_fields": {
                    "type": "object",
                    "properties": {}
                  },
                  "additional_details": {
                    "type": "array",
                    "maxItems": 50,
                    "description": "Question/answer pairs merged by case-insensitive question name. Existing values survive. The combined saved list cannot exceed 50.",
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "value"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "type": "string",
                          "maxLength": 100,
                          "description": "Question or field label, unique ignoring case."
                        },
                        "value": {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Nonempty answer. Format multiple selections as readable text or JSON."
                        }
                      }
                    }
                  },
                  "lead_id": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Exact existing lead ID. Supply this or intake_event_key, never both."
                  },
                  "intake_event_key": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                    "description": "The Idempotency-Key used when the first form created the lead, for example website:1518. Scoped to the current workspace."
                  }
                },
                "oneOf": [
                  {
                    "required": [
                      "lead_id"
                    ],
                    "not": {
                      "required": [
                        "intake_event_key"
                      ]
                    }
                  },
                  {
                    "required": [
                      "intake_event_key"
                    ],
                    "not": {
                      "required": [
                        "lead_id"
                      ]
                    }
                  }
                ]
              },
              "example": {
                "intake_event_key": "website:1518",
                "revenue": "100000",
                "additional_details": [
                  {
                    "key": "WhatsApp setup",
                    "value": "WhatsApp Business app"
                  },
                  {
                    "key": "Goals",
                    "value": "Follow-ups and CRM updates"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing lead returned with enrichment.updated_fields, preserved_fields and changed. Preserved fields had different nonempty saved values.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "description": "The existing CRM lead, using the same resource format as Get lead."
                    },
                    "enrichment": {
                      "type": "object",
                      "properties": {
                        "updated_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "preserved_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "changed": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 1274,
                    "name": "Example customer",
                    "revenue": "100000"
                  },
                  "enrichment": {
                    "updated_fields": [
                      "revenue",
                      "additional_details.Goals"
                    ],
                    "preserved_fields": [],
                    "changed": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication."
          },
          "403": {
            "description": "No write permission for this lead."
          },
          "404": {
            "description": "Lead not found in this workspace, or removed."
          },
          "409": {
            "description": "Original enquiry reference has no lead yet."
          },
          "422": {
            "description": "Invalid fields, conflicting identifiers, unavailable custom fields, or too many combined details."
          }
        }
      }
    },
    "/lead-activities/{leadActivity}/follow-up-context": {
      "get": {
        "summary": "Read activity follow-up context",
        "operationId": "crm_activity_followup_show",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Current activity context.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "application": {
                              "type": "string",
                              "description": "application"
                            },
                            "type": {
                              "type": "string",
                              "description": "type"
                            },
                            "id": {
                              "type": "string",
                              "description": "id"
                            },
                            "workspace_id": {
                              "type": "string",
                              "description": "workspace id"
                            },
                            "organisation_id": {
                              "type": "string",
                              "description": "organisation id"
                            },
                            "lead_id": {
                              "type": "string",
                              "description": "lead id"
                            }
                          }
                        },
                        "activity": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "description": "type"
                            },
                            "status": {
                              "type": "string",
                              "description": "status"
                            },
                            "scheduled_at": {
                              "type": "string",
                              "description": "scheduled at"
                            },
                            "completed_at": {
                              "type": "string",
                              "nullable": true,
                              "description": "completed at"
                            },
                            "updated_at": {
                              "type": "string",
                              "description": "updated at"
                            }
                          }
                        },
                        "lead": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "id"
                            },
                            "assigned_user_id": {
                              "nullable": true,
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ],
                              "description": "Assigned local CRM user identifier, if assigned."
                            },
                            "stage_id": {
                              "type": "string",
                              "nullable": true,
                              "description": "stage id"
                            },
                            "stage_closed": {
                              "type": "boolean",
                              "description": "stage closed",
                              "nullable": true
                            },
                            "stage_active": {
                              "type": "boolean",
                              "description": "stage active",
                              "nullable": true
                            }
                          }
                        },
                        "timezone": {
                          "type": "string",
                          "description": "timezone"
                        },
                        "context_token": {
                          "type": "string",
                          "description": "Opaque snapshot token; map from this response. Not an access grant, event sequence or dispatch permit.",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scheduling": {
                          "type": "object",
                          "properties": {
                            "eligible": {
                              "type": "boolean",
                              "description": "eligible"
                            },
                            "reason": {
                              "type": "string",
                              "nullable": true,
                              "description": "reason"
                            },
                            "due": {
                              "type": "boolean",
                              "description": "due"
                            }
                          },
                          "description": "Advisory current eligibility only. Does not enroll or dispatch a reminder."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "source": {
                      "application": "crm",
                      "type": "lead_activity",
                      "id": "27",
                      "workspace_id": "c6886c1b-f7dc-456a-830e-a48b88c989b9",
                      "organisation_id": "22222222-2222-4222-8222-222222222222",
                      "lead_id": "8"
                    },
                    "activity": {
                      "type": "CALL",
                      "status": "PENDING",
                      "scheduled_at": "2026-10-02T10:00:00+00:00",
                      "completed_at": null,
                      "updated_at": "2026-09-25T12:00:00+00:00"
                    },
                    "lead": {
                      "id": "8",
                      "assigned_user_id": null,
                      "stage_id": "33333333-3333-4333-8333-333333333333",
                      "stage_closed": false,
                      "stage_active": true
                    },
                    "timezone": "Asia/Kolkata",
                    "context_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "scheduling": {
                      "eligible": true,
                      "reason": null,
                      "due": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityContextController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Reads the owning CRM activity without copying customer data. Use the returned context_token for a guarded change. Responses are private/no-store. Existing workspace and activity policies apply.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key"
      },
      "patch": {
        "summary": "Reschedule, complete or cancel a pending activity",
        "operationId": "crm_activity_followup_update",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Current activity context.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "application": {
                              "type": "string",
                              "description": "application"
                            },
                            "type": {
                              "type": "string",
                              "description": "type"
                            },
                            "id": {
                              "type": "string",
                              "description": "id"
                            },
                            "workspace_id": {
                              "type": "string",
                              "description": "workspace id"
                            },
                            "organisation_id": {
                              "type": "string",
                              "description": "organisation id"
                            },
                            "lead_id": {
                              "type": "string",
                              "description": "lead id"
                            }
                          }
                        },
                        "activity": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "description": "type"
                            },
                            "status": {
                              "type": "string",
                              "description": "status"
                            },
                            "scheduled_at": {
                              "type": "string",
                              "description": "scheduled at"
                            },
                            "completed_at": {
                              "type": "string",
                              "nullable": true,
                              "description": "completed at"
                            },
                            "updated_at": {
                              "type": "string",
                              "description": "updated at"
                            }
                          }
                        },
                        "lead": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "id"
                            },
                            "assigned_user_id": {
                              "nullable": true,
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ],
                              "description": "Assigned local CRM user identifier, if assigned."
                            },
                            "stage_id": {
                              "type": "string",
                              "nullable": true,
                              "description": "stage id"
                            },
                            "stage_closed": {
                              "type": "boolean",
                              "description": "stage closed",
                              "nullable": true
                            },
                            "stage_active": {
                              "type": "boolean",
                              "description": "stage active",
                              "nullable": true
                            }
                          }
                        },
                        "timezone": {
                          "type": "string",
                          "description": "timezone"
                        },
                        "context_token": {
                          "type": "string",
                          "description": "Opaque snapshot token; map from this response. Not an access grant, event sequence or dispatch permit.",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scheduling": {
                          "type": "object",
                          "properties": {
                            "eligible": {
                              "type": "boolean",
                              "description": "eligible"
                            },
                            "reason": {
                              "type": "string",
                              "nullable": true,
                              "description": "reason"
                            },
                            "due": {
                              "type": "boolean",
                              "description": "due"
                            }
                          },
                          "description": "Advisory current eligibility only. Does not enroll or dispatch a reminder."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "source": {
                      "application": "crm",
                      "type": "lead_activity",
                      "id": "27",
                      "workspace_id": "c6886c1b-f7dc-456a-830e-a48b88c989b9",
                      "organisation_id": "22222222-2222-4222-8222-222222222222",
                      "lead_id": "8"
                    },
                    "activity": {
                      "type": "CALL",
                      "status": "PENDING",
                      "scheduled_at": "2026-10-02T10:00:00+00:00",
                      "completed_at": null,
                      "updated_at": "2026-09-25T12:00:00+00:00"
                    },
                    "lead": {
                      "id": "8",
                      "assigned_user_id": null,
                      "stage_id": "33333333-3333-4333-8333-333333333333",
                      "stage_closed": false,
                      "stage_active": true
                    },
                    "timezone": "Asia/Kolkata",
                    "context_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "scheduling": {
                      "eligible": true,
                      "reason": null,
                      "due": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Honour Retry-After before another request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The activity/lead changed, or the activity is no longer pending. Reload and review.",
            "content": {
              "application/json": {
                "example": {
                  "message": "This activity or lead changed. Reload its context before changing it."
                }
              }
            }
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityContextController@update",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Changes the activity only. Send the token from a reviewed GET response. Returns 409 if the source changed or is no longer pending. Never automatically replay after an uncertain response; reload and inspect. Rescheduling normalizes the numeric timezone offset to UTC. Does not directly enroll a reminder plan.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-authentication": "application-api-key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "operation",
                      "context_token",
                      "scheduled_at"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "reschedule"
                        ]
                      },
                      "context_token": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$",
                        "description": "Current opaque token returned by GET."
                      },
                      "scheduled_at": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{2}:\\d{2}$",
                        "description": "Date/time with seconds and numeric offset. Use +00:00 for UTC."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "operation",
                      "context_token"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "complete",
                          "cancel"
                        ]
                      },
                      "context_token": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$",
                        "description": "Current opaque token returned by GET."
                      }
                    }
                  }
                ]
              },
              "examples": {
                "reschedule": {
                  "value": {
                    "operation": "reschedule",
                    "context_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "scheduled_at": "2026-10-02T15:30:00+05:30"
                  }
                },
                "complete": {
                  "value": {
                    "operation": "complete",
                    "context_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                },
                "cancel": {
                  "value": {
                    "operation": "cancel",
                    "context_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lead-activities/{leadActivity}/reminders": {
      "get": {
        "summary": "List my verified activity reminder plans",
        "operationId": "crm_activity_reminders",
        "tags": [
          "Lead activity"
        ],
        "responses": {
          "200": {
            "description": "Bounded summary, without workflow inputs or credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "has_more",
                    "page",
                    "scope"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "maxItems": 20,
                      "description": "Only the current actor’s plans with a previously verified exact activity binding. Unenrolled drafts and other owners’ plans are omitted.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Existing central reminder plan ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Plan name."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "active",
                              "paused",
                              "archived"
                            ],
                            "description": "Saved plan state; paused plans do not dispatch."
                          },
                          "next_run_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "Earliest pending occurrence in UTC for this exact binding; null if none. Not a delivery guarantee."
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Request the next page explicitly when true."
                    },
                    "page": {
                      "type": "integer",
                      "description": "Current page, starting at 1."
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "own_verified_plans",
                        "not_connected"
                      ],
                      "description": "not_connected is returned only by CRM when its organisation is unlinked."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "a9892043-1519-4cf9-9875-268d915eea23",
                      "name": "Call reminder",
                      "status": "active",
                      "next_run_at": "2026-09-26T09:00:00+00:00"
                    }
                  ],
                  "has_more": false,
                  "page": 1,
                  "scope": "own_verified_plans"
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Application, read/write permission, organisation or resource access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource does not exist or is unavailable to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request fields; inspect errors by field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads; wait before refreshing."
          },
          "503": {
            "description": "Service unavailable or invalid upstream response. Refresh explicitly; do not treat as an empty list."
          }
        },
        "x-controller": "App\\Http\\Controllers\\Api\\LeadActivityContextController@show",
        "x-auth-middleware": [
          "api",
          "autoappy.session",
          "autoappy.platform",
          "lead.activity.access"
        ],
        "description": "Read-only, on-demand summary. No plans are created and no messages are sent. Requires the signed-in actor’s access; CRM checks activity visibility before forwarding that actor’s token. Central membership, main-product entitlement and plan ownership are enforced. No connector credential fallback. Empty data is not an organisation-wide assurance that no reminders exist. Open or refresh explicitly; do not poll this endpoint.",
        "parameters": [
          {
            "name": "leadActivity",
            "in": "path",
            "required": true,
            "description": "Lead activity identifier. Obtain it from the corresponding list endpoint in this workspace.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AutoAppy-Workspace",
            "in": "header",
            "required": false,
            "description": "Central organisation UUID for the authorised workspace. Required by organisation-scoped operations.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Local workspace ID from GET /api/auth/me, distinct from the central organisation UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            },
            "description": "Page of at most 20 plans."
          }
        ],
        "x-authentication": "application-api-key"
      }
    },
    "/customer-context/records/{record}": {
      "get": {
        "summary": "Load connected context from a local record",
        "operationId": "crm_customer_context_show",
        "tags": [
          "Connected customer"
        ],
        "security": [
          {
            "UserBearer": []
          }
        ],
        "parameters": [
          {
            "name": "record",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Explicit existing identifier; must belong to the authorised organisation."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            },
            "description": "Explicit page of at most 20 records or events."
          },
          {
            "name": "record_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "Optional selected CRM opportunity or WhatsApp conversation ID from this customer section. Loads its activities or messages."
          },
          {
            "name": "section",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "profile",
                "crm",
                "whatsapp"
              ]
            },
            "description": "Only this section is fetched. Other apps are not queried."
          }
        ],
        "description": "On-demand actor-authorized read. Requires an explicit connected customer. Data remains in each owner service. No customer replication, sending, connector fallback or automatic retry. Paginated summaries; selected CRM records return activities, selected WhatsApp records return message previews. Responses are private/no-store. Partial source failure is distinct from empty data.",
        "responses": {
          "200": {
            "description": "data envelope: status ready/not_connected/denied/unavailable, customer_id, source, fetched_at, items, has_more. Access checks return only customer_id."
          },
          "401": {
            "description": "Sign in again."
          },
          "403": {
            "description": "Actor, workspace, customer or product access denied."
          },
          "404": {
            "description": "Selected record unavailable."
          },
          "422": {
            "description": "Invalid section, page or identifier."
          },
          "429": {
            "description": "Rate limited; refresh later."
          },
          "503": {
            "description": "Context service unavailable; do not interpret as empty data."
          }
        }
      }
    },
    "/customer-context/organisations/{organisation}/customers/{customer}": {
      "get": {
        "summary": "Read customer records from their owning app",
        "operationId": "crm_customer_context_source",
        "tags": [
          "Connected customer"
        ],
        "security": [
          {
            "UserBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organisation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Explicit existing identifier; must belong to the authorised organisation."
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Explicit existing identifier; must belong to the authorised organisation."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            },
            "description": "Explicit page of at most 20 records or events."
          },
          {
            "name": "record_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "Optional selected CRM opportunity or WhatsApp conversation ID from this customer section. Loads its activities or messages."
          }
        ],
        "description": "On-demand actor-authorized read. Requires an explicit connected customer. Data remains in each owner service. No customer replication, sending, connector fallback or automatic retry. Paginated summaries; selected CRM records return activities, selected WhatsApp records return message previews. Responses are private/no-store. Partial source failure is distinct from empty data.",
        "responses": {
          "200": {
            "description": "data envelope: status ready/not_connected/denied/unavailable, customer_id, source, fetched_at, items, has_more. Access checks return only customer_id."
          },
          "401": {
            "description": "Sign in again."
          },
          "403": {
            "description": "Actor, workspace, customer or product access denied."
          },
          "404": {
            "description": "Selected record unavailable."
          },
          "422": {
            "description": "Invalid section, page or identifier."
          },
          "429": {
            "description": "Rate limited; refresh later."
          },
          "503": {
            "description": "Context service unavailable; do not interpret as empty data."
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Standalone API guide",
    "url": "https://crm.autoappy.com/api/guide.md"
  },
  "tags": [
    {
      "name": "Activities"
    },
    {
      "name": "Auto appy auth"
    },
    {
      "name": "Connection"
    },
    {
      "name": "Crm analytics"
    },
    {
      "name": "Document category"
    },
    {
      "name": "Document storage"
    },
    {
      "name": "Lead"
    },
    {
      "name": "Lead activity"
    },
    {
      "name": "Lead analytics"
    },
    {
      "name": "Lead document"
    },
    {
      "name": "Lead field"
    },
    {
      "name": "Lead import"
    },
    {
      "name": "Lead owner"
    },
    {
      "name": "Lead stage"
    },
    {
      "name": "Lead workflow"
    },
    {
      "name": "Leads"
    },
    {
      "name": "Node transition"
    },
    {
      "name": "Organisation connection"
    },
    {
      "name": "Pipeline"
    },
    {
      "name": "Pipeline import"
    },
    {
      "name": "Pipelines & fields"
    },
    {
      "name": "Stage node"
    },
    {
      "name": "Team performance"
    },
    {
      "name": "Workflow builder"
    },
    {
      "name": "Workspace"
    },
    {
      "name": "Workspace user"
    }
  ]
}
