Anything Databases API
The Databases API from Anything — 5 operation(s) for databases.
The Databases API from Anything — 5 operation(s) for databases.
openapi: 3.1.0
info:
title: Anything Assets Databases API
version: 0.1.0
description: The Anything API is the fastest way for agents to build and launch mobile and web apps.
servers:
- url: /
tags:
- name: Databases
paths:
/v0/api/databases:
get:
summary: List accessible databases
description: Returns databases in an organization that the authenticated user can access.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: organizationId
in: query
- schema:
type: integer
exclusiveMinimum: 0
maximum: 100
required: false
name: limit
in: query
responses:
'200':
description: Databases list
content:
application/json:
schema:
type: object
properties:
databases:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
status:
type: string
enum:
- CREATING
- COMPLETED
- FAILED
organizationId:
type: string
format: uuid
organizationName:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
pointInTimeRestoreEnabled:
type: boolean
required:
- id
- name
- status
- organizationId
- organizationName
- createdAt
- updatedAt
- pointInTimeRestoreEnabled
required:
- databases
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Not found — the referenced resource does not exist (including malformed resource IDs)
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
post:
summary: Create a database
description: Creates a new user database. The database is provisioned asynchronously — poll GET /databases/{databaseId} until the status leaves CREATING.
tags:
- Databases
security:
- basicAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
organizationId:
type: string
format: uuid
projectGroupId:
type:
- string
- 'null'
format: uuid
name:
type:
- string
- 'null'
required:
- organizationId
responses:
'201':
description: Database creation started
content:
application/json:
schema:
type: object
properties:
database:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
status:
type: string
enum:
- CREATING
- COMPLETED
- FAILED
organizationId:
type: string
format: uuid
organizationName:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
pointInTimeRestoreEnabled:
type: boolean
required:
- id
- name
- status
- organizationId
- organizationName
- createdAt
- updatedAt
- pointInTimeRestoreEnabled
required:
- database
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Not found — the referenced resource does not exist (including malformed resource IDs)
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
/v0/api/databases/{databaseId}:
get:
summary: Get a single database
description: Returns details for a specific user database.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: databaseId
in: path
responses:
'200':
description: Database details
content:
application/json:
schema:
type: object
properties:
database:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
status:
type: string
enum:
- CREATING
- COMPLETED
- FAILED
organizationId:
type: string
format: uuid
organizationName:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
pointInTimeRestoreEnabled:
type: boolean
required:
- id
- name
- status
- organizationId
- organizationName
- createdAt
- updatedAt
- pointInTimeRestoreEnabled
required:
- database
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Database not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
delete:
summary: Delete a database
description: Soft-deletes a user database and schedules permanent removal of the underlying infrastructure after a 30-day grace period.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: databaseId
in: path
responses:
'204':
description: Database deleted
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Database not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
/v0/api/databases/{databaseId}/query:
post:
summary: Query a database
description: Executes a read-only SQL query against the database. Only SELECT, WITH, EXPLAIN, and SHOW statements are allowed.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: databaseId
in: path
requestBody:
content:
application/json:
schema:
type: object
properties:
sql:
type: string
minLength: 1
required:
- sql
responses:
'200':
description: Query results
content:
application/json:
schema:
type: object
properties:
columns:
type: array
items:
type: string
rows:
type: array
items:
type: array
items: {}
rowCount:
type: number
required:
- columns
- rows
- rowCount
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Database not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
/v0/api/databases/{databaseId}/connection:
get:
summary: Get database connection string
description: Returns the connection string for a user database.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: databaseId
in: path
responses:
'200':
description: Connection string
content:
application/json:
schema:
type: object
properties:
connectionString:
type: string
required:
- connectionString
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Database not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
/v0/api/databases/{databaseId}/reset:
post:
summary: Reset development database
description: Resets the development branch of a user database.
tags:
- Databases
security:
- basicAuth: []
parameters:
- schema:
type: string
format: uuid
required: true
name: databaseId
in: path
responses:
'204':
description: Database reset
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
'404':
description: Database not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
details:
type: array
items: {}
message:
type: string
required:
- error
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
description: 'Use your Anything API key as the Basic auth username and leave the password empty. Example credentials: anything_xxx:'