Stargate Document API reference (2.0.0)

Download OpenAPI specification:Download

License: Apache 2.0

The Stargate Document API provides CRUD operations on document data managed by Stargate.

Auth

auth

Create an auth token

Create an authorization token.

query Parameters
pretty
boolean

format results

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

storage configuration

Create a namespace

query Parameters
pretty
boolean

format results

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

A map representing a namespace 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 },
      ],
}
object

Responses

Request samples

Content type
application/json
Example
{
  • "name": "killrvideo"
}

Response samples

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

Get all namespaces

Retrieve all available namespaces.

query Parameters
pretty
boolean

format results

raw
boolean

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 namespace

path Parameters
namespace-id
required
string

namespace name

query Parameters
pretty
boolean

format results

raw
boolean

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 namespace

path Parameters
namespace-id
required
string

namespace name

query Parameters
pretty
boolean

format 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
{ }

Documents

document data

Create a collection

path Parameters
namespace-id
required
string

namespace name

query Parameters
pretty
boolean

format results

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
object

Responses

Request samples

Content type
application/json
{
  • "name": "users",
  • "fields": {
    },
  • "validationAction": "warn"
}

Response samples

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

List collections in a namespace

path Parameters
namespace-id
required
string

namespace name

query Parameters
pretty
boolean

format results

raw
boolean

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 collection

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

query Parameters
pretty
boolean

format results

raw
boolean

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 collection

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

query Parameters
pretty
boolean

format 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
{ }

Search for documents in {collection-id}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

query Parameters
pretty
boolean

format results

where
object
Examples:
  • author.name=Cliff Wicklow&createTime=[object Object]&$or=[object Object],[object Object] -

URL escaped JSON query using the following keys:

Key Operation
$lt Less Than
$lte Less Than Or Equal To
$gt Greater Than
$gte Greater Than Or Equal To
$ne Not Equal To
$in Contained In
$exists A value is set for the key
fields
string
Examples:
  • fields=name, email -

URL escaped, comma delimited list of keys to include

page-size
integer <int32>
Examples:
  • page-size=10 -

restrict the number of returned items (max 100)

page-state
string
Examples:
  • page-state= -

move the cursor to a particular result

sort
object
Examples:
  • documentId=asc&name=desc -

keys to sort by

raw
boolean

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
{
  • "count": 1,
  • "pageState": "2f4acd34",
  • "data": [
    ]
}

Add a new document to {collection-id}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

query Parameters
pretty
boolean

format results

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

document

object

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World",
  • "author": {
    }
}

Response samples

Content type
application/json
{
  • "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}

Get a document by {document-id}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

query Parameters
pretty
boolean

format results

fields
string
Examples:
  • fields=name, email -

URL escaped, comma delimited list of keys to include

raw
boolean

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": {
    }
}

Replace a document by {document-id}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

query Parameters
pretty
boolean

format results

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

document

object

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World",
  • "author": {
    }
}

Response samples

Content type
application/json
{
  • "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}

Update part of a document

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

query Parameters
pretty
boolean

format results

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

document

object

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World"
}

Response samples

Content type
application/json
{
  • "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}

Delete a document

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

query Parameters
pretty
boolean

format 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
{ }

Get a sub document by {document-path}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

document-path
required
string

a JSON path

query Parameters
pretty
boolean

format results

fields
string
Examples:
  • fields=name, email -

URL escaped, comma delimited list of keys to include

raw
boolean

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
{
  • "documentPath": "author",
  • "data": {
    }
}

Replace a sub document by {document-path}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

document-path
required
string

a JSON path

query Parameters
pretty
boolean

format results

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

document

object

Responses

Request samples

Content type
application/json
{
  • "foo-bar-789": {
    }
}

Response samples

Content type
application/json
{
  • "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}

Update part of a sub document by {document-path}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

document-path
required
string

a JSON path

query Parameters
pretty
boolean

format results

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

document

object

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World"
}

Response samples

Content type
application/json
{
  • "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7"
}

Delete a sub document by {document-path}

path Parameters
namespace-id
required
string

namespace name

collection-id
required
string

name of the document collection

document-id
required
string

the id of the document

document-path
required
string

a JSON path

query Parameters
pretty
boolean

format 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
{ }