Stargate REST API reference (1.0.0)

Download OpenAPI specification:Download

License: Apache 2.0

The Stargate REST API provides CRUD operations on table data managed by Stargate.

Auth

The Auth API allows you to create an authorization token to connect to your database

Create an authorization token

Create an authorization token used for all queries.

Request Body schema: application/json
username
required
string

Username

password
required
string

Password

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "authToken": "string"
}

Schemas

The Schema API allows you to interact with keyspaces and tables in your database

Get all keyspaces

Retrieve all available keyspaces in the specific database.

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Create a keyspace

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
name
required
string
Array of objects (Datacenter)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "datacenters": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Create a table

path Parameters
keyspace-id
required
string

keyspace name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
name
required
string
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)
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)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "ifNotExists": false,
  • "columnDefinitions": [
    ],
  • "primaryKey": {
    },
  • "tableOptions": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Get tables

path Parameters
keyspace-id
required
string

keyspace name

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Create a table by {table-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
name
required
string
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)
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)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "ifNotExists": false,
  • "columnDefinitions": [
    ],
  • "primaryKey": {
    },
  • "tableOptions": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Get tables by {table-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Delete a table by {table-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Create a column

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "name": "emailaddress",
  • "typeDefinition": "text",
  • "static": false
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Get all columns

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get a column by {column-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

column-id
required
string

column name

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Create a column by {column-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

column-id
required
string

column name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "name": "emailaddress",
  • "typeDefinition": "text",
  • "static": false
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Delete a column by {column-id}

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

column-id
required
string

column name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Data

The Data API allows you to add, update, and delete rows in your database

Create a row

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "name": "emailaddress",
  • "typeDefinition": "text",
  • "static": false
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Get all rows

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get a row by primary key

path Parameters
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 semicolons (val1;val2...) in the order they were defined.
For example, if the composite key was defined as PRIMARY KEY(race_year, race_name) then the primary key in the path would be race_year;race_name.

query Parameters
raw
boolean
Default: false

unwrap results

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "keyspace": "string",
  • "columnDefinitions": [
    ],
  • "primaryKey": {
    },
  • "tableOptions": {
    }
}

Replace a row by primary key

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Request Body schema: application/json
name
required
string
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)
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)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "ifNotExists": false,
  • "columnDefinitions": [
    ],
  • "primaryKey": {
    },
  • "tableOptions": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string"
}

Delete a row

path Parameters
keyspace-id
required
string

keyspace name

table-id
required
string

table name

header Parameters
X-Cassandra-Token
required
string

The token returned from the authorization endpoint for classic databases. Use this token in each request.

Responses