# List Rows

`GET /api/v1/tables/{tableId}/rows`

## Description
Query rows from a table with optional filtering, sorting, and pagination. Filters and sorts are passed as JSON-encoded query parameters.

## Parameters

- **tableId** (path) (required) — `string`: The unique identifier of the table.

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

- **filter** (query) — `string`: JSON-encoded filter object. Example: {"status": "active"} or {"age": {"$gt": 18}}.

- **sort** (query) — `string`: JSON-encoded sort object. Example: {"created_at": "desc"}.

- **limit** (query) — `integer`: Maximum rows to return (1-1000, default 100).

- **offset** (query) — `integer`: Number of rows to skip for pagination (default 0). Deprecated: use cursor. When both are sent, cursor wins.

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

## Responses

### 200 — Rows matching the query.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Indicates whether the request was successful."
    },
    "data": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A single row in a table.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique row identifier.",
                "example": "row_xyz789"
              },
              "data": {
                "type": "object",
                "additionalProperties": true,
                "description": "Row data as key-value pairs matching the table schema."
              },
              "position": {
                "type": "integer",
                "description": "Row's position/order in the table."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601 timestamp when the row was created."
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601 timestamp when the row was last modified."
              }
            }
          },
          "description": "Array of rows matching the query."
        },
        "rowCount": {
          "type": "integer",
          "description": "Number of rows returned in this response."
        },
        "totalCount": {
          "type": "integer",
          "description": "Total rows matching the filter."
        },
        "limit": {
          "type": "integer",
          "description": "The limit that was applied to the query."
        },
        "offset": {
          "type": "integer",
          "description": "The offset that was applied to the query."
        }
      },
      "description": "Response payload."
    },
    "nextCursor": {
      "type": "string",
      "nullable": true,
      "description": "Cursor for fetching the next page. null when there are no more results."
    }
  }
}
```

### 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."
    }
  }
}
```

### 404 — The requested resource was not found. Verify the ID is correct and belongs to your workspace.

```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."
    }
  }
}
```
