# List Doc Folders

`GET /api/v1/docs/folders`

## Description
List all active folders used to organize workspace docs. Folders are returned as a flat list with parentId references; clients reconstruct the tree as needed.

## Parameters

- **workspaceId** (query) (required) — `string`: The unique identifier of the workspace.

- **limit** (query) — `integer`: Page size (1-200). Omit both limit and cursor to receive every folder in one response; when only cursor is sent the page size defaults to 100.

- **cursor** (query) — `string`: Pagination cursor returned in a previous response's nextCursor field.

## Responses

### 200 — Folders listed successfully.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "data": {
      "type": "object",
      "properties": {
        "folders": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A workspace folder used to organize docs.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Folder ID."
              },
              "workspaceId": {
                "type": "string",
                "description": "Owning workspace ID."
              },
              "parentId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Parent folder ID, or null for top-level."
              },
              "name": {
                "type": "string",
                "description": "Display name."
              },
              "isSystem": {
                "type": "boolean",
                "description": "Whether this is a system-managed folder."
              },
              "sortOrder": {
                "type": "integer",
                "description": "Display sort order."
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional accent color."
              },
              "createdBy": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "User ID of the creator."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "workspaceId",
              "parentId",
              "name",
              "isSystem",
              "sortOrder",
              "createdAt",
              "updatedAt"
            ]
          }
        },
        "totalCount": {
          "type": "integer"
        }
      },
      "required": [
        "folders",
        "totalCount"
      ]
    },
    "nextCursor": {
      "type": "string",
      "nullable": true,
      "description": "Cursor for fetching the next page. null when there are no more results."
    },
    "limits": {
      "type": "object",
      "description": "Rate limit and usage information attached to the /api/v1 workflows, logs, and audit logs responses. The Execute Workflow and Get Job Status responses do not include it.",
      "properties": {
        "workflowExecutionRateLimit": {
          "type": "object",
          "description": "Current rate limit status for workflow executions.",
          "properties": {
            "sync": {
              "description": "Rate limit bucket for synchronous executions.",
              "$ref": "#/components/schemas/RateLimitBucket"
            },
            "async": {
              "description": "Rate limit bucket for asynchronous executions.",
              "$ref": "#/components/schemas/RateLimitBucket"
            }
          }
        },
        "usage": {
          "type": "object",
          "description": "Current billing period usage and plan limits.",
          "properties": {
            "currentPeriodCost": {
              "type": "number",
              "description": "Total spend in the current billing period in USD.",
              "example": 1.25
            },
            "limit": {
              "type": "number",
              "description": "Maximum allowed spend for the current billing period in USD.",
              "example": 50
            },
            "plan": {
              "type": "string",
              "description": "Your current subscription plan (e.g., free, pro, team).",
              "example": "pro"
            },
            "isExceeded": {
              "type": "boolean",
              "description": "Whether the usage limit has been exceeded. Executions may be blocked when true.",
              "example": false
            }
          }
        }
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}
```

### 400 — workspaceId missing or invalid.

### 403 — Caller lacks workspace permission.

### 500 — Internal error.
