Download OpenAPI specification:Download
FeatureBase Cloud allows you to launch FeatureBase clusters as a managed service in the cloud.
Please refer to SQL documentation https://docs.featurebase.com/docs/sql-guide/sql-guide-home/
Customers can use REST APIs to perform CRUDL (Create/Read/Update/Delete/List) operations on their cloud resources. Every resource belongs to an organization. Each API resource type can be managed via a dedicated API endpoint. Resource types include:
All API errors include a JSON body with a human-readable message and a machine-readable error code designed for programmatic parsing. For example:
HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 469
{
"code": "InvalidParameter",
"message": "The value for 'count' has to be greater than 0."
}
The following table describes the most common error types and their usage:
HTTP Response Status Code | Error Code | Example Message | Client Retry Behavior |
---|---|---|---|
400 | InvalidParameter | Parameter ‘count’ cannot be empty | No |
400 | MissingParameter | Missing required parameter ‘count’ | No |
400 | InvalidBody | The request body is incorrectly formatted | No |
400 | InvalidContentType | The specified content-type is not supported. | No |
400 | ResourceLimitExceeded | The limit for number of databases has been exceeded. | No |
400 | ResourceThroughputExceeded | The provisioned resource capacity was exceeded. | Retry with backoff |
400 | RelatedResourceNotFound | Message should include which (non-URI) resources were not found. | No |
400 | Bad Request | Message includes the SQL3 error response. | No |
401 | Unauthorized | Authorization failed | No |
401 | MissingAuthenticationToken | Missing request authentication token | No |
404 | ResourceNotFound | Resource not found. | No |
408 | RequestTimeout | The client cancelled the request or failed to send a full request. | Yes |
409 | ResourceAlreadyExists | Requested resource already exists. | No |
409 | IncorrectState | The referenced resource is not ready to process requests. | Retry with backoff |
413 | PayloadTooLarge | The size of the request payload exceeds the maximum size permitted. | No |
422 | QueryExecutionError | There was an error executing query | No |
429 | RequestLimitExceeded | API rate limit exceeded. | Retry with backoff |
500 | InternalServerError | Unexpected error | Retry with backoff |
The following table describes each database state:
Database Status | Definition | Can query data |
---|---|---|
CREATING | FeatureBase Cloud has received the signal to start provisioning a database. | No |
PROVISIONING | A database is being created. | No |
RUNNING | Database is running normally. Users may run queries. | Yes |
RESTORING | Restoring data from a backup. | No |
BACKUP | Creating a backup of the database. | No |
DELETING | FeatureBase Cloud has received the signal to start deprovisioning a database. | No |
DEPROVISIONING | Database is being deprovisioned (deleted). | No |
DELETED | Deprovision completed successfully. | No |
FAILED | Unrecoverable. Data is lost or Database failed to be provisioned. | No |
FROZEN | There was a problem with backup and no new operations can be done on the database. | No |
Databases embody FeatureBase clusters launched as a managed service in the FeatureBase Cloud. For table creation in a database please refer to https://docs.featurebase.com/docs/sql-guide/statements/statement-table-create-show/
Create a FeatureBase Cloud DataBase.
Created
Bad Request
Unauthorized
{- "name": "example-database",
- "database_options": {
- "shape": "8GB-Development"
}
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "example-database",
- "database_status": "RUNNING",
- "database_options": {
- "shape": "8GB-Development"
}, - "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "owned_by": "b54c13ac-3977-4e54-bbfa-b33713ac1540",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
curl --location --request GET 'https://api.featurebase.com/v2/databases' \ --header 'Authorization: Bearer <token>'
{- "next": "",
- "resources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "example-database",
- "database_status": "RUNNING",
- "database_options": {
- "shape": "8GB-Development"
}, - "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "owned_by": "b54c13ac-3977-4e54-bbfa-b33713ac1540",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
]
}
Return information about the specified database.
Success
Unauthorized
Not Found
curl --location --request GET 'https://api.featurebase.com/v2/databases/{database_id}' \ --header 'Authorization: Bearer <token>'
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "example-database",
- "database_status": "RUNNING",
- "database_options": {
- "shape": "8GB-Development"
}, - "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "owned_by": "b54c13ac-3977-4e54-bbfa-b33713ac1540",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Update information about the specified database.
Success
Unauthorized
Not Found
{- "name": "example-database",
- "owned_by": "b54c13ac-3977-4e54-bbfa-b33713ac1540"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "example-database",
- "database_status": "RUNNING",
- "database_options": {
- "shape": "8GB-Development"
}, - "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "owned_by": "b54c13ac-3977-4e54-bbfa-b33713ac1540",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Deletes the specified database.
Accepted
Unauthorized
Not Found
curl --location --request DELETE 'https://api.featurebase.com/v2/databases/{database_id}' \ --header 'Authorization: Bearer <token>'
{- "code": "Unauthorized",
- "message": "User is not authorized to perform this operation."
}
Execute a query against an existing database. Note that you must use the server https://query.featurebase.com/v2
for all query requests.
Success
Bad Request
Unauthorized
Not Found
Internal Server Error
select count(*) from test-table
{- "schema": {
- "fields": [
- {
- "name": "id",
- "type": "int",
- "base-type": "int",
- "type-info": null
}
], - "data": [
- "1"
], - "exec_time": 71
}
}
Execute a query against an existing database. Note that you must use the server https://query.featurebase.com/v2
for all query requests.
Success
Bad Request
Unauthorized
Not Found
{- "statement": "Count(Intersect(Row(hobbies=\"Teaching\"),Distinct(Row(bools='available_for_hire'), field= id, index=skills)))",
- "table": "cseg"
}
{- "results": [
- 89
]
}
Invite an user to the organization. Only Org Owner can use this API.
Created
Bad Request
Unauthorized
{- "email": "example-email@abc.com"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "email": "example-email@abc.com",
- "accepted": false,
- "move_org": false,
- "created_at": "2019-08-24T14:15:22Z",
- "date_expiry": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Lists all invites in the org. Only Org Owner can use this API.
Success
Unauthorized
curl --location --request GET 'https://api.featurebase.com/v2/invites' \ --header 'Authorization: Bearer <token>'
{- "next": "",
- "resources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "email": "example-email@abc.com",
- "accepted": false,
- "move_org": false,
- "created_at": "2019-08-24T14:15:22Z",
- "date_expiry": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
]
}
Return information about the specified invite. Only Org Owner can use this API.
Success
Unauthorized
Not Found
curl --location --request GET 'https://api.featurebase.com/v2/invites/{inviteId}' \ --header 'Authorization: Bearer <token>'
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "email": "example-email@abc.com",
- "accepted": false,
- "move_org": false,
- "created_at": "2019-08-24T14:15:22Z",
- "date_expiry": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Update information about the specified invite. Only Org Owner can use this API.
Success
Bad Request
Unauthorized
Not Found
{- "accepted": true
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "email": "example-email@abc.com",
- "accepted": false,
- "move_org": false,
- "created_at": "2019-08-24T14:15:22Z",
- "date_expiry": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Create an user in the organization.
Created
Bad Request
Unauthorized
{- "firstname": "example-firstname",
- "lastname": "example-lastname"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
curl --location --request GET 'https://api.featurebase.com/v2/users' \ --header 'Authorization: Bearer <token>'
{- "next": "",
- "resources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
]
}
Get information about current user in the org.
Success
Unauthorized
curl --location --request GET 'https://api.featurebase.com/v2/users/current' \ --header 'Authorization: Bearer <token>'
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Update an user in the organization.
Accepted
Unauthorized
Not Found
{- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "acl": [
- "MANAGE_ORG:*"
], - "status": "Active"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Get the information about user with id.
Success
Unauthorized
Not Found
curl --location --request GET 'https://api.featurebase.com/v2/users/{id}' \ --header 'Authorization: Bearer <token>'
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Add roles to the user with id. Only user with Org_Owner role can update other users roles in the org.
Created
Unauthorized
Not Found
{- "rolenames": [
- "Org Owner"
]
}
{- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "rolenames": [
- "Org Owner"
]
}
This endpoint is used to move user from one org to the other.
Accepted
Bad Request
Unauthorized
Conflict
{- "invite_id": "2818c738-8b76-408a-9294-ea9d0ab5d105"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "org_name": "Organization for example-org@abc.com",
- "idp_id": "03d5d6f7-e2a3-4a79-8306-b71262b7b42e",
- "username": "example-email@abc.com",
- "firstname": "example-firstname",
- "lastname": "example-lastname",
- "status": "Active",
- "acl": [
- "MANAGE_ORG:*"
], - "roles": [
- "Org Owner"
], - "primary_email": "example-email@abc.com",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Return information about the specified org. Users can only check information about the org to which they belong.
Success
Unauthorized
curl --location --request GET 'https://api.featurebase.com/v2/orgs/{id}' \ --header 'Authorization: Bearer <token>'
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Organization for example-user@abc.com",
- "company_name": "FeatureBase",
- "address": "test-address",
- "tech_contact_emali": "example-user@abc.com",
- "billing_contact_emali": "example-user@abc.com",
- "org_type": "trial",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Update information about the specified org.
Success
Unauthorized
{- "name": "Organization for example-user@abc.com",
- "company_name": "FeatureBase",
- "address": "test-address",
- "tech_contact_emali": "example-user@abc.com",
- "billing_contact_emali": "example-user@abc.com"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Organization for example-user@abc.com",
- "company_name": "FeatureBase",
- "address": "test-address",
- "tech_contact_emali": "example-user@abc.com",
- "billing_contact_emali": "example-user@abc.com",
- "org_type": "trial",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"
}
Get information about service properties of the org.
Success
Unauthorized
Not Found
curl --location --request GET 'https://api.featurebase.com/v2/service-properties/{property}' \ --header 'Authorization: Bearer <token>'
{- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "property": "database:shapes",
- "value": [
- {
- "shapes": [
- {
- "8GB-Development": {
- "arm64": {
- "node_count": 1,
- "replica_factor": 1,
- "memory": 8,
- "instance_type": "t4g.large",
- "volume_size": 32,
- "volume_iops": 3000,
- "volume_throughput": 125,
- "hourly_rate": 0.35
}
}
}
]
}
]
}
Create a role in the org. Only user with ORG OWNER permission can use this endpoint.
Created
Bad Request
Unauthorized
Conflict
{- "rolename": "example-rolename",
- "acl": [
- "test-permission1",
- "test-permission2"
]
}
{- "rolename": "example-rolename",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "acl": [
- "test-permission1",
- "test-permission2"
]
}
Lists all roles in the org. Only user with ORG OWNER permission can use this endpoint.
Success
Unauthorized
curl --location --request GET 'https://api.featurebase.com/v2/roles' \ --header 'Authorization: Bearer <token>'
{- "next": "",
- "resources": [
- {
- "rolename": "example-rolename",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "acl": [
- "test-permission1",
- "test-permission2"
]
}
]
}
Return information about the specified role. Only user with ORG OWNER permission can use this endpoint.
Success
Unauthorized
Not Found
curl --location --request GET 'https://api.featurebase.com/v2/roles/{roleName}' \ --header 'Authorization: Bearer <token>'
{- "rolename": "example-rolename",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "acl": [
- "test-permission1",
- "test-permission2"
]
}
Update information about the specified role. Only user with ORG OWNER permission can use this endpoint.
Accepted
Unauthorized
Not Found
{- "acl": [
- "test-permission1",
- "test-permission2"
]
}
{- "rolename": "example-rolename",
- "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
- "acl": [
- "test-permission1",
- "test-permission2"
]
}
Deletes the specified role. Only user with ORG OWNER permission can use this endpoint.
Accepted
Unauthorized
curl --location --request DELETE 'https://api.featurebase.com/v2/roles/{roleName}' \ --header 'Authorization: Bearer <token>'
{- "code": "InvalidParameter",
- "message": "Incorrect parameter value."
}