Download OpenAPI specification:Download
The Stargate REST API provides CRUD operations on table data managed by Stargate. Keep in mind that you will need information for the server ({databaseId} and {region}) for all of these operations.
Create an authorization token.
username required | string Username |
password required | string Password |
{- "username": "cassandra",
- "password": "cassandra"
}
{- "authToken": "5c90f769-8784-499c-83f7-b764822255f1"
}
Retrieve all available keyspaces in the specific database.
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "name": "users_keyspace",
- "datacenters": [
- {
- "name": "DC1",
- "replicas": 2
}
]
}
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string The name of the keyspace. |
Array of objects (Datacenter) The datacenters within a keyspace. Only applies for those keyspaces created with NetworkTopologyStrategy. |
{- "name": "users_keyspace",
- "datacenters": [
- {
- "name": "DC1",
- "replicas": 2
}
]
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "name": "users_keyspace",
- "datacenters": [
- {
- "name": "DC1",
- "replicas": 2
}
]
}
keyspace-id required | string keyspace name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string Name of the table. |
ifNotExists | boolean Default: false Determines whether to create a new table if a table with the same name exists. Attempting to create an existing table returns an error unless this option is true. |
required | Array of objects (ColumnDefinition) Definition of columns that belong to the table to be added. |
required | object (PrimaryKey) 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. |
object (TableOptions) |
{- "name": "users",
- "ifNotExists": true,
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "emailaddress"
], - "clusteringKey": [
- "age"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "age",
- "order": "ASC"
}
]
}
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "data": [
- {
- "name": "users",
- "keyspace": "users_keyspace",
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "emailaddress"
], - "clusteringKey": [
- "age"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "age",
- "order": "ASC"
}
]
}
}
]
}
keyspace-id required | string keyspace name |
table-id required | string table name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "name": "users",
- "keyspace": "users_keyspace",
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "emailaddress"
], - "clusteringKey": [
- "age"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "age",
- "order": "ASC"
}
]
}
}
keyspace-id required | string keyspace name |
table-id required | string table name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string Name of the table. |
ifNotExists | boolean Default: false Determines whether to create a new table if a table with the same name exists. Attempting to create an existing table returns an error unless this option is true. |
required | Array of objects (ColumnDefinition) Definition of columns that belong to the table to be added. |
required | object (PrimaryKey) 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. |
object (TableOptions) |
{- "name": "users",
- "ifNotExists": true,
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "emailaddress"
], - "clusteringKey": [
- "age"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "age",
- "order": "ASC"
}
]
}
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
table-id required | string table name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "data": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
]
}
keyspace-id required | string keyspace name |
table-id required | string table name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string Name for the column, which must be unique. |
typeDefinition required | string 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" The type of data allowed in the column. |
static | boolean Default: false Denotes whether the column is shared by all rows of a partition. |
{- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
table-id required | string table name |
column-id required | string column name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
keyspace-id required | string keyspace name |
table-id required | string table name |
column-id required | string column name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string Name for the column, which must be unique. |
typeDefinition required | string 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" The type of data allowed in the column. |
static | boolean Default: false Denotes whether the column is shared by all rows of a partition. |
{- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
table-id required | string table name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
[- [
- {
- "keyspace_name": "users_keyspace",
- "options": [
- {
- "key": "target",
- "value": "values(favorite_books)"
}
], - "table_name": "users",
- "index_name": "fav_books_idx",
- "kind": "COMPOSITES"
}
]
]
keyspace-id required | string keyspace name |
table-id required | string table name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name | string Optional name for the index, which must be unique. If no name is specified, the index is named as follows: tablename_columnname_idx. |
column required | string Column for which index will be created. |
type | string Default: "" Enum: "org.apache.cassandra.index.sasi.SASIIndex" "StorageAttachedIndex" Type of index, defined with a custom index class name or classpath. Secondary index is default, no type entered |
object | |
kind | string Default: "VALUES" Enum: "FULL" "KEYS" "VALUES" "ENTRIES" Index kind for collections. |
ifNotExists | boolean Default: false Determines creation of a new index, if an index with the same name exists. If an index exists, and this option is set to true, an error is returned. |
{- "name": "age_idx",
- "column": "age",
- "type": "",
- "options": {
- "property1": "string",
- "property2": "string"
}, - "kind": "KEYS",
- "ifNotExists": true
}
{- "success": true
}
keyspace-id required | string keyspace name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
[- {
- "name": "string",
- "keyspace": "string",
- "fields": [
- {
- "name": "string",
- "typeDefinition": "text"
}
]
}
]
keyspace-id required | string keyspace name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string |
ifNotExists | boolean Determines whether to create a new UDT if an UDT with the same name exists. Attempting to create an existing UDT returns an error unless this option is true. |
required | Array of objects (TypeField) |
{- "name": "string",
- "ifNotExists": true,
- "fields": [
- {
- "name": "string",
- "typeDefinition": "text"
}
]
}
{- "name": "string"
}
keyspace-id required | string keyspace name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
name required | string |
Array of objects (TypeField) Type fields to add | |
Array of objects (RenameTypeField) User Defined Type fields to rename |
{- "name": "string",
- "addFields": [
- {
- "name": "string",
- "typeDefinition": "text"
}
], - "renameFields": [
- {
- "from": "string",
- "to": "string"
}
]
}
keyspace-id required | string keyspace name |
type-id required | string type name |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "name": "string",
- "keyspace": "string",
- "fields": [
- {
- "name": "string",
- "typeDefinition": "text"
}
]
}
keyspace-id required | string keyspace name |
table-id required | string table name |
where | object URL escaped JSON query using the following keys:
| ||||||||||||||||
fields | string URL escaped, comma delimited list of keys to include | ||||||||||||||||
page-size | integer <int32> restrict the number of returned items | ||||||||||||||||
page-state | string move the cursor to a particular result | ||||||||||||||||
object (Sort) Example: firstName=asc&age=desc keys to sort by | |||||||||||||||||
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "data": [
- {
- "property1": "string",
- "property2": "string"
}
], - "count": 0
}
keyspace-id required | string keyspace name |
table-id required | string table name |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
property name* | string |
{- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "age": "30",
- "name": "John"
}
{- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}
keyspace-id required | string keyspace name |
table-id required | string table name |
primary-key required | string Value from the primary key column for the table. Define composite keys by separating values with
slashes ( |
fields | string URL escaped, comma delimited list of keys to include |
page-size | integer <int32> restrict the number of returned items |
page-state | string move the cursor to a particular result |
object (Sort) Example: firstName=asc&age=desc keys to sort by | |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
{- "data": [
- {
- "property1": "string",
- "property2": "string"
}
], - "count": 0
}
keyspace-id required | string keyspace name |
table-id required | string table name |
primary-key required | string Value from the primary key column for the table. Define composite keys by separating values with
slashes ( |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
document
property name* | string |
{- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "age": "30",
- "name": "John"
}
{- "data": {
- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "age": "30",
- "name": "John"
}
}
keyspace-id required | string keyspace name |
table-id required | string table name |
primary-key required | string Value from the primary key column for the table. Define composite keys by separating values with
slashes ( |
raw | boolean Default: false Unwrap results. |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |
document
property name* | string |
{- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "age": "30",
- "name": "John"
}
{- "data": {
- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "age": "30",
- "name": "John"
}
}
keyspace-id required | string keyspace name |
table-id required | string table name |
primary-key required | string Value from the primary key column for the table. Define composite keys by separating values with
slashes ( |
X-Cassandra-Token required | string The token returned from the authorization endpoint. Use this token in each request. |