---
agentTools:
  projectIndex: https://astra.readme.io/llms.txt
---

# get a table

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Stargate REST API reference",
    "description": "The Stargate REST API provides CRUD operations on table data managed by Stargate.",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://{databaseId}-{region}.apps.astra.datastax.com/",
      "description": "Replace the <code>{databaseId}</code> with the UUID of your database and <code>{region}</code> with the cloud region where your database lives."
    }
  ],
  "externalDocs": {
    "description": "Reference Document",
    "url": "http://shorturl.at/hnqIQ"
  },
  "tags": [
    {
      "name": "schemas",
      "description": "Interact with keyspaces and tables in your database"
    }
  ],
  "paths": {
    "/api/rest/v2/schemas/keyspaces/{keyspace-id}/tables/{table-id}": {
      "get": {
        "tags": [
          "schemas"
        ],
        "summary": "get a table",
        "operationId": "getTable",
        "parameters": [
          {
            "$ref": "#/components/parameters/databaseId"
          },
          {
            "$ref": "#/components/parameters/region"
          },
          {
            "$ref": "#/components/parameters/X-Cassandra-Token"
          },
          {
            "$ref": "#/components/parameters/keyspace-id"
          },
          {
            "$ref": "#/components/parameters/table-id"
          },
          {
            "$ref": "#/components/parameters/raw"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Table"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "region": {
        "name": "region",
        "description": "Cloud region where your database lives. </br> For example, `us-east-1`",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true
      },
      "databaseId": {
        "name": "databaseId",
        "description": "UUID of your database from the Astra URL. </br> For example, `d341f349-e5db-46d2-9c90-bb9ebaa6f0fc`.",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true
      },
      "X-Cassandra-Token": {
        "name": "X-Cassandra-Token",
        "in": "header",
        "required": true,
        "description": "The token returned from the authorization endpoint. Use this token in each request.",
        "schema": {
          "type": "string"
        }
      },
      "raw": {
        "name": "raw",
        "in": "query",
        "description": "unwrap results",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        }
      },
      "keyspace-id": {
        "name": "keyspace-id",
        "in": "path",
        "description": "keyspace name",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "table-id": {
        "name": "table-id",
        "in": "path",
        "description": "table name",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "401": {
        "description": "Unauthorized",
        "content": {
          "*/*": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "content": {
          "*/*": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "Internal server error",
        "content": {
          "*/*": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Table": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "keyspace": {
            "type": "string"
          },
          "columnDefinitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ColumnDefinition"
            }
          },
          "primaryKey": {
            "$ref": "#/components/schemas/PrimaryKey"
          },
          "tableOptions": {
            "$ref": "#/components/schemas/TableOptions"
          }
        }
      },
      "ColumnDefinition": {
        "type": "object",
        "required": [
          "name",
          "typeDefinition"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name for the column, which must be unique.",
            "example": "emailaddress"
          },
          "typeDefinition": {
            "type": "string",
            "description": "The type of data allowed in the column.",
            "example": "text",
            "enum": [
              "ascii",
              "text",
              "varchar",
              "tinyint",
              "smallint",
              "int",
              "bigint",
              "varint",
              "decimal",
              "float",
              "double",
              "date",
              "DateRangeType",
              "duration",
              "time",
              "timestamp",
              "uuid",
              "timeuuid",
              "blob",
              "boolean",
              "counter",
              "inet",
              "PointType",
              "LineStringType",
              "PolygonType",
              "frozen",
              "list",
              "map",
              "set",
              "tuple"
            ]
          },
          "static": {
            "type": "boolean",
            "default": false,
            "description": "Denotes whether the column is shared by all rows of a partition."
          }
        }
      },
      "PrimaryKey": {
        "type": "object",
        "description": "Defines a column list for the primary key. Can be either a single column, compound primary key, or composite partition key. Provide multiple columns for the partition key to define a composite partition key.",
        "required": [
          "partitionKey"
        ],
        "properties": {
          "partitionKey": {
            "type": "array",
            "description": "Name of the column or columns that constitute the partition key.",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "clusteringKey": {
            "type": "array",
            "description": "Name of the column or columns that constitute the clustering key.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TableOptions": {
        "type": "object",
        "properties": {
          "defaultTimeToLive": {
            "type": "integer",
            "description": "Defines the Time To Live (TTL), which determines the time period (in seconds) to expire data. If the value is >0, TTL is enabled for the entire table and an expiration timestamp is added to each column. The maximum value is 630720000 (20 years). A new TTL timestamp is calculated each time the data is updated and the row is removed after the data expires.",
            "default": 0
          },
          "clusteringExpression": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClusteringExpression"
            }
          }
        }
      },
      "ClusteringExpression": {
        "type": "object",
        "description": "Order rows storage to make use of the on-disk sorting of columns. Specifying order can make query results more efficient.",
        "required": [
          "column",
          "order"
        ],
        "properties": {
          "column": {
            "type": "string"
          },
          "order": {
            "type": "string",
            "enum": [
              "ASC",
              "DESC"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "A description of an error state",
        "properties": {
          "description": {
            "type": "string",
            "example": "Invalid STRING constant (8be6d514-3436-4e04-a5fc-0ffbefa4c1fe) for \"id\" of type uuid",
            "description": "A human readable description of the error state"
          },
          "code": {
            "type": "integer",
            "example": 400,
            "description": "The code referencing the error state"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 95,
      "1": 207,
      "2": 155,
      "3": 197,
      "4": 63,
      "5": 157,
      "6": 85,
      "7": 0,
      "8": 30,
      "9": 16,
      "10": 172,
      "11": 175
    }
  }
}
```