Carta Permissions API (2.0.0)

Download OpenAPI specification:

health

Health check

Responses

Response samples

Content type
application/json
{
  • "ok": true
}

v2/auth

Get Cognito user pool connection info

Responses

Response samples

Content type
application/json
{
  • "region": "string",
  • "userPoolId": "string",
  • "userPoolWebClientId": "string"
}

Get Cognito password policy

Responses

Response samples

Content type
application/json
{
  • "minimumLength": 0,
  • "requireLowercase": true,
  • "requireUppercase": true,
  • "requireNumbers": true,
  • "requireSymbols": true
}

v2/apitoken

Create an API token for a node

Generates a new API token scoped to the specified node. The caller must have owner permission on the node. Use self as nodeId to create a token for the authenticated user's own node.

Authorizations:
bearerAuth
path Parameters
nodeId
required
string

Resource UUID, or self for the authenticated user's node

Request Body schema: application/json
required
name
required
string^[A-Za-z0-9\-._~]+$

Human-readable label for the token, unique per node. Must contain only URL-safe characters: A-Z a-z 0-9 - . _ ~ (RFC 3986 unreserved).

allowedEndpoints
required
Array of strings[ items^(ANY|[A-Z]+(\|[A-Z]+)*) /.*$ ]

Endpoint patterns this token is permitted to access. Each entry must be METHOD /path, where METHOD is one or more uppercase HTTP methods separated by | (e.g. GET, POST|PUT), or ANY to match all methods. The path supports * (exactly one segment) and ** (zero or more segments). Path matching is case-insensitive; trailing slashes are ignored.

expires
string <date-time>

Optional expiry timestamp. Omit for a non-expiring token.

uses
integer >= 0

Optional maximum use count. Omit for unlimited uses.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "allowedEndpoints": [
    ],
  • "expires": "2019-08-24T14:15:22Z",
  • "uses": 0
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "token": "string",
  • "allowedEndpoints": [
    ],
  • "expires": "2019-08-24T14:15:22Z",
  • "uses": 0,
  • "revoked": true,
  • "autoRemove": true,
  • "lastUsed": "2019-08-24T14:15:22Z"
}

List API tokens for a node

Returns all tokens belonging to the specified node. Token keys are partially obfuscated. The caller must have owner permission on the node. Use self as nodeId to list tokens for the authenticated user's own node.

Authorizations:
bearerAuth
path Parameters
nodeId
required
string

Resource UUID, or self for the authenticated user's node

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Delete an API token by name

Deletes the named token from the specified node. The caller must have owner permission on the node. Use self as nodeId to target the authenticated user's own node.

Authorizations:
bearerAuth
path Parameters
nodeId
required
string

Resource UUID, or self for the authenticated user's node

tokenName
required
string

Responses

Revoke an API token by name

Revokes the named token. If the token was created with autoRemove: true it is deleted from the database; otherwise it is marked as revoked and remains visible in list responses with revoked: true. A revoked token is rejected immediately on use regardless of remaining uses or expiry. The caller must have owner permission on the node. Use self as nodeId to target the authenticated user's own node.

Authorizations:
bearerAuth
path Parameters
nodeId
required
string

Resource UUID, or self for the authenticated user's node

tokenName
required
string

Responses

v2/permissions

Check path permissions from one resource to another

Returns the effective permission flags that fromResource has over toResource, resolved through the full permission path. Use self as fromResource to check the authenticated user's permissions.

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

toResource
required
string

Destination resource UUID

Responses

Response samples

Content type
application/json
{
  • "execute": true,
  • "write": true,
  • "read": true,
  • "admin": true,
  • "owner": true
}

Set permissions between two resources

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

toResource
required
string

Destination resource UUID

Request Body schema: application/json
required
object (PermissionFlags)
object (PermissionFlags)
object (PermissionFlags)

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "private": {
    },
  • "shared": {
    }
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "private": {
    },
  • "shared": {
    }
}

Remove permissions between two resources

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

toResource
required
string

Destination resource UUID

Responses

Check direct permissions (not path-resolved)

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

toResource
required
string

Destination resource UUID

Responses

Response samples

Content type
application/json
{
  • "user": {
    },
  • "private": {
    },
  • "shared": {
    }
}

List labels accessible from a given resource

Returns the distinct set of user-defined labels present on all nodes reachable from fromResource via permission edges. The caller must have at least shared access to fromResource. Use self as fromResource to query from the authenticated user's own node.

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

Responses

Response samples

Content type
[
  • "string"
]

List resources accessible from a given resource

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

label
required
string

Label/type filter for accessible resources

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List accessors with permissions over a given resource

Authorizations:
bearerAuth
path Parameters
fromResource
required
string

Resource UUID, or self for the authenticated user

label
required
string

Label/type filter for accessor nodes

Responses

Response samples

Content type
application/json
[
  • {
    }
]

v2/resources

Create a generic resource

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
labels
required
Array of strings
object

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "labels": [
    ],
  • "props": { }
}

Get a resource by ID

Authorizations:
bearerAuth
path Parameters
resourceId
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "labels": [
    ],
  • "props": { }
}

Update a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string
Request Body schema: application/json
required
name
string
object

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "labels": [
    ],
  • "props": { }
}

Delete a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string

Responses

auth

Get Cognito auth configuration

Responses

Response samples

Content type
application/json
{
  • "region": "string",
  • "userPoolId": "string",
  • "userPoolWebClientId": "string"
}

Get password policy

Responses

Response samples

Content type
application/json
{
  • "minimumLength": 0,
  • "requireLowercase": true,
  • "requireUppercase": true,
  • "requireNumbers": true,
  • "requireSymbols": true
}

permissions

List all resource types

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • "Service",
  • "Namespace",
  • "Project",
  • "Connection",
  • "File"
]

List resources of a given type accessible by the caller

Authorizations:
bearerAuth
path Parameters
resourceType
required
string
Enum: "service" "namespace" "project" "connection" "file"
query Parameters
userId
string

Check accessibility for a specific user instead of the caller

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a specific resource by type and ID

Authorizations:
bearerAuth
path Parameters
resourceType
required
string
Enum: "service" "namespace" "project" "connection" "file"
resourceId
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone"
}

Get the authenticated user's permission to a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string

Responses

Response samples

Content type
application/json
"Admin, Write, Read, Execute, Clone"

Get a specific user's permission to a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string
userId
required
string

Responses

Response samples

Content type
application/json
"Admin, Write, Read, Execute, Clone"

Set a user's permission on a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string
userId
required
string
query Parameters
role
required
string
Enum: "guest" "user" "editor" "owner"
userType
required
string

Responses

Response samples

Content type
application/json
"Admin, Write, Read, Execute, Clone"

Remove a user's permission on a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string
userId
required
string
query Parameters
userType
required
string

Responses

Response samples

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

List users with access to a resource

Authorizations:
bearerAuth
path Parameters
resourceId
required
string
query Parameters
userType
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

project

Create a project

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
bucketName
string

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string",
  • "bucketName": "string"
}

Delete a project

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Create a connection for a project

Authorizations:
bearerAuth
path Parameters
projectId
required
string
Request Body schema: application/json
required
name
required
string
backend
required
string
keyPath
string
required
object (NativeId)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "backend": "string",
  • "keyPath": "string",
  • "nativeId": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string",
  • "backend": "string",
  • "keyPath": "string",
  • "nativeId": {
    }
}

Delete a connection

Authorizations:
bearerAuth
path Parameters
connectionId
required
string

Responses

service

Create (reserve) a namespace

Authorizations:
bearerAuth
path Parameters
namespace
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string"
}

Remove a namespace

Authorizations:
bearerAuth
path Parameters
namespace
required
string

Responses

Remove a service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string

Responses

Register a service under a namespace

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
query Parameters
baseUrl
required
string <uri>

Base URL the service is reachable at

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string",
  • "baseUrl": "http://example.com"
}

Get namespace details

Authorizations:
bearerAuth
path Parameters
namespace
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string"
}

Get service details

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string",
  • "baseUrl": "http://example.com"
}

Rename a namespace

Authorizations:
bearerAuth
path Parameters
namespace
required
string
newNamespace
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string"
}

Rename a service within a namespace

Authorizations:
bearerAuth
path Parameters
namespace
required
string
oldService
required
string
newService
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone",
  • "name": "string",
  • "baseUrl": "http://example.com"
}

Proxy — GET request to a registered service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
routeParams
required
string

Path to forward to the registered service

Responses

Proxy — POST request to a registered service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
routeParams
required
string

Path to forward to the registered service

Responses

Proxy — PUT request to a registered service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
routeParams
required
string

Path to forward to the registered service

Responses

Proxy — DELETE request to a registered service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
routeParams
required
string

Path to forward to the registered service

Responses

Proxy — PATCH request to a registered service

Authorizations:
bearerAuth
path Parameters
namespace
required
string
service
required
string
routeParams
required
string

Path to forward to the registered service

Responses

user

Get the authenticated user's profile

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "email": "user@example.com",
  • "firstName": "string",
  • "lastName": "string",
  • "organization": "string",
  • "groups": [
    ]
}

Create a new user

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
email
required
string <email>
organization
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "user@example.com",
  • "organization": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "email": "user@example.com",
  • "firstName": "string",
  • "lastName": "string",
  • "organization": "string",
  • "groups": [
    ]
}

Check whether the request is authenticated

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
true

Search users by attribute

Authorizations:
bearerAuth
query Parameters
attributeName
required
string
attributeValue
required
string
attributeFilter
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List members of a group

Authorizations:
bearerAuth
path Parameters
groupname
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a group

Authorizations:
bearerAuth
path Parameters
groupname
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone"
}

Add a member to a group

Authorizations:
bearerAuth
path Parameters
groupname
required
string
username
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "permission": "Admin, Write, Read, Execute, Clone"
}

files

List available file sources

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • "Carta"
]

Get capabilities for a file source

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"

Responses

Response samples

Content type
application/json
[
  • "containers",
  • "fileUpdate",
  • "fullFileList"
]

List files or containers.

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"
query Parameters
path
string
containerId
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload a file

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"
query Parameters
containerId
string
Request Body schema: multipart/form-data
required
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "path": "string",
  • "name": "string",
  • "source": "Carta",
  • "type": "File",
  • "owner": "string"
}

Download a file

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"
fileId
required
string

Responses

Update a file's contents

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"
fileId
required
string
Request Body schema: multipart/form-data
required
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "path": "string",
  • "name": "string",
  • "source": "Carta",
  • "type": "File",
  • "owner": "string"
}

Delete a file

Authorizations:
bearerAuth
path Parameters
source
required
string
Value: "Carta"
fileId
required
string

Responses

secret

Retrieve a user secret

Authorizations:
bearerAuth
query Parameters
name
required
string

Name of the secret to retrieve

Responses

Response samples

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

Store a user secret

The secret name is taken from the request header key prefixed with secret- (e.g. secret-mytoken), and the secret value is the corresponding header value. Secrets are scoped per user and overwrite any existing secret with the same name.

Authorizations:
bearerAuth
header Parameters
secret-{name}
required
string

A header whose key starts with secret- followed by the secret name, and whose value is the secret to store (e.g. secret-mytoken: abc123).

Responses

Response samples

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