Stargate REST API reference (2.0.0)

Download OpenAPI specification:Download

License: Apache 2.0

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.

Auth

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

Create an authorization token

Create an authorization token.

Request Body schema: application/json
username
required
string

Username

password
required
string

Password

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "authToken": "5c90f769-8784-499c-83f7-b764822255f1"
}

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. Use this token in each request.

Responses

Response samples

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

Create a keyspace

header Parameters
X-Cassandra-Token
required
string

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

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

Responses

Request samples

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

Response samples

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

Get a keyspace using the {keyspace-id}

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. Use this token in each request.

Responses

Response samples

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

Delete a keyspace

path Parameters
keyspace-id
required
string

keyspace name

header Parameters
X-Cassandra-Token
required
string

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

Responses

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. Use this token in each request.

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

Responses

Request samples

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

Response samples

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

Get all 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. Use this token in each request.

Responses

Response samples

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