Spiral API (0.1.0)

Download OpenAPI specification:

Organizations

Create a new organization

Organizations are the top-level administrative unit in Spiral. They are used to configure single sign-on, billing, audit logging, and other settings that apply to all users within the organization.

Since resources belong to projects, and all projects must belong to an organization, each user must be a member of at least one organization in order to use Spiral.

Authorizations:
BearerHttpAuthentication
Request Body schema: application/json
required
name
string

Optional human-readable name for the organization

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "org": {
    }
}

List organization memberships

Lists all organizations that the user belongs to, paginated. The user must be a member of at least one organization in order to use Spiral.

The user can be logged in to an exactly one organization at a time. Unlike this one, other organization APIs will operate on the currently logged in organization.

Authorizations:
BearerHttpAuthentication
query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Invite a user to the organization

Authorizations:
BearerHttpAuthentication
Request Body schema: application/json
required
email
required
string <email>
role
required
string (OrganizationRole)
Enum: "owner" "member" "guest"
expires_in_days
integer
Default: 7

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "role": "owner",
  • "expires_in_days": 7
}

Response samples

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

Projects

Create a new project

In Spiral, projects are the fundamental unit for structuring resources, access controls, and usage tracking.

The project will be created in the currently logged in organization.

Authorizations:
BearerHttpAuthentication
Request Body schema: application/json
required
id_prefix
string

Optional prefix for a random project ID, e.g. super-secret-project prefix will result in a project ID super-secret-project-xxxxxx where xxxxxx is a random number. If prefix is not provided, a random one will be generated, e.g. upbeat-octopus-xxxxxx.

Project IDs are globally unique and discoverable. Do not include sensitive information in the prefix.

name
string

Optional human-readable name for the project.

Unlike project ID, name is only discoverable by the people within the same organization.

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "project": {
    }
}

List projects

Lists all projects in the currently logged in organization, paginated. Lists projects visible to the currently logged in user.

Authorizations:
BearerHttpAuthentication
query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Get a project

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Responses

Response samples

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

Grant a role to a principal

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Request Body schema: application/json
required
role_id
required
string (RoleId)

Unique identifier for a project role.

required
Organization Role Principal Conditions (object) or Organization User Principal Conditions (object) or Workload Principal Conditions (object) or GitHub Principal Conditions (object) or Modal Principal Conditions (object) or GCP Principal Conditions (object) (PrincipalConditions)

Responses

Request samples

Content type
application/json
{
  • "role_id": "string",
  • "principal": {
    }
}

Response samples

Content type
application/json
{
  • "grant": {
    }
}

List active project grants

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

principal
string

Identifier for a unit of access control.

Project roles are granted to principals. A token, e.g. user token, can "include" multiple principals.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Get a grant

Authorizations:
BearerHttpAuthentication
path Parameters
grant_id
required
string

Unique identifier for a grant

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "project_id": "string",
  • "role_id": "string",
  • "principal": "string",
  • "conditions": {
    }
}

Revoke a grant

Authorizations:
BearerHttpAuthentication
path Parameters
grant_id
required
string

Unique identifier for a grant

Responses

File Systems

List builtin providers

Builtin providers are preconfigured and managed by Spiral. Resources that require access to a file system can use builtin providers to access the underlying object storage.

Authorizations:
BearerHttpAuthentication

Responses

Response samples

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

Update project's default file system

Update the default file system for a project. This operation will replace the existing file system with the new one. It is only possible to update the file system if there are no mounts associated with the current file system. File system can be updated to one of the builtin file systems or an external, e.g. your own S3 bucket.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Request Body schema: application/json
required
required
object or object or object or object (FileSystem)
object or object (FileSystemCredentials)

Responses

Request samples

Content type
application/json
{
  • "file_system": {
    },
  • "credentials": {
    }
}

Response samples

Content type
application/json
{
  • "file_system": {
    }
}

Get project's default file system

Spiral File Systems provide a means to securely federate and accelerate access to underlying object storage. File Systems are scoped to a project. However, unlike many other resource types, each project may only have a single file system, called default file system. Project resources that require access to a file system will use the default file system, unless otherwise specified on resource creation—different different resources have different API for specifying file system. Note that a project always has a default file system—if it is not explicitly set, a default builtin provider is used.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Responses

Response samples

Content type
application/json
Example
{
  • "type": "builtin",
  • "provider": "string"
}

Create a mount

Mount grants permission to use a specific path within the file system to a Spiral resource. When resources that require a file system are created they configure a mount against a file system. This means human users cannot currently read or write to a Spiral File System.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Request Body schema: application/json
required
directory
required
string (DirectoryPath) ^/(?!.*//)[^/].*/(?!/$)$

A path that is a directory.

Must start and end with a slash.

mode
required
string (Mode)
Enum: "ro" "rw"

Access mode for a mount.

principal
required
string

Responses

Request samples

Content type
application/json
{
  • "directory": "string",
  • "mode": "ro",
  • "principal": "string"
}

Response samples

Content type
application/json
{
  • "mount": {
    }
}

List active mounts in project's file system

Lists all mounts for a project's file system, paginated. Access to Spiral File Systems is limited to Spiral resources themselves. Note that file systems can only be reconfigured when they have zero mounts.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Get a mount

Authorizations:
BearerHttpAuthentication
path Parameters
mount_id
required
string

Unique identifier for a mount

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "project_id": "string",
  • "directory": "string",
  • "mode": "ro",
  • "principal": "string"
}

Remove mount

Remove a mount from the file system.

Authorizations:
BearerHttpAuthentication
path Parameters
mount_id
required
string

Unique identifier for a mount

Responses

Issue SPFS token for a mount

Create an SPFS token for a given mount.

Token is used to authenticate with the Spiral File System. SPFS tokens are short-lived and scoped to a mount path within the file system.

Authorizations:
BearerHttpAuthentication
path Parameters
mount_id
required
string

Unique identifier for a mount

Request Body schema: application/json
required
mode
required
string (Mode)
Enum: "ro" "rw"

Access mode for a mount.

required
FilePath (string) or DirectoryPath (string)

Issues a mount token scoped to this path within the mount.

In case of a file path, the token is only valid of spfsm:/// In case of a directory path, the token is valid for any path under spfsm:////

Responses

Request samples

Content type
application/json
{
  • "mode": "ro",
  • "path": "string"
}

Response samples

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

Workloads

Create a new workload

Workloads are typically long-running services that need to access Spiral resources, yet cannot be authenticated using OIDC.

Workloads are principals and therefore can be granted roles in the same way as users.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Request Body schema: application/json
required
name
string

Optional human-readable name for the workload

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "workload": {
    }
}

List active project workloads

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Get a workload

Authorizations:
BearerHttpAuthentication
path Parameters
workload_id
required
string

Unique identifier for a workload

Responses

Response samples

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

De-activate a workload

De-activates a workload.

This operation irreversibly revokes all client credentials associated with the workload.

Authorizations:
BearerHttpAuthentication
path Parameters
workload_id
required
string

Unique identifier for a workload

Responses

Issue workload credentials

Create workload credentials. Only the three most recent credentials are active at any given time.

Credentials can be exchanged for an access token using the OAuth2 token endpoint.

Authorizations:
BearerHttpAuthentication
path Parameters
workload_id
required
string

Unique identifier for a workload

Request Body schema: application/json
required
any

Responses

Request samples

Content type
application/json
null

Response samples

Content type
application/json
{
  • "client_id": "string",
  • "client_secret": "pa$$word",
  • "revoked_client_id": "string"
}

Revoke workload credentials

Revoke workload credentials.

Authorizations:
BearerHttpAuthentication
path Parameters
client_id
required
string

Unique identifier for a client credentials

Responses

Tables

Create a new table

Create a new table.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

Request Body schema: application/json
required
dataset
required
string (DatasetName)

Unique identifier for a dataset.

table
required
string (TableName)

Human-readable name for a table.

key_schema
required
string

Base64 encoded Arrow IPC Schema of the keys of this table.

root_uri
string

The location where this table's data and metadata files are stored. If unspecified, the server will generate a fresh location in the Spiral File System.

exist_ok
required
boolean

If false, an error occurs if a table with the specified name already exists in the specified dataset.

Responses

Request samples

Content type
application/json
{
  • "dataset": "string",
  • "table": "string",
  • "key_schema": "string",
  • "root_uri": "string",
  • "exist_ok": true
}

Response samples

Content type
application/json
{
  • "table": {
    }
}

List tables

List all tables in the project.

Authorizations:
BearerHttpAuthentication
path Parameters
project_id
required
string

Unique identifier for a project

query Parameters
page_token
string

Token for pagination

page_size
integer <int32>

Number of items per page

dataset
string

Name of the dataset to filter by

table
string

Name of the table to filter by

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "next_page_token": "string"
}

Get a table

Authorizations:
BearerHttpAuthentication
path Parameters
table_id
required
string

Unique identifier for a table

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "project_id": "string",
  • "dataset": "string",
  • "table": "string",
  • "root_uri": "string",
  • "key_schema": "string"
}

Retrieve an SPFS token with which files in this table can be read.

Authorizations:
BearerHttpAuthentication
path Parameters
table_id
required
string

Unique identifier for a table

Responses

Response samples

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

Retrieve an SPFS token valid for writing one new file in this table.

Authorizations:
BearerHttpAuthentication
path Parameters
table_id
required
string

Unique identifier for a table

Request Body schema: application/json
required
file_type
required
string (FileType)
Enum: "fragment_file" "fragment_manifest" "reference_file"

The type of table files. Fragment files contain data rows. Fragment manifest files contain lists of data files that comprise a snapshot of the table. Reference files contain out-of-band data referenced by fragment files.

file_format
required
string (FileFormat)
Enum: "pq" "pb" "bina" "vtx"

A file format:

  • pq: Parquet
  • pb: Protobuf
  • bina: BinaryArrayFileHandle
  • vtx: Vortex

Responses

Request samples

Content type
application/json
{
  • "file_type": "fragment_file",
  • "file_format": "pq"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "handle": {
    }
}

OAuth2

Obtain an OAuth2 token

Exchange client credentials, authorization codes, or refresh tokens for access tokens.

Authorizations:
BearerHttpAuthentication
Request Body schema: application/json
required
grant_type
required
string
client_id
required
string
client_secret
required
string <password>

Responses

Request samples

Content type
application/json
Example
{
  • "grant_type": "client_credentials",
  • "client_id": "string",
  • "client_secret": "pa$$word"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "bearer",
  • "expires_in": 0,
  • "refresh_token": "pa$$word"
}