# List Docs

`GET /api/v1/docs`

## Description
List all docs in a workspace.

## Parameters

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

- **folderId** (query) — `string`: Optional folder id. When provided, list only docs inside that folder. Omit to list across the whole workspace.

- **scope** (query) — `string`: Lifecycle scope filter. Defaults to active (live docs only).

- **limit** (query) — `integer`: Page size (1-200). Omit both limit and cursor to receive every doc 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 — List of workspace docs.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Whether the request completed successfully."
    },
    "data": {
      "type": "object",
      "properties": {
        "docs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique file identifier.",
                "example": "wf_1709571234_abc1234"
              },
              "name": {
                "type": "string",
                "description": "Original filename.",
                "example": "data.csv"
              },
              "size": {
                "type": "integer",
                "description": "File size in bytes.",
                "example": 1024
              },
              "type": {
                "type": "string",
                "description": "MIME type of the file.",
                "example": "text/csv"
              },
              "key": {
                "type": "string",
                "description": "Storage key for the file.",
                "example": "workspace/abc-123/1709571234-xyz-data.csv"
              },
              "uploadedBy": {
                "type": "string",
                "description": "User ID of the uploader."
              },
              "uploadedAt": {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601 timestamp of when the file was uploaded."
              },
              "folderId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Parent folder id, or null when the doc lives at the workspace top level."
              }
            }
          },
          "description": "Array of doc metadata objects in the workspace."
        },
        "totalCount": {
          "type": "integer",
          "description": "Total number of docs."
        }
      },
      "description": "Response payload containing the docs list and count."
    },
    "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
            }
          }
        }
      }
    }
  }
}
```

### 400 — Invalid request parameters. Check the details array for specific validation errors.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message describing the validation failure."
    },
    "details": {
      "type": "array",
      "description": "List of specific validation errors with field-level details.",
      "items": {
        "type": "object"
      }
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 403 — Access denied. You do not have permission to access this resource. For audit log endpoints, this requires an Enterprise subscription and organization admin/owner role.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 429 — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message with rate limit details."
    }
  }
}
```
