Download OpenAPI specification:Download
The Stargate REST API exposes CRUD access to data stored in Astra DB Cassandra tables. See the documentation site for additional information.
Execute a cql query directly
keyspaceQP | string Example: keyspaceQP=cycling Name of the keyspace to use for the request |
page-size | integer <int32> Example: page-size=10 Restrict the number of returned items |
page-state | string Cassandra page state, used for pagination on consecutive requests |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
CQL Query String
{- "count": 0,
- "pageState": "string",
- "data": [
- {
- "property1": null,
- "property2": null
}
]
}
Search a table using a json query as defined in the where
query parameter
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
where required | object JSON query using the following keys:
| ||||||||||||||||||||||||
fields | string Example: fields=name,title Comma delimited list of keys to include | ||||||||||||||||||||||||
page-size | integer <int32> Example: page-size=10 Restrict the number of returned items | ||||||||||||||||||||||||
page-state | string Cassandra page state, used for pagination on consecutive requests | ||||||||||||||||||||||||
raw | boolean Whether to 'unwrap' results object (omit wrapper) | ||||||||||||||||||||||||
sort | object Examples:
JSON Object with key(s) to sort results by as keys and 'ASC' or 'DESC' as value |
[- {
- "count": 0,
- "pageState": "string",
- "data": [
- {
- "property1": null,
- "property2": null
}
]
}
]
Add a row to a table in your database. If the new row has the same primary key as that of an existing row, the database processes it as an update to the existing row.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
Fields of the Row to create as JSON
"string"
{ }
Get all rows from a table.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
fields | string Example: fields=name,title Comma delimited list of keys to include |
page-size | integer <int32> Example: page-size=10 Restrict the number of returned items |
page-state | string Cassandra page state, used for pagination on consecutive requests |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
sort | object Examples:
JSON Object with key(s) to sort results by as keys and 'ASC' or 'DESC' as value |
[- {
- "count": 0,
- "pageState": "string",
- "data": [
- {
- "property1": null,
- "property2": null
}
]
}
]
Get rows from a table based on the primary key.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
primaryKey required | Array of strings Value from the primary key column for the table. Define composite keys by separating values with slashes ( |
tableName required | string Example: cycling_events Name of the table to use for the request |
fields | string Example: fields=name,title Comma delimited list of keys to include |
page-size | integer <int32> Example: page-size=10 Restrict the number of returned items |
page-state | string Cassandra page state, used for pagination on consecutive requests |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
sort | object Examples:
JSON Object with key(s) to sort results by as keys and 'ASC' or 'DESC' as value |
[- {
- "count": 0,
- "pageState": "string",
- "data": [
- {
- "property1": null,
- "property2": null
}
]
}
]
Update existing rows in a table.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
primaryKey required | Array of strings Value from the primary key column for the table. Define composite keys by separating values with slashes ( |
tableName required | string Example: cycling_events Name of the table to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
Fields of the Row to update as JSON
"string"
{- "data": null
}
Delete one or more rows in a table
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
primaryKey required | Array of strings Value from the primary key column for the table. Define composite keys by separating values with slashes ( |
tableName required | string Example: cycling_events Name of the table to use for the request |
{- "code": 400,
- "description": "Request invalid: payload not provided."
}
Perform a partial update of one or more rows in a table
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
primaryKey required | Array of strings Value from the primary key column for the table. Define composite keys by separating values with slashes ( |
tableName required | string Example: cycling_events Name of the table to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
Fields of the Row to patch as JSON
"string"
{- "data": null
}
Create a new keyspace.
A map representing a keyspace with SimpleStrategy or NetworkTopologyStrategy with default replicas of 1 and 3 respectively Simple:
{ "name": "killrvideo", "replicas": 1}
Network Topology:
{
"name": "killrvideo",
"datacenters":
[
{ "name": "dc1", "replicas": 3 },
{ "name": "dc2", "replicas": 3 },
],
}
"string"
{ }
Return a single keyspace specification.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
{- "name": "string",
- "datacenters": [
- {
- "name": "string",
- "replicas": 0
}
]
}
Delete a single keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
{- "code": 401,
- "description": "Unauthorized operation.",
- "grpcStatus": "PERMISSION_DENIED"
}
Retrieve all tables in a specific keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
[- {
- "name": "cycling_events",
- "keyspace": "cycling",
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "string"
], - "clusteringKey": [
- "string"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "string",
- "order": "ASC"
}
]
}
}
]
Add a table in a specific keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
Table definition as JSON
name required | string\S The name of the table to add. |
object The primary key definition of the table, consisting of partition and clustering keys. | |
Array of objects (ColumnDefinition) Definition of columns that belong to the table to be added. | |
ifNotExists | boolean 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. |
object The set of table options to apply to the table when creating. |
{- "name": "cycling_events",
- "primaryKey": {
- "partitionKey": [
- "string"
], - "clusteringKey": [
- "string"
]
}, - "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "ifNotExists": true,
- "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "string",
- "order": "ASC"
}
]
}
}
{ }
Retrieve data for a single table in a specific keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
{- "name": "cycling_events",
- "keyspace": "cycling",
- "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "primaryKey": {
- "partitionKey": [
- "string"
], - "clusteringKey": [
- "string"
]
}, - "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "string",
- "order": "ASC"
}
]
}
}
Update a single table definition, except for columns, in a keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
Table update definition as JSON
name required | string\S The name of the table to add. |
object The primary key definition of the table, consisting of partition and clustering keys. | |
Array of objects (ColumnDefinition) Definition of columns that belong to the table to be added. | |
ifNotExists | boolean 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. |
object The set of table options to apply to the table when creating. |
{- "name": "cycling_events",
- "primaryKey": {
- "partitionKey": [
- "string"
], - "clusteringKey": [
- "string"
]
}, - "columnDefinitions": [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
], - "ifNotExists": true,
- "tableOptions": {
- "defaultTimeToLive": 0,
- "clusteringExpression": [
- {
- "column": "string",
- "order": "ASC"
}
]
}
}
{ }
Delete a single table in the specified keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
{- "code": 401,
- "description": "Unauthorized operation.",
- "grpcStatus": "PERMISSION_DENIED"
}
Return all columns for a specified table.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
[- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
]
Add a single column to a table.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
Column definition as JSON
name required | string\S Name for the column, which must be unique. |
typeDefinition required | string 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
}
{ }
Return a single column specification in a specific table.
columnName required | string\S |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
{- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false
}
Update a single column in a specific table
columnName required | string\S |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
name required | string\S Name for the column, which must be unique. |
typeDefinition required | string 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
}
{ }
Delete a single column in a specific table.
columnName required | string\S |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
{- "code": 401,
- "description": "Unauthorized operation.",
- "grpcStatus": "PERMISSION_DENIED"
}
Get all indexes for a given table
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
{ }
Add an index to a single column of a table.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
Index definition as JSON
column required | string\S Column name |
name | string Optional index name. If no name is specified, Cassandra names the index: table_name_column_name_idx. |
type | string A custom index class name or classpath. |
kind | string Enum: "KEYS" "VALUES" "ENTRIES" "FULL" The kind (ENTRIES, KEY, VALUES, FULL) of an index |
object Options passed to a custom index | |
ifNotExists | boolean Determines whether to create a new index if an index with the same name exists. Attempting to create an existing index returns an error unless this option is true. |
{- "column": "string",
- "name": "string",
- "type": "string",
- "kind": "KEYS",
- "options": {
- "property1": "string",
- "property2": "string"
}, - "ifNotExists": true
}
{ }
Drop an index
indexName required | string\S |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
tableName required | string Example: cycling_events Name of the table to use for the request |
If the index doesn't exist drop will throw an error unless this query param is set to true | boolean |
{- "code": 400,
- "description": "Request invalid: payload not provided."
}
Retrieve all user defined types (UDT) in a specific keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
[- {
- "name": "string",
- "keyspace": "string",
- "fields": [
- {
- "name": "emailaddress",
- "typeDefinition": "text"
}
]
}
]
Update an user defined type (UDT) adding or renaming fields.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
Type definition as JSON
name required | string\S User Defined Type name |
Array of objects (UserDefinedTypeField) User Defined Type fields to add | |
Array of objects (UserDefinedTypeFieldRename) User Defined Type fields to rename |
{- "name": "string",
- "addFields": [
- {
- "name": "emailaddress",
- "typeDefinition": "text"
}
], - "renameFields": [
- {
- "from": "string",
- "to": "string"
}
]
}
{- "code": 401,
- "description": "Unauthorized operation.",
- "grpcStatus": "PERMISSION_DENIED"
}
Add an user defined type (udt) in a specific keyspace.
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
Type definition as JSON
"string"
{ }
Retrieve data for a single table in a specific keyspace
typeName required | string\S Name of the type to find |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
raw | boolean Whether to 'unwrap' results object (omit wrapper) |
{- "name": "string",
- "keyspace": "string",
- "fields": [
- {
- "name": "emailaddress",
- "typeDefinition": "text"
}
]
}
Delete a single user defined type (UDT) in the specified keyspace.
typeName required | string\S Name of the type to delete |
keyspaceName required | string Example: cycling Name of the keyspace to use for the request |
{- "code": 401,
- "description": "Unauthorized operation.",
- "grpcStatus": "PERMISSION_DENIED"
}