SerenAI

Pay Per Call Agentic Commerce

SerenAI API

Pay Per Call Agentic Commerce for public and private data

205 endpoints 28 categories Base URL: https://api.serendb.com

agent

Agent commerce and paid query execution

POST /auth/agent

POST /auth/agent

Register a new AI agent account.

This endpoint allows AI agents to self-register and receive an API key immediately.
Unlike the standard signup flow, agent registration:
- Does NOT require email verification
- Automatically creates a personal organization
- Returns an API key named "agent" for immediate use

**Important:** Save the `api_key` immediately - it is only shown once!

Operation: agent_register

Request Body (required)

AgentRegisterRequest
name: string — Optional custom display name for the agent. If not provided, a unique celestial-

Responses

201 Agent registered successfully
AgentRegisterDataResponse
data*: AgentRegisterResponse
400 Invalid request (validation error)
500 Internal server error

Projects

Project management endpoints

GET /projects

List all projects for the authenticated user's organization

Operation: list_projects

Parameters

NameInTypeRequiredDescription
limit query integer No Maximum number of items to return (default: 20, max: 100)
offset query integer No Number of items to skip (default: 0)
show_service query boolean No Show the organization service project (`seren-services`) in the results.

Responses

200 List of projects
PaginatedProjectResponse
data*: array — The items in this page
pagination*: PaginationMeta
401 Unauthorized
POST /projects

Create a new project

Operation: create_project

Request Body (required)

CreateProjectRequest
block_public_connections: boolean
block_vpc_connections: boolean
compute_unit_max: integer
compute_unit_min: integer
enable_logical_replication: boolean — Enable logical replication for this project. Sets wal_level=logical for all comp
hipaa: boolean
name*: string
protected_branches_only: boolean
region*: string

Responses

201 Project created successfully
ProjectCreatedResponse
data*: ProjectCreated
pagination: any
401 Unauthorized
GET /projects/{project_id}

Get a specific project by ID

Operation: get_project

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Project details
ProjectResponse
data*: Project
pagination: any
401 Unauthorized
404 Project not found
DELETE /projects/{project_id}

Delete a project

Operation: delete_project

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Project deleted successfully
400 Cannot delete project with existing branches
401 Unauthorized
404 Project not found
PATCH /projects/{project_id}

Update a project

Operation: update_project

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

UpdateProjectRequest
block_public_connections: boolean
block_vpc_connections: boolean
compute_unit_max: integer
compute_unit_min: integer
enable_logical_replication: boolean — Enable logical replication for this project. Sets wal_level=logical for all comp
hipaa: boolean
history_retention_seconds: integer — History retention period in seconds for point-in-time recovery (PITR). Determine
name: string
protected_branches_only: boolean

Responses

200 Project updated successfully
ProjectResponse
data*: Project
pagination: any
401 Unauthorized
404 Project not found
GET /projects/{project_id}/connection_uri

Retrieve a connection URI for the project control plane endpoint

Operation: get_project_connection_uri

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id query string No Branch ID to target (defaults to project's default branch)
endpoint_id query string No Endpoint ID to target (defaults to first endpoint in branch)
database_name query string No Database name override (currently ignored)
role_name query string No Role name override (currently ignored)
pooled query boolean No Return pooled connection (currently ignored)

Responses

200 Connection URI retrieved
ProjectConnectionUriResponse
uri*: string
401 Unauthorized
404 Project, branch, or endpoint not found
GET /projects/{project_id}/size

Get project storage size

Operation: get_project_size

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Storage size retrieved successfully
ProjectSizeResponse
data*: ProjectSize
pagination: any
401 Unauthorized
404 Project not found

Branches

Branch management endpoints

GET /projects/{project_id}/branches

List all branches for a project

Operation: list_branches

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of branches
BranchesResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
POST /projects/{project_id}/branches

Create a new branch for a project

Operation: create_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

CreateBranchRequest
add_endpoint: boolean — Whether to automatically create an endpoint for this branch. Defaults to true. S
archived: boolean
endpoints: array
expires_at: string — Optional expiration timestamp for auto-deletion of this branch. Useful for tempo
init_source: string
name*: string
parent_branch_id: string
parent_lsn: string
parent_timestamp: string
protected: boolean
... and 1 more properties

Responses

201 Branch created successfully
BranchCreationResultResponse
data*: BranchCreationResult
pagination: any
401 Unauthorized
404 Project not found
GET /projects/{project_id}/branches/count

Get branch count for a project

Operation: get_branch_count

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Branch count retrieved successfully
401 Unauthorized
404 Project not found
GET /projects/{project_id}/branches/{branch_id}

Get a specific branch by ID

Operation: get_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Branch details
BranchResponse
data*: Branch
pagination: any
401 Unauthorized
404 Branch not found
DELETE /projects/{project_id}/branches/{branch_id}

Delete a branch

Operation: delete_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Branch deleted successfully
400 Cannot delete branch with existing endpoints
401 Unauthorized
404 Branch not found
PATCH /projects/{project_id}/branches/{branch_id}

Rename a branch

Operation: rename_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

RenameBranchRequest
name*: string

Responses

200 Branch renamed successfully
BranchResponse
data*: Branch
pagination: any
401 Unauthorized
404 Branch not found
PATCH /projects/{project_id}/branches/{branch_id}/archived

Set branch archived status

Archives or unarchives a branch. Archived branches are hidden from default listings
and may have reduced storage costs. Archiving a branch does not delete it.

Operation: set_branch_archived

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

SetBranchArchivedRequest
archived*: boolean

Responses

200 Branch archived status updated successfully
400 Cannot archive the default branch
401 Unauthorized
404 Branch not found
GET /projects/{project_id}/branches/{branch_id}/connection-string

Get connection string for a branch

This endpoint prefers SerenDB proxy-based connection strings when proxy
configuration is available. It falls back to direct compute connection
strings only when the proxy is not configured. Clients cannot disable
proxy usage via this API.

Operation: get_connection_string

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
pooled query boolean No Return pooled connection (default: false)
role query string No PostgreSQL role/username to use (default: serendb_owner)

Responses

200 Connection string retrieved
ConnectionStringResponse
data*: ConnectionString
pagination: any
401 Unauthorized
404 Branch or endpoint not found
GET /projects/{project_id}/branches/{branch_id}/details

Get detailed branch information including LSN and disk usage

Operation: get_branch_details

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Branch details retrieved successfully
BranchDetailResponse
data*: BranchDetail
pagination: any
401 Unauthorized
404 Branch not found
PATCH /projects/{project_id}/branches/{branch_id}/expiration

Set branch expiration

Operation: set_branch_expiration

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

SetBranchExpirationRequest
expires_at: string

Responses

200 Branch expiration set successfully
401 Unauthorized
404 Branch not found
GET /projects/{project_id}/branches/{branch_id}/lsn_by_timestamp

Get LSN for a specific timestamp on a branch

Operation: get_lsn_by_timestamp

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
timestamp query string Yes ISO 8601 timestamp (e.g., 2024-05-06T10:00:00.000Z)

Responses

200 LSN retrieved successfully
LsnByTimestampResponse
data*: LsnByTimestamp
pagination: any
401 Unauthorized
404 Branch not found
POST /projects/{project_id}/branches/{branch_id}/reset

Reset a branch to its parent's latest state

Operation: reset_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID to reset

Request Body (required)

ResetBranchRequest
parent*: boolean — Whether to reset to parent (currently the only supported option)

Responses

200 Branch reset successfully
BranchResponse
data*: Branch
pagination: any
401 Unauthorized
404 Branch not found
501 Not implemented - requires SerenDB WAL integration
POST /projects/{project_id}/branches/{branch_id}/restore

Restore a branch to a point in time

Operation: restore_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID to restore

Request Body (required)

RestoreBranchRequest
preserve_under_name*: string — Name for the backup branch that will preserve the current state
source*: RestoreSource

Responses

200 Branch restored successfully
BranchRestoredResponse
data*: BranchRestored
pagination: any
401 Unauthorized
404 Branch not found
501 Not implemented - requires SerenDB WAL integration
POST /projects/{project_id}/branches/{branch_id}/set-default

Set a branch as the default branch for its project

Operation: set_default_branch

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Default branch set successfully
401 Unauthorized
404 Branch not found
POST /projects/{project_id}/branches/{branch_id}/set_as_default

Alias endpoint for setting branch as default using snake_case path

Operation: set_default_branch_alias

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Default branch set successfully
401 Unauthorized
404 Branch not found
GET /projects/{project_id}/branches/{branch_id}/timestamp_by_lsn

Get timestamp for a specific LSN on a branch

Operation: get_timestamp_by_lsn

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
lsn query string Yes Log Sequence Number (e.g., 0/1234567)

Responses

200 Timestamp retrieved successfully
TimestampByLsnResponse
data*: TimestampByLsn
pagination: any
401 Unauthorized
404 Branch not found

Endpoints

Compute endpoint management

GET /projects/{project_id}/branches/{branch_id}/endpoints

List all endpoints for a branch

Operation: list_endpoints

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 List of endpoints
EndpointsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
POST /projects/{project_id}/branches/{branch_id}/endpoints

Create a new endpoint (compute instance) for a branch

Operation: create_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreateEndpointRequest
autoscaling_max: integer
autoscaling_min: integer
compute_unit: string
endpoint_type: EndpointType
name: string — Optional name for the endpoint. If not provided, a name will be auto-generated.
pooler_enabled: boolean
pooler_mode: PoolerMode
suspend_timeout_seconds: integer

Responses

201 Endpoint created successfully
EndpointCreatedResponse
data*: EndpointCreated
pagination: any
401 Unauthorized
404 Project or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}

Delete an endpoint

Operation: delete_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint deleted successfully
401 Unauthorized
404 Endpoint not found
PATCH /projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}

Update an endpoint

Operation: update_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
endpoint_id path string Yes Endpoint ID

Request Body (required)

UpdateEndpointRequest
autoscaling_max: integer
autoscaling_min: integer
pooler_enabled: boolean
pooler_mode: any
suspend_timeout_seconds: integer

Responses

200 Endpoint updated successfully
EndpointResponse
data*: Endpoint
pagination: any
401 Unauthorized
404 Endpoint not found
POST /projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}/start

Operation: start_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint start initiated
EndpointStatusInfoResponse
data*: EndpointStatusInfo
pagination: any
400 Endpoint already running
401 Unauthorized
404 Endpoint not found
GET /projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}/status

Operation: get_endpoint_status

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint status
EndpointStatusInfoResponse
data*: EndpointStatusInfo
pagination: any
401 Unauthorized
404 Endpoint not found
POST /projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}/stop

Operation: stop_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint stopped successfully
401 Unauthorized
404 Endpoint not found
GET /projects/{project_id}/endpoints

List all endpoints for a project (across branches)

Operation: list_project_endpoints

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of endpoints
EndpointsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
DELETE /projects/{project_id}/endpoints/{endpoint_id}

Delete an endpoint by endpoint id within a project

Operation: delete_project_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint deleted successfully
401 Unauthorized
404 Endpoint not found
PATCH /projects/{project_id}/endpoints/{endpoint_id}

Update an endpoint by endpoint id within a project

Operation: update_project_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
endpoint_id path string Yes Endpoint ID

Request Body (required)

UpdateEndpointRequest
autoscaling_max: integer
autoscaling_min: integer
pooler_enabled: boolean
pooler_mode: any
suspend_timeout_seconds: integer

Responses

200 Endpoint updated successfully
EndpointResponse
data*: Endpoint
pagination: any
401 Unauthorized
404 Endpoint not found
POST /projects/{project_id}/endpoints/{endpoint_id}/restart

Restart an endpoint by endpoint id within a project

Operation: restart_project_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint restart initiated
EndpointStatusInfoResponse
data*: EndpointStatusInfo
pagination: any
401 Unauthorized
404 Endpoint not found
POST /projects/{project_id}/endpoints/{endpoint_id}/start

Start an endpoint by endpoint id within a project

Operation: start_project_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint start initiated
EndpointStatusInfoResponse
data*: EndpointStatusInfo
pagination: any
401 Unauthorized
404 Endpoint not found
POST /projects/{project_id}/endpoints/{endpoint_id}/suspend

Suspend an endpoint by endpoint id within a project

Operation: suspend_project_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
endpoint_id path string Yes Endpoint ID

Responses

200 Endpoint suspended
401 Unauthorized
404 Endpoint not found

Operations

Operation tracking endpoints

GET /projects/{project_id}/operations

List all operations for a project

Operation: list_operations

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of operations
OperationsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
GET /projects/{project_id}/operations/{operation_id}

Get a specific operation by ID

Operation: get_operation

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
operation_id path string Yes Operation ID

Responses

200 Operation details
OperationResponse
data*: Operation
pagination: any
401 Unauthorized
404 Project or operation not found

Databases

Database management endpoints

GET /databases

List all databases across all projects for the authenticated user

Returns all databases the user has access to, with project and branch context included.
This provides a single view of all databases without needing to query each project/branch separately.

Operation: list_all_databases

Responses

200 List of all databases with context
DatabasesWithContextResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
GET /projects/{project_id}/branches/{branch_id}/databases

List all databases for a branch

Operation: list_databases

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 List of databases
DatabasesWithOwnerResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Branch not found
POST /projects/{project_id}/branches/{branch_id}/databases

Create a new database within a branch

Operation: create_database

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreateDatabaseRequest
name*: string
owner_name: string

Responses

201 Database created successfully
DatabaseCreatedResponse
data*: DatabaseCreated
pagination: any
400 Bad request - database already exists or invalid parameters
401 Unauthorized
404 Branch not found
GET /projects/{project_id}/branches/{branch_id}/databases/{database_id}

Get a specific database by ID

Operation: get_database

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_id path string Yes Database ID

Responses

200 Database details
DatabaseWithOwnerResponse
data*: DatabaseWithOwner
pagination: any
401 Unauthorized
404 Database or branch not found
PUT /projects/{project_id}/branches/{branch_id}/databases/{database_id}

Update a database (currently only supports changing owner)

Operation: update_database

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_id path string Yes Database ID

Request Body (required)

UpdateDatabaseRequest
owner_name: string

Responses

200 Database updated successfully
DatabaseWithOwnerResponse
data*: DatabaseWithOwner
pagination: any
401 Unauthorized
404 Database or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/databases/{database_id}

Delete a database

Operation: delete_database

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_id path string Yes Database ID

Responses

200 Database deleted successfully
401 Unauthorized
404 Database or branch not found
GET /projects/{project_id}/branches/{branch_id}/databases/{database_name}

Get a specific database by name

Operation: get_database_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_name path string Yes Database name

Responses

200 Database details
DatabaseWithOwnerResponse
data*: DatabaseWithOwner
pagination: any
401 Unauthorized
404 Database or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/databases/{database_name}

Delete a database by name

Operation: delete_database_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_name path string Yes Database name

Responses

200 Database deleted successfully
401 Unauthorized
404 Database or branch not found
PATCH /projects/{project_id}/branches/{branch_id}/databases/{database_name}

Update a database by name (supports changing owner)

Operation: update_database_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
database_name path string Yes Database name

Request Body (required)

UpdateDatabaseRequest
owner_name: string

Responses

200 Database updated successfully
DatabaseWithOwnerResponse
data*: DatabaseWithOwner
pagination: any
401 Unauthorized
404 Database or branch not found
GET /projects/{project_id}/databases

List all databases across all branches for a specific project

Returns all databases in the project with branch context included.
This provides a single view of all databases in a project without needing to query each branch separately.

Operation: list_project_databases

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of all databases in project with context
DatabasesWithContextResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found

Roles

PostgreSQL role/user management endpoints

GET /projects/{project_id}/branches/{branch_id}/roles

List all roles for a branch

Operation: list_branch_roles

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 List of roles
RoleInfosResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Branch not found
POST /projects/{project_id}/branches/{branch_id}/roles

Create a new role within a branch

Operation: create_branch_role

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreateRoleRequest
description: string
name*: string
permissions*: array

Responses

201 Role created successfully
RoleCreatedResponse
data*: RoleCreated
pagination: any
400 Bad request - role already exists or invalid parameters
401 Unauthorized
404 Branch not found
DELETE /projects/{project_id}/branches/{branch_id}/roles/{role_id}

Delete a role

Operation: delete_branch_role

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_id path string Yes Role ID

Responses

200 Role deleted successfully
400 Cannot delete protected role
401 Unauthorized
404 Role or branch not found
POST /projects/{project_id}/branches/{branch_id}/roles/{role_id}/reset_password

Reset a role's password

Operation: reset_role_password

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_id path string Yes Role ID

Request Body (required)

ResetRolePasswordRequest
password*: string

Responses

200 Password reset successfully
RolePasswordResetResponse
data*: RolePasswordReset
pagination: any
401 Unauthorized
404 Role or branch not found
GET /projects/{project_id}/branches/{branch_id}/roles/{role_name}

Get a role by name

Operation: get_role_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_name path string Yes Role name

Responses

200 Role details
RoleInfoResponse
data*: RoleInfo
pagination: any
401 Unauthorized
404 Role or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/roles/{role_name}

Delete a role by name

Operation: delete_role_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_name path string Yes Role name

Responses

200 Role deleted successfully
400 Cannot delete protected role
401 Unauthorized
404 Role or branch not found
POST /projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password

Reset a role's password by name

Operation: reset_role_password_by_name

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_name path string Yes Role name

Request Body (required)

ResetRolePasswordRequest
password*: string

Responses

200 Password reset successfully
RolePasswordResetResponse
data*: RolePasswordReset
pagination: any
401 Unauthorized
404 Role or branch not found
GET /projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password

Reveal password for a role by name (SerenDB-compatible endpoint)

Operation: reveal_role_password

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
role_name path string Yes Role name

Responses

200 Role password revealed
RolePasswordResetResponse
data*: RolePasswordReset
pagination: any
401 Unauthorized
404 Role or branch not found

Auth

Authentication and user management endpoints

POST /auth/forgot-password

POST /auth/forgot-password

Request a password reset email

Operation: forgot_password

Request Body (required)

ForgotPasswordRequest
email*: Email

Responses

200 Password reset email sent if account exists
PasswordResetSentResponse
data*: PasswordResetSent
pagination: any
400 Invalid request
GET /auth/me

GET /auth/me

Get current authenticated user information with default organization

Operation: get_current_user

Responses

200 Current user information with default organization
UserMeResponse
data*: UserMe
pagination: any
401 Unauthorized
POST /auth/resend-verification

POST /auth/resend-verification

Resend email verification link

Operation: resend_verification_email

Request Body (required)

ResendVerificationRequest
email*: Email

Responses

200 Verification email sent if account exists
VerificationSentResponse
data*: VerificationSent
pagination: any
400 Invalid request
POST /auth/reset-password

POST /auth/reset-password

Reset password using a valid token

Operation: reset_password

Request Body (required)

ResetPasswordRequest
new_password*: string
token*: string

Responses

200 Password reset successfully
PasswordResetResponse
data*: PasswordReset
pagination: any
400 Invalid or expired token
404 Token not found
POST /auth/verify-email

POST /auth/verify-email

Verify email address using a token sent during signup
On success, automatically logs the user in and returns tokens

Operation: verify_email

Request Body (required)

VerifyEmailRequest
token*: string

Responses

200 Email verified and user logged in
LoginResultResponse
data*: LoginResult
pagination: any
400 Invalid or expired token
GET /organizations/default/api-keys

List API keys for the user's default organization

Operation: list_default_org_api_keys

Responses

200 List of API keys
ApiKeysResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
400 User has no organization
401 Unauthorized
POST /organizations/default/api-keys

Create a new API key for the user's default organization

This is a convenience endpoint that resolves "default" to the user's
first organization, avoiding an extra round-trip to /auth/me.

Operation: create_default_org_api_key

Request Body (required)

CreateApiKeyRequest
expires_in_days: integer
name*: string

Responses

201 API key created
ApiKeyCreatedResponse
data*: ApiKeyCreated
pagination: any
400 User has no organization
401 Unauthorized
DELETE /organizations/default/api-keys/{key_id}

Revoke an API key from the user's default organization

Operation: revoke_default_org_api_key

Parameters

NameInTypeRequiredDescription
key_id path string Yes API key ID

Responses

200 API key revoked
400 User has no organization
401 Unauthorized
404 API key not found
GET /organizations/{organization_id}/api-keys

List API keys for a specific organization

Operation: list_org_api_keys

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 List of API keys
ApiKeysResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Organization not found
POST /organizations/{organization_id}/api-keys

Create a new API key for a specific organization

Operation: create_org_api_key

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateApiKeyRequest
expires_in_days: integer
name*: string

Responses

201 API key created
ApiKeyCreatedResponse
data*: ApiKeyCreated
pagination: any
401 Unauthorized
404 Organization not found
DELETE /organizations/{organization_id}/api-keys/{key_id}

Revoke an organization API key

Operation: revoke_org_api_key

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
key_id path string Yes API key ID

Responses

200 API key revoked
401 Unauthorized
404 API key not found

OAuth

OAuth connections for BYOC integrations

GET /oauth/connections

List user's OAuth connections

Returns all OAuth providers the user has connected to.

Operation: list_connections

Responses

200 List of user's OAuth connections
ConnectionsResponse
connections*: array
DELETE /oauth/connections/providers/{provider_id}

Revoke an OAuth connection by provider ID (supports org-scoped providers)

Operation: revoke_connection_by_id

Parameters

NameInTypeRequiredDescription
provider_id path string Yes OAuth provider UUID to disconnect

Responses

200 Connection revoked successfully
RevokeResponse
message*: string
success*: boolean
404 Connection not found
DELETE /oauth/connections/{provider}

Revoke an OAuth connection

Disconnects the user's account from the OAuth provider and deletes stored tokens.

Operation: revoke_connection

Parameters

NameInTypeRequiredDescription
provider path string Yes OAuth provider slug to disconnect

Responses

200 Connection revoked successfully
RevokeResponse
message*: string
success*: boolean
404 Connection not found
GET /oauth/providers

List available OAuth providers

Returns all active OAuth providers that users can connect to,
including global providers and providers from organizations the user belongs to.

Operation: list_providers

Responses

200 List of available OAuth providers
ProvidersResponse
providers*: array
GET /oauth/providers/{provider_id}/authorize

Initiate OAuth authorization flow by provider ID (supports org-scoped providers)

Operation: initiate_oauth_by_id

Parameters

NameInTypeRequiredDescription
provider_id path string Yes OAuth provider UUID
redirect_uri query string No Where to redirect after OAuth completes

Responses

302 Redirect to OAuth provider
404 Provider not found
GET /oauth/providers/{provider_id}/callback

Handle OAuth callback by provider ID (supports org-scoped providers)

Operation: oauth_callback_by_id

Parameters

NameInTypeRequiredDescription
provider_id path string Yes OAuth provider UUID
code query string Yes Authorization code from provider
state query string Yes State parameter for CSRF verification

Responses

302 Redirect to frontend with success/error
400 Invalid callback parameters
404 Provider not found
GET /oauth/{provider}/authorize

Initiate OAuth authorization flow

Redirects the user to the OAuth provider's consent screen.
After authorization, the provider will redirect back to the callback URL.

Operation: initiate_oauth

Parameters

NameInTypeRequiredDescription
provider path string Yes OAuth provider slug (e.g., 'neon')
redirect_uri query string No Where to redirect after OAuth completes

Responses

302 Redirect to OAuth provider
404 Provider not found
GET /oauth/{provider}/callback

Handle OAuth callback

Called by the OAuth provider after the user authorizes.
Exchanges the authorization code for tokens and stores them.

Operation: oauth_callback

Parameters

NameInTypeRequiredDescription
provider path string Yes OAuth provider slug
code query string Yes Authorization code from provider
state query string Yes State parameter for CSRF verification

Responses

302 Redirect to frontend with success/error
400 Invalid callback parameters

oauth-providers

Organization OAuth provider configuration (BYOC)

GET /organizations/{organization_id}/oauth/providers

GET /organizations/{organization_id}/oauth/providers

List all OAuth providers for an organization.

Operation: list_org_oauth_providers

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 List of OAuth providers
OAuthProvidersDataResponse
data*: array
401 Unauthorized
403 Forbidden - not a member of the organization
500 Internal server error
POST /organizations/{organization_id}/oauth/providers

POST /organizations/{organization_id}/oauth/providers

Create a new OAuth provider for an organization.

Operation: create_org_oauth_provider

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateOAuthProviderRequest
authorization_url*: string
client_id*: string
client_secret*: string — Client secret (will be encrypted)
description: string
logo_url: string
name*: string
pkce_required: boolean
revocation_url: string
scopes*: array
slug*: string
... and 3 more properties

Responses

201 OAuth provider created
OAuthProviderDataResponse
data*: OAuthProviderResponse
400 Invalid request
401 Unauthorized
403 Forbidden - not a member of the organization
409 Conflict - provider with this slug already exists
500 Internal server error
GET /organizations/{organization_id}/oauth/providers/{provider_id}

GET /organizations/{organization_id}/oauth/providers/{provider_id}

Get a specific OAuth provider for an organization.

Operation: get_org_oauth_provider

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
provider_id path string Yes OAuth provider ID

Responses

200 OAuth provider details
OAuthProviderDataResponse
data*: OAuthProviderResponse
401 Unauthorized
403 Forbidden - not a member of the organization
404 Provider not found
500 Internal server error
DELETE /organizations/{organization_id}/oauth/providers/{provider_id}

DELETE /organizations/{organization_id}/oauth/providers/{provider_id}

Delete an OAuth provider for an organization.

Operation: delete_org_oauth_provider

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
provider_id path string Yes OAuth provider ID

Responses

204 OAuth provider deleted
401 Unauthorized
403 Forbidden - not a member of the organization
404 Provider not found
500 Internal server error
PATCH /organizations/{organization_id}/oauth/providers/{provider_id}

PATCH /organizations/{organization_id}/oauth/providers/{provider_id}

Update an OAuth provider for an organization.

Operation: update_org_oauth_provider

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
provider_id path string Yes OAuth provider ID

Request Body (required)

UpdateOAuthProviderRequest
authorization_url: string
client_id: string
client_secret: string — Optional new client secret (will be re-encrypted). If omitted, keep existing.
description: string — If omitted, leave unchanged. If null, clear.
is_active: boolean
logo_url: string — If omitted, leave unchanged. If null, clear.
name: string
organization_id: string — If omitted, leave unchanged. If null, make global. If set, scope to organization
pkce_required: boolean
revocation_url: string — If omitted, leave unchanged. If null, clear.
... and 5 more properties

Responses

200 OAuth provider updated
OAuthProviderDataResponse
data*: OAuthProviderResponse
400 Invalid request
401 Unauthorized
403 Forbidden - not a member of the organization
404 Provider not found
409 Conflict - provider with this slug already exists
500 Internal server error

Organizations

Organization management endpoints

GET /organizations

GET /organizations

List all organizations for the authenticated user

Operation: list_organizations

Responses

200 List of organizations
OrganizationsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
GET /organizations/{organization_id}/invites

GET /organizations/{organization_id}/invites

List pending and historical organization invites.

Operation: list_invites

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Organization invites retrieved
OrganizationInvitesResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
403 User is not allowed to view invites
500 Internal server error
POST /organizations/{organization_id}/invites

POST /organizations/{organization_id}/invites

Create a new organization invite and send an email via the configured mailer.

Operation: create_invite

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateOrganizationInviteRequest
email*: string — Email address of the invitee.
role: string — Optional role for the invitee (defaults to member).

Responses

201 Invite created and email sent
OrganizationInviteResponse
data*: OrganizationInvite
pagination: any
400 Invalid request
403 User is not allowed to create invites
500 Internal server error
GET /organizations/{organization_id}/members

GET /organizations/{organization_id}/members

List organization members with basic user details.

Operation: list_members

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Organization members retrieved
OrganizationMembersResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
403 User is not a member of the organization
500 Internal server error
GET /organizations/{organization_id}/publishers

GET /organizations/:org_id/publishers

List publishers owned by an organization

Operation: list_org_publishers

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Publishers retrieved successfully
PublishersDataResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
403 Not authorized
500 Internal server error
POST /organizations/{organization_id}/publishers

POST /organizations/:org_id/publishers

Create a new publisher

Operation: create_publisher

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreatePublisherRequest
accepted_asset_ids: array — Asset IDs the publisher accepts for payment
allowed_passthrough_headers: array — Whitelist of agent-provided headers allowed to pass through to upstream
api_headers: any — Headers for API requests (will be encrypted)
api_key_header: string — Header name to inject upstream_api_key into (e.g., "Authorization", "X-API-Key")
api_key_query_param: string — Query parameter name to inject upstream_api_key into (e.g., "api_key")
api_url: string — External API URL (required for integration_type = api)
auth_type: string — Upstream auth mode ("static", "jwt", or "oauth2_cc") (default: static)
base_price_per_1000_rows: string
billing_model: string — Billing model ("x402_per_request", "prepaid_credits", "x402_passthrough", "pay_p
branch_id: string — SerenDB branch ID (required for database_type = serendb)
... and 60 more properties

Responses

201 Publisher created successfully
PublisherDataResponse
data*: PublisherResponse
pagination: any
400 Invalid request
403 Not authorized
409 Publisher slug already exists
500 Internal server error
GET /organizations/{organization_id}/publishers/{publisher_id}

GET /organizations/:org_id/publishers/:publisher_id

Get publisher details

Operation: get_org_publisher

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Responses

200 Publisher retrieved successfully
PublisherDataResponse
data*: PublisherResponse
pagination: any
403 Not authorized
404 Publisher not found
500 Internal server error
PUT /organizations/{organization_id}/publishers/{publisher_id}

PUT /organizations/:org_id/publishers/:publisher_id

Update a publisher

Operation: update_publisher

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Request Body (required)

UpdatePublisherRequest
add_asset_ids: array — Asset IDs to add to accepted assets
allowed_passthrough_headers: array — Whitelist of agent-provided headers allowed to pass through to upstream
api_headers: any — Headers for API requests (will be encrypted)
api_key_header: string — Header name to inject upstream_api_key into (e.g., "Authorization", "X-API-Key")
api_key_query_param: string — Query parameter name to inject upstream_api_key into (e.g., "api_key")
api_url: string — External API URL (for integration_type = api)
auth_type: string — Upstream auth mode ("static" or "jwt")
base_price_per_1000_rows: string
billing_model: string — Billing model ("x402_per_request", "prepaid_credits", "x402_passthrough", "pay_p
branch_id: string — SerenDB branch ID (for database_type = serendb)
... and 60 more properties

Responses

200 Publisher updated successfully
PublisherDataResponse
data*: PublisherResponse
pagination: any
400 Invalid request
403 Not authorized
404 Publisher not found
500 Internal server error
DELETE /organizations/{organization_id}/publishers/{publisher_id}

DELETE /organizations/:org_id/publishers/:publisher_id

Soft delete a publisher

Operation: delete_publisher

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Responses

200 Publisher deleted successfully
403 Not authorized
404 Publisher not found
500 Internal server error
GET /organizations/{organization_id}/publishers/{publisher_id}/earnings

GET /organizations/:org_id/publishers/:publisher_id/earnings

List earnings for a publisher (per asset).

Operation: get_org_publisher_earnings

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Responses

200 Earnings retrieved successfully
PublisherEarningsDataResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
403 Not authorized
404 Publisher not found
500 Internal server error
GET /organizations/{organization_id}/publishers/{publisher_id}/payouts

GET /organizations/:org_id/publishers/:publisher_id/payouts

List payout requests for a publisher.

Operation: list_org_publisher_payouts

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID
limit query integer No Maximum number of results (default: 50)
offset query integer No Offset for pagination

Responses

200 Payouts retrieved successfully
PublisherPayoutsDataResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
403 Not authorized
404 Publisher not found
500 Internal server error
POST /organizations/{organization_id}/publishers/{publisher_id}/payouts

POST /organizations/:org_id/publishers/:publisher_id/payouts

Request a payout for a publisher's earnings.

Operation: create_org_publisher_payout

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Request Body (required)

CreatePublisherPayoutRequest
amount_atomic: integer — Amount to withdraw in atomic units (defaults to max available)
asset_id*: string — Asset to withdraw (must be an asset accepted by the publisher)
destination_wallet: any

Responses

201 Payout request created
PublisherPayoutDataResponse
data*: PublisherPayoutResponse
pagination: any
400 Invalid request
403 Not authorized
404 Publisher not found
500 Internal server error
PUT /organizations/{organization_id}/publishers/{publisher_id}/pricing

PUT /organizations/:org_id/publishers/:publisher_id/pricing

Update publisher pricing config for a specific asset

Operation: update_publisher_pricing

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Request Body (required)

UpdatePricingRequest
asset_id*: string — Asset ID for this pricing config (required)
base_price_per_1000_rows: string
grace_period_minutes: integer
hourly_rate: string
low_balance_threshold: string
markup_multiplier: string
max_charge: string
max_queries_per_minute: integer
min_charge: string
min_display_price: string — Minimum price to display in UI for passthrough publishers (informational only)
... and 18 more properties

Responses

200 Pricing updated successfully
PricingConfigDataResponse
data*: PricingConfigResponse
pagination: any
400 Invalid request
403 Not authorized
404 Publisher not found
500 Internal server error

IP Allow Lists

IP-based access control for projects

GET /projects/{project_id}/ip-allow

List all IP allow list entries for a project

Operation: list_ip_allow_list

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of IP allow list entries
IpAllowListsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
POST /projects/{project_id}/ip-allow

Add an IP address to the allow list

Operation: add_ip_to_allow_list

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

AddIpAllowListRequest
description: string — Optional description for this IP entry
ip_address*: string — IP address or CIDR range (e.g., "192.168.1.0/24" or "10.0.0.1")

Responses

201 IP added to allow list
IpAllowListResponse
data*: IpAllowList
pagination: any
400 Invalid IP address format
401 Unauthorized
404 Project not found
409 IP already exists in allow list
PUT /projects/{project_id}/ip-allow/reset

Replace the entire IP allow list with new entries

Operation: reset_ip_allow_list

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

ResetIpAllowListRequest
entries: array — Entries that should remain in the allow list after the reset. Empty list means t

Responses

200 IP allow list reset successfully
IpAllowListsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
DELETE /projects/{project_id}/ip-allow/{ip_id}

Remove an IP address from the allow list

Operation: remove_ip_from_allow_list

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
ip_id path string Yes IP allow list entry ID

Responses

204 IP removed from allow list
401 Unauthorized
404 Project or IP entry not found

VPC

VPC endpoint management

GET /organizations/{organization_id}/vpc-endpoints

Operation: list_org_vpc_endpoints

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
region query string No Filter endpoints by region

Responses

200 List of VPC endpoints
Array<
OrganizationVpcEndpoint
created_at*: string
endpoint_id*: string
id*: string
label: string
organization_id*: string
region*: string
state*: string
updated_at*: string
>
401 Unauthorized
404 Organization not found
POST /organizations/{organization_id}/vpc-endpoints

Operation: create_org_vpc_endpoint

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateOrganizationVpcEndpointRequest
endpoint_id*: string
label: string
region*: string

Responses

201 VPC endpoint recorded
OrganizationVpcEndpointResponse
data*: OrganizationVpcEndpoint
pagination: any
401 Unauthorized
GET /organizations/{organization_id}/vpc-endpoints/{endpoint_id}

Operation: get_org_vpc_endpoint

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
endpoint_id path string Yes Organization VPC endpoint ID

Responses

200 VPC endpoint details
OrganizationVpcEndpointResponse
data*: OrganizationVpcEndpoint
pagination: any
401 Unauthorized
404 VPC endpoint not found
DELETE /organizations/{organization_id}/vpc-endpoints/{endpoint_id}

Operation: delete_org_vpc_endpoint

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
endpoint_id path string Yes Organization VPC endpoint ID

Responses

204 VPC endpoint removed
401 Unauthorized
404 VPC endpoint not found
GET /organizations/{organization_id}/vpc/region/{region_id}/vpc_endpoints

List VPC endpoints for an organization filtered by region (alias path)

Operation: list_org_vpc_endpoints_by_region

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
region_id path string Yes Region

Responses

200 List of VPC endpoints
Array<
OrganizationVpcEndpoint
created_at*: string
endpoint_id*: string
id*: string
label: string
organization_id*: string
region*: string
state*: string
updated_at*: string
>
401 Unauthorized
404 Organization not found
GET /organizations/{organization_id}/vpc/region/{region_id}/vpc_endpoints/{endpoint_id}

Get VPC endpoint details with region in path (alias)

Operation: get_org_vpc_endpoint_by_region

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
region_id path string Yes Region
endpoint_id path string Yes Organization VPC endpoint ID

Responses

200 VPC endpoint details
OrganizationVpcEndpointResponse
data*: OrganizationVpcEndpoint
pagination: any
401 Unauthorized
404 VPC endpoint not found
DELETE /organizations/{organization_id}/vpc/region/{region_id}/vpc_endpoints/{endpoint_id}

Delete VPC endpoint with region in path (alias)

Operation: delete_org_vpc_endpoint_by_region

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
region_id path string Yes Region
endpoint_id path string Yes Organization VPC endpoint ID

Responses

204 VPC endpoint removed
401 Unauthorized
404 VPC endpoint not found
GET /organizations/{organization_id}/vpc/vpc_endpoints

List VPC endpoints for an organization (alias path with underscores)

Operation: list_org_vpc_endpoints_alias

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 List of VPC endpoints
Array<
OrganizationVpcEndpoint
created_at*: string
endpoint_id*: string
id*: string
label: string
organization_id*: string
region*: string
state*: string
updated_at*: string
>
401 Unauthorized
404 Organization not found
GET /projects/{project_id}/vpc-endpoints

Operation: list_project_vpc_endpoints

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Project VPC endpoint assignments
Array<
ProjectVpcEndpointAssignment
created_at*: string
endpoint_id*: string
endpoint_label: string
id*: string
label: string
organization_vpc_endpoint_id*: string
project_id*: string
region*: string
updated_at*: string
>
401 Unauthorized
404 Project not found
POST /projects/{project_id}/vpc-endpoints

Operation: assign_project_vpc_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

AssignProjectVpcEndpointRequest
label: string
vpc_endpoint_id*: string

Responses

201 Project VPC endpoint assignment created
ProjectVpcEndpointAssignmentResponse
data*: ProjectVpcEndpointAssignment
pagination: any
401 Unauthorized
404 Project or VPC endpoint not found
DELETE /projects/{project_id}/vpc-endpoints/{assignment_id}

Operation: remove_project_vpc_endpoint

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
assignment_id path string Yes Project VPC endpoint assignment ID

Responses

204 Project VPC endpoint assignment removed
401 Unauthorized
404 Assignment not found
GET /projects/{project_id}/vpc_endpoints

List project VPC endpoint assignments (alias path with underscores)

Operation: list_project_vpc_endpoints_alias

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Project VPC endpoint assignments
Array<
ProjectVpcEndpointAssignment
created_at*: string
endpoint_id*: string
endpoint_label: string
id*: string
label: string
organization_vpc_endpoint_id*: string
project_id*: string
region*: string
updated_at*: string
>
401 Unauthorized
404 Project not found
POST /projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}

Assign a VPC endpoint to a project by endpoint id in path (alias)

Operation: assign_project_vpc_endpoint_by_id

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
vpc_endpoint_id path string Yes Organization VPC endpoint ID

Responses

201 Project VPC endpoint assignment created
ProjectVpcEndpointAssignmentResponse
data*: ProjectVpcEndpointAssignment
pagination: any
401 Unauthorized
404 Project or VPC endpoint not found
DELETE /projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}

Remove a VPC endpoint assignment by VPC endpoint id (alias)

Operation: remove_project_vpc_endpoint_by_vpc_id

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
vpc_endpoint_id path string Yes Organization VPC endpoint ID

Responses

204 Project VPC endpoint assignment removed
401 Unauthorized
404 Assignment not found

billing

Billing and metering endpoints (x402 token cache)

GET /billing/health

GET /billing/health

High-level billing and metering health summary for Seren Core

Operation: get_billing_health

Responses

200 Billing health retrieved successfully
BillingHealthResponse
data*: BillingHealth
pagination: any
500 Internal server error
POST /billing/invoices/generate

POST /billing/invoices/generate

Generate monthly invoices for all organizations

Operation: generate_invoices

Request Body (required)

GenerateInvoicesRequest
month*: integer
year*: integer

Responses

200 Invoices generated successfully
InvoicesGeneratedResponse
data*: InvoicesGenerated
pagination: any
400 Invalid request
500 Internal server error
GET /billing/invoices/{id}

GET /billing/invoices/:id

Get invoice details with line items

Operation: get_invoice

Parameters

NameInTypeRequiredDescription
id path string Yes Invoice ID

Responses

200 Invoice retrieved successfully
InvoiceResponse
data*: Invoice
pagination: any
404 Invoice not found
500 Internal server error
POST /billing/invoices/{id}/issue

POST /billing/invoices/:id/issue

Issue a draft invoice

Operation: issue_invoice

Parameters

NameInTypeRequiredDescription
id path string Yes Invoice ID

Responses

200 Invoice issued successfully
404 Invoice not found
500 Internal server error
GET /billing/usage/{organization_id}

GET /billing/usage/:organization_id

Get usage summary for an organization

Operation: get_usage_summary

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
start_date query string No
end_date query string No

Responses

200 Usage summary retrieved
UsageSummariesResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
404 Organization not found
500 Internal server error
GET /organizations/{organization_id}/billing/endpoints/{endpoint_id}/events

GET /organizations/{organization_id}/billing/endpoints/{endpoint_id}/events

Debug endpoint: show recent usage_events and compute_usage_events for an endpoint

Operation: get_endpoint_billing_events

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
endpoint_id path string Yes Endpoint ID

Responses

200 Billing events retrieved successfully
EndpointBillingEventsResponse
data*: EndpointBillingEvents
pagination: any
404 Endpoint not found for organization
500 Internal server error
GET /organizations/{organization_id}/consumption

GET /organizations/{organization_id}/consumption

Aggregated organization-level consumption over a billing window.

Operation: get_organization_consumption

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
start_date query string No Optional ISO-8601 start date (YYYY-MM-DD), defaults to first day of current month.
end_date query string No Optional ISO-8601 end date (YYYY-MM-DD), defaults to today (UTC).

Responses

200 Organization consumption retrieved
OrganizationConsumptionResponse
data*: OrganizationConsumption
pagination: any
401 Unauthorized
403 User is not a member of the organization
500 Internal server error
GET /projects/{project_id}/consumption

GET /projects/{project_id}/consumption

Aggregated project-level consumption (compute, storage, PITR, network) over a billing window.

Operation: get_project_consumption

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
start_date query string No Optional ISO-8601 start date (YYYY-MM-DD), defaults to first day of current month.
end_date query string No Optional ISO-8601 end date (YYYY-MM-DD), defaults to today (UTC).

Responses

200 Project consumption retrieved
ProjectConsumptionResponse
data*: ProjectConsumption
pagination: any
401 Unauthorized
403 User is not a member of the organization
404 Project not found
500 Internal server error

payments

Stripe payments and payment methods

POST /billing/invoices/{id}/pay

POST /billing/invoices/:id/pay

Create a payment intent for an invoice

Operation: create_payment_intent

Parameters

NameInTypeRequiredDescription
id path string Yes Invoice ID

Responses

200 Payment intent created
PaymentIntentCreatedResponse
data*: PaymentIntentCreated
pagination: any
400 Invoice not in payable state
404 Invoice not found
500 Internal server error
GET /billing/invoices/{id}/payments

GET /billing/invoices/:id/payments

Get payment history for an invoice

Operation: get_payment_history

Parameters

NameInTypeRequiredDescription
id path string Yes Invoice ID

Responses

200 Payment history retrieved
PaymentHistoryResponse
data*: PaymentHistory
pagination: any
404 Invoice not found
500 Internal server error
GET /billing/payment-methods

GET /billing/payment-methods

List payment methods for the organization

Operation: list_payment_methods

Responses

200 Payment methods retrieved
PaymentMethodsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
500 Internal server error
POST /billing/payment-methods

POST /billing/payment-methods

Add a payment method for the organization

Operation: add_payment_method

Request Body (required)

AddPaymentMethodRequest
set_as_default*: boolean
stripe_payment_method_id*: string

Responses

200 Payment method added
PaymentMethodAddedResponse
data*: PaymentMethodAdded
pagination: any
400 Invalid request
500 Internal server error
DELETE /billing/payment-methods/{id}

DELETE /billing/payment-methods/{id}

Remove a payment method from the organization

Operation: delete_payment_method

Parameters

NameInTypeRequiredDescription
id path string Yes Payment method ID

Responses

204 Payment method removed
404 Payment method not found
500 Internal server error
GET /payments/supported

GET /payments/supported

Returns supported x402 payment kinds for facilitator discovery.

Operation: get_supported

Responses

200 Supported payment kinds
SupportedResponse
extensions: array — List of supported extensions
kinds*: array — List of supported payment kinds
signers: any — Signer addresses by network family
500 Internal server error

Plans

Subscription plans and quota management

GET /organizations/{organization_id}/plan

GET /organizations/:org_id/plan

Get the current plan for an organization

Operation: get_organization_plan

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Organization plan retrieved successfully
OrganizationPlanResponse
data*: OrganizationPlanWithDetails
pagination: any
404 Organization or plan not found
500 Internal server error
POST /organizations/{organization_id}/plan

POST /organizations/:org_id/plan

Upgrade or downgrade an organization's plan

Operation: change_organization_plan

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

ChangePlanRequest
plan_id*: string
stripe_payment_method_id: any

Responses

200 Plan changed successfully
OrganizationPlanResponse
data*: OrganizationPlanWithDetails
pagination: any
400 Invalid request
404 Organization or plan not found
500 Internal server error
GET /organizations/{organization_id}/quota

GET /organizations/:org_id/quota

Get current quota usage for an organization

Operation: get_quota_usage

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Quota usage retrieved successfully
QuotaUsageResponse
data*: QuotaUsage
pagination: any
404 Organization or plan not found
500 Internal server error
GET /plans

GET /plans

List all available subscription plans

Operation: list_plans

Responses

200 Plans retrieved successfully
PlansResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
500 Internal server error
GET /plans/{plan_id}

GET /plans/:plan_id

Get details of a specific plan

Operation: get_plan

Parameters

NameInTypeRequiredDescription
plan_id path string Yes Plan ID

Responses

200 Plan retrieved successfully
PlanResponse
data*: Plan
pagination: any
404 Plan not found
500 Internal server error

Audit Logs

Audit trail and activity logging

GET /organizations/{organization_id}/audit-logs

List audit logs for an organization

Operation: list_audit_logs

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
actor_id query string No Filter by actor ID
action query string No Filter by action (e.g., "project.create")
resource_type query string No Filter by resource type (e.g., "project", "branch")
resource_id query string No Filter by resource ID
status query string No Filter by status
action_category query string No Filter by action category
start_date query string No Filter by start date (ISO 8601)
end_date query string No Filter by end date (ISO 8601)
limit query integer No Maximum number of results (default 50, max 100)
offset query integer No Offset for pagination

Responses

200 Audit logs retrieved successfully
AuditLogListResponse
data*: AuditLogList
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
404 Organization not found
GET /organizations/{organization_id}/audit-logs/{log_id}

Get a specific audit log entry

Operation: get_audit_log

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
log_id path string Yes Audit log ID

Responses

200 Audit log retrieved successfully
AuditLogResponse
data*: AuditLog
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
404 Audit log not found

RBAC

Role-based access control and permissions

PUT /organizations/{organization_id}/members/{member_id}/role

Assign a role to an organization member

Operation: assign_role

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
member_id path string Yes Member user ID

Request Body (required)

AssignRoleRequest
role_id: string — Either role_id or role_name must be provided
role_name: string — Name of the role (owner, admin, editor, viewer, or custom role name)

Responses

200 Role assigned successfully
400 Invalid request
401 Unauthorized
403 Forbidden - requires org.manage_members permission
404 Member or role not found
GET /organizations/{organization_id}/permissions/check/{permission}

Check if the current user has a specific permission

Operation: check_permission

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
permission path string Yes Permission name to check

Responses

200 Permission check result
401 Unauthorized
403 Forbidden - not a member of this organization
GET /organizations/{organization_id}/permissions/mine

Get current user's permissions in an organization

Operation: get_my_permissions

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 User's permissions
Array<string>
401 Unauthorized
403 Forbidden - not a member of this organization
GET /organizations/{organization_id}/roles

List roles for an organization (includes built-in roles)

Operation: list_organization_roles

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Roles retrieved successfully
RbacRolesResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
POST /organizations/{organization_id}/roles

Create a custom role

Operation: create_organization_role

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateRoleRequest
description: string
name*: string
permissions*: array

Responses

201 Role created successfully
RbacRoleResponse
data*: RbacRole
pagination: any
400 Invalid request
401 Unauthorized
403 Forbidden - requires org.manage_roles permission
GET /organizations/{organization_id}/roles/{role_id}

Get a specific role

Operation: get_role

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
role_id path string Yes Role ID

Responses

200 Role retrieved successfully
RbacRoleResponse
data*: RbacRole
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
404 Role not found
DELETE /organizations/{organization_id}/roles/{role_id}

Delete a custom role

Operation: delete_organization_role

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
role_id path string Yes Role ID

Responses

204 Role deleted successfully
400 Cannot delete built-in role
401 Unauthorized
403 Forbidden - requires org.manage_roles permission
404 Role not found
PATCH /organizations/{organization_id}/roles/{role_id}

Update a custom role

Operation: update_role

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
role_id path string Yes Role ID

Request Body (required)

UpdateRoleRequest
description: string
name: string
permissions: array

Responses

200 Role updated successfully
RbacRoleResponse
data*: RbacRole
pagination: any
400 Invalid request or cannot modify built-in role
401 Unauthorized
403 Forbidden - requires org.manage_roles permission
404 Role not found
GET /permissions

List all permissions

Operation: list_permissions

Responses

200 Permissions retrieved successfully
Array<
Permission
action*: string
created_at*: string
description: string
id*: string
name*: string
resource_type*: string
>
401 Unauthorized

Webhooks

Webhook configuration and delivery management

GET /organizations/{organization_id}/webhooks

List webhooks for an organization

Operation: list_webhooks

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Responses

200 Webhooks retrieved successfully
WebhooksResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
POST /organizations/{organization_id}/webhooks

Create a webhook

Operation: create_webhook

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID

Request Body (required)

CreateWebhookRequest
events*: array
name*: string
project_id: string
url*: string

Responses

201 Webhook created successfully
WebhookCreatedResponse
data*: WebhookCreated
pagination: any
400 Invalid request
401 Unauthorized
403 Forbidden - not a member of this organization
GET /organizations/{organization_id}/webhooks/{webhook_id}

Get a specific webhook

Operation: get_webhook

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
webhook_id path string Yes Webhook ID

Responses

200 Webhook retrieved successfully
WebhookInfoResponse
data*: WebhookInfo
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
404 Webhook not found
DELETE /organizations/{organization_id}/webhooks/{webhook_id}

Delete a webhook

Operation: delete_webhook

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
webhook_id path string Yes Webhook ID

Responses

204 Webhook deleted successfully
401 Unauthorized
403 Forbidden - not a member of this organization
404 Webhook not found
PATCH /organizations/{organization_id}/webhooks/{webhook_id}

Update a webhook

Operation: update_webhook

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
webhook_id path string Yes Webhook ID

Request Body (required)

UpdateWebhookRequest
enabled: boolean
events: array
name: string
url: string

Responses

200 Webhook updated successfully
WebhookInfoResponse
data*: WebhookInfo
pagination: any
400 Invalid request
401 Unauthorized
403 Forbidden - not a member of this organization
404 Webhook not found
GET /organizations/{organization_id}/webhooks/{webhook_id}/deliveries

List recent deliveries for a webhook

Operation: list_webhook_deliveries

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
webhook_id path string Yes Webhook ID

Responses

200 Deliveries retrieved successfully
Array<
WebhookDelivery
attempt_number*: integer
created_at*: string
delivered_at: string
error_message: string
event_id*: string
event_type*: string
id*: string
next_retry_at: string
payload*: object
response_body: string
... and 2 more properties
>
401 Unauthorized
403 Forbidden - not a member of this organization
404 Webhook not found
POST /organizations/{organization_id}/webhooks/{webhook_id}/rotate-secret

Regenerate webhook secret

Operation: rotate_webhook_secret

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
webhook_id path string Yes Webhook ID

Responses

200 Secret rotated successfully
WebhookCreatedResponse
data*: WebhookCreated
pagination: any
401 Unauthorized
403 Forbidden - not a member of this organization
404 Webhook not found
GET /webhooks/event-types

List available event types

Operation: list_event_types

Responses

200 Event types retrieved successfully
Array<string>
401 Unauthorized

Sessions

User session management

GET /sessions

List all active sessions for the current user

Operation: list_sessions

Responses

200 Sessions retrieved successfully
Array<
Session
created_at*: string
expires_at*: string
id*: string
ip_address: string
is_current*: boolean
last_active_at*: string
user_agent: string
>
401 Unauthorized
POST /sessions/revoke-all

Revoke all sessions (logout everywhere)

Operation: revoke_all_sessions

Responses

200 All sessions revoked successfully
SessionsRevokedResponse
data*: SessionsRevoked
pagination: any
401 Unauthorized
DELETE /sessions/{session_id}

Revoke a specific session

Operation: revoke_session

Parameters

NameInTypeRequiredDescription
session_id path string Yes Session ID to revoke

Responses

200 Session revoked successfully
SessionsRevokedResponse
data*: SessionsRevoked
pagination: any
401 Unauthorized
404 Session not found
POST /sessions/{session_id}/revoke-others

Revoke all sessions except a specified one

Operation: revoke_other_sessions

Parameters

NameInTypeRequiredDescription
session_id path string Yes Session ID to keep (current session)

Responses

200 Other sessions revoked successfully
SessionsRevokedResponse
data*: SessionsRevoked
pagination: any
401 Unauthorized
404 Session not found or doesn't belong to user

Logical Replication

Logical replication and CDC management

GET /projects/{project_id}/branches/{branch_id}/publications

List publications for a branch

Operation: list_publications

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Publications retrieved
PublicationsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
403 Forbidden
404 Project or branch not found
POST /projects/{project_id}/branches/{branch_id}/publications

Create a publication

Operation: create_publication

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreatePublicationRequest
name*: string
publish_delete: boolean
publish_insert: boolean
publish_truncate: boolean
publish_update: boolean
tables: array — Tables to include (empty/null means ALL TABLES)

Responses

201 Publication created
PublicationInfoResponse
data*: PublicationInfo
pagination: any
400 Invalid request
401 Unauthorized
403 Forbidden - logical replication not enabled
404 Project or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/publications/{publication_id}

Delete a publication

Operation: delete_publication

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
publication_id path string Yes Publication ID

Responses

204 Publication deleted
401 Unauthorized
403 Forbidden
404 Publication not found
PATCH /projects/{project_id}/branches/{branch_id}/publications/{publication_id}

Update a publication

Operation: update_publication

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
publication_id path string Yes Publication ID

Request Body (required)

UpdatePublicationRequest
publish_delete: boolean
publish_insert: boolean
publish_truncate: boolean
publish_update: boolean
tables: array

Responses

200 Publication updated
PublicationInfoResponse
data*: PublicationInfo
pagination: any
401 Unauthorized
403 Forbidden
404 Publication not found
GET /projects/{project_id}/branches/{branch_id}/replication-slots

List replication slots for a branch

Operation: list_replication_slots

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Replication slots retrieved
ReplicationSlotsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
403 Forbidden
404 Project or branch not found
POST /projects/{project_id}/branches/{branch_id}/replication-slots

Create a replication slot

Operation: create_replication_slot

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreateReplicationSlotRequest
name*: string
plugin: string — Plugin for logical slots (default: pgoutput)
slot_type: string — Slot type: logical or physical (default: logical)

Responses

201 Replication slot created
ReplicationSlotInfoResponse
data*: ReplicationSlotInfo
pagination: any
400 Invalid request
401 Unauthorized
403 Forbidden - logical replication not enabled
404 Project or branch not found
DELETE /projects/{project_id}/branches/{branch_id}/replication-slots/{slot_id}

Delete a replication slot

Operation: delete_replication_slot

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID
slot_id path string Yes Replication slot ID

Responses

204 Replication slot deleted
401 Unauthorized
403 Forbidden
404 Replication slot not found
GET /projects/{project_id}/replication

Get logical replication settings for a project

Operation: get_replication_settings

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 Replication settings retrieved
LogicalReplicationSettingsResponse
data*: LogicalReplicationSettings
pagination: any
401 Unauthorized
403 Forbidden
404 Project not found
PATCH /projects/{project_id}/replication

Update logical replication settings for a project

Operation: update_replication_settings

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Request Body (required)

UpdateLogicalReplicationRequest
enabled*: boolean

Responses

200 Replication settings updated
LogicalReplicationSettingsResponse
data*: LogicalReplicationSettings
pagination: any
401 Unauthorized
403 Forbidden
404 Project not found

Branch Protection

Branch protection rules management

GET /projects/{project_id}/branch-protection

List branch protection rules for a project

Operation: list_branch_protection_rules

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID

Responses

200 List of branch protection rules
BranchProtectionsResponse
data*: array — The actual response data (can be a single object or a collection)
pagination: any
401 Unauthorized
404 Project not found
GET /projects/{project_id}/branches/{branch_id}/protection

Get branch protection rule for a specific branch

Operation: get_branch_protection

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

200 Branch protection rule
BranchProtectionResponse
data*: BranchProtection
pagination: any
401 Unauthorized
404 Branch or protection rule not found
POST /projects/{project_id}/branches/{branch_id}/protection

Create branch protection rule

Operation: create_branch_protection

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

CreateBranchProtectionRequest
allowed_bypass_roles: array
prevent_deletion: boolean
prevent_reset: boolean
require_approval_for_changes: boolean

Responses

201 Branch protection rule created
BranchProtectionResponse
data*: BranchProtection
pagination: any
401 Unauthorized
404 Branch not found
409 Protection rule already exists for this branch
DELETE /projects/{project_id}/branches/{branch_id}/protection

Delete branch protection rule

Operation: delete_branch_protection

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Responses

204 Branch protection rule deleted
401 Unauthorized
404 Branch or protection rule not found
PATCH /projects/{project_id}/branches/{branch_id}/protection

Update branch protection rule

Operation: update_branch_protection

Parameters

NameInTypeRequiredDescription
project_id path string Yes Project ID
branch_id path string Yes Branch ID

Request Body (required)

UpdateBranchProtectionRequest
allowed_bypass_roles: array
prevent_deletion: boolean
prevent_reset: boolean
require_approval_for_changes: boolean

Responses

200 Branch protection rule updated
BranchProtectionResponse
data*: BranchProtection
pagination: any
401 Unauthorized
404 Branch or protection rule not found

agent-wallet

Wallet (funded + promotional)

GET /wallet/balance

Get wallet balance (funded + promotional)

Operation: get_wallet_balance

Responses

200 Wallet balance retrieved
WalletBalanceDataResponse
data*: WalletBalanceResponse
401 Unauthorized
POST /wallet/bonus/payment-method

Claim payment method bonus (if not already claimed)

Operation: claim_payment_method_bonus

Responses

200 Payment method bonus claimed
BonusClaimDataResponse
data*: BonusClaimResponse
401 Unauthorized
409 Bonus already claimed
POST /wallet/bonus/signup

Claim signup bonus (if not already claimed)

Operation: claim_signup_bonus

Responses

200 Signup bonus claimed
BonusClaimDataResponse
data*: BonusClaimResponse
401 Unauthorized
409 Bonus already claimed
POST /wallet/daily/claim

Claim daily free credits

Operation: claim_daily

Responses

200 Daily credits claimed
DailyClaimDataResponse
data*: DailyClaimResponse
400 Not eligible for daily claim
401 Unauthorized
GET /wallet/daily/eligibility

Check if user can claim daily credits

Operation: check_daily_eligibility

Responses

200 Eligibility checked
DailyClaimEligibilityDataResponse
data*: DailyClaimEligibilityResponse
401 Unauthorized
POST /wallet/deposit

Deposit funds via Stripe

Operation: create_deposit

Request Body (required)

DepositRequest
amount_cents*: integer — Amount in USD cents (minimum 500 = $5.00)
referral_code: string — Optional affiliate referral code for tracking

Responses

200 Deposit initiated
DepositDataResponse
data*: DepositResponse
400 Invalid request
401 Unauthorized
POST /wallet/deposit/crypto

Deposit configured asset via on-chain payment flow

Allows agents to deposit the configured asset directly on-chain to their prepaid balance.
Follows the 402 payment protocol:
1. First request (no payment header) returns 402 with payment requirements
2. Second request (with payment header) settles on-chain and credits balance

Operation: onchain_deposit

Request Body (required)

OnchainDepositRequest
amount*: string — Amount to deposit in the configured asset (decimal string, e.g., "10.50")
asset_id: string — Optional asset id to deposit (defaults to publisher primary asset)
publisher_id*: string — Publisher to deposit funds for

Responses

200 Deposit successful
OnchainDepositResponse
agent_wallet*: WalletAddress
asset_symbol*: string — Asset symbol (e.g., USDC, USDT)
balance_amount*: string — New balance (configured asset)
deposited_amount*: string — Amount deposited (configured asset)
message*: string — Deposit successful message
publisher_id*: string — Publisher ID
tx_hash: string — On-chain transaction hash
400 Invalid request
402 Payment required
PaymentRequiredResponseWithInfoany
404 Publisher not found
500 Internal server error
POST /wallet/recover

POST /wallet/recover

Recover an agent account using a recovery code.

This endpoint allows agents who have lost their API key to recover their account
using the recovery code they saved when setting up wallet recovery or on first deposit.

**What this does:**
- Verifies the recovery code
- Revokes all existing API keys (for security)
- Issues a new API key
- Rotates the recovery code (old code is invalidated)

**Important:** Save both the new API key AND the new recovery code - they're only shown once!

Operation: wallet_recover

Request Body (required)

WalletRecoverRequest
recovery_code*: string — Recovery code (24 characters). Dashes/whitespace are allowed; letters are case-i

Responses

200 Account recovered successfully
WalletRecoverDataResponse
data*: WalletRecoverResponse
400 Invalid request
401 Invalid recovery code
500 Internal server error
POST /wallet/recovery

Set up account recovery (recovery code and/or email).

- If you don't have a `recovery_code` yet, this endpoint generates one and returns it **once**.
- If you already have a `recovery_code`, it will not be shown again.
- You can optionally set/update a recovery `email` for human account recovery.

Use the recovery code with `POST /wallet/recover` to rotate access after losing your API key.

Operation: set_recovery

Request Body (required)

SetRecoveryRequest
email: string — Email address for account recovery (optional, for human contact)

Responses

200 Recovery set up
RecoveryDataResponse
data*: RecoveryResponse
401 Unauthorized
GET /wallet/referral

Get user's referral info and code

Operation: get_referral_info

Responses

200 Referral info retrieved
ReferralInfoDataResponse
data*: ReferralInfoResponse
401 Unauthorized
POST /wallet/referral/apply

Apply a referral code to the current user

Operation: apply_referral_code

Request Body (required)

ApplyReferralRequest
referral_code*: string

Responses

200 Referral code applied
400 Invalid referral code
401 Unauthorized
409 Already has a referrer
GET /wallet/transactions

Get transaction history for funded operations

Operation: get_transactions

Parameters

NameInTypeRequiredDescription
limit query integer No Maximum number of transactions to return (default 50, max 100)
offset query integer No Offset for pagination

Responses

200 Transaction history retrieved
WalletTransactionHistoryDataResponse
data*: WalletTransactionHistoryResponse
401 Unauthorized

publisher-payments

Publisher payment APIs for first-party services

POST /billing/publishers/{slug}/charges

POST /billing/publishers/{slug}/charges

Operation: create_charge

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug

Request Body (required)

CreateChargeRequest
agent_wallet*: string
amount_atomic*: integer
description*: string
idempotency_key: string

Responses

200 Charge created
ChargeResponse
agent_wallet*: string
amount_atomic*: integer
id*: string
status*: string
401 Unauthorized
402 Insufficient balance
403 Forbidden
404 Publisher not found
GET /billing/publishers/{slug}/charges/{charge_id}

GET /billing/publishers/{slug}/charges/{charge_id}

Operation: get_charge_status

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug
charge_id path string Yes Charge ID

Responses

200 Charge retrieved
ChargeResponse
agent_wallet*: string
amount_atomic*: integer
id*: string
status*: string
401 Unauthorized
403 Forbidden
404 Charge not found
POST /billing/publishers/{slug}/charges/{charge_id}/refund

POST /billing/publishers/{slug}/charges/{charge_id}/refund

Operation: refund_charge

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug
charge_id path string Yes Charge ID

Request Body (required)

RefundChargeRequest
reason*: string

Responses

200 Charge refunded
ChargeResponse
agent_wallet*: string
amount_atomic*: integer
id*: string
status*: string
401 Unauthorized
403 Forbidden
404 Charge not found
POST /billing/publishers/{slug}/charges/{charge_id}/slash

POST /billing/publishers/{slug}/charges/{charge_id}/slash

Operation: slash_charge

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug
charge_id path string Yes Original charge ID

Request Body (required)

SlashChargeRequest
reason*: string
slash_amount_atomic*: integer

Responses

204 Slash applied
401 Unauthorized
402 Insufficient balance
403 Forbidden
404 Charge not found
POST /billing/publishers/{slug}/payouts

POST /billing/publishers/{slug}/payouts

Operation: create_payout

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug

Request Body (required)

CreatePayoutRequest
amount_atomic*: integer
description*: string
destination_wallet*: string
idempotency_key: string

Responses

200 Payout created
PayoutResponse
amount_atomic*: integer
destination_wallet*: string
error_message: string
id*: string
status*: string
tx_hash: string
401 Unauthorized
403 Forbidden
404 Publisher not found
GET /billing/publishers/{slug}/payouts/{payout_id}

GET /billing/publishers/{slug}/payouts/{payout_id}

Operation: get_payout_status

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug
payout_id path string Yes Payout ID

Responses

200 Payout retrieved
PayoutResponse
amount_atomic*: integer
destination_wallet*: string
error_message: string
id*: string
status*: string
tx_hash: string
401 Unauthorized
403 Forbidden
404 Payout not found
GET /wallet/lookup/{agent_wallet}

GET /wallet/lookup/{agent_wallet}

Look up an agent's available balance (for publisher pre-checks)

Operation: get_agent_balance

Parameters

NameInTypeRequiredDescription
agent_wallet path string Yes Agent wallet address

Responses

200 Balance retrieved
PublisherAgentBalanceResponse
onchain_atomic: integer
serenbucks_atomic*: integer
total_available_atomic*: integer
401 Unauthorized
403 Forbidden
404 Publisher not found

publishers

Unified publisher proxy API

GET /publishers

GET /publishers

List publishers with full details and pricing (store view)

Operation: list_store_publishers

Parameters

NameInTypeRequiredDescription
is_verified query boolean No Filter by verification status
category query string No Filter by publisher category
search query string No Search by name or slug
limit query integer No Maximum number of results (default: 50, max: 100)
offset query integer No Offset for pagination

Responses

200 Publishers retrieved successfully
PaginatedPublishersResponse
data*: array — The response data
pagination*: OffsetPaginationMeta
400 Invalid query parameters
500 Internal server error
GET /publishers/suggest

GET /publishers/suggest

Suggest publishers based on a task or query

Operation: suggest_publishers

Parameters

NameInTypeRequiredDescription
query query string Yes The task or query to match against publisher capabilities. Examples: "scrape website", "AI research", "PDF extraction"
type query string No Type of suggestions: "publisher", "agent", or "both" (default: "both") Note: Agent suggestions are planned but not yet implemented.
limit query integer No Maximum number of results (default: 5, max: 20)

Responses

200 Publisher suggestions retrieved successfully
SuggestDataResponse
data*: SuggestResponse
pagination: any
400 Invalid query parameters
500 Internal server error
GET /publishers/{slug}

GET /publishers/{slug}

Get publisher by slug (store view with full details)

Operation: get_store_publisher

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug

Responses

200 Publisher retrieved successfully
PublisherDataResponse
data*: PublisherResponse
pagination: any
404 Publisher not found
500 Internal server error
POST /publishers/{slug}

Handle requests to the publisher root.

For database publishers, this executes a query from the request body.
For API publishers, this proxies to the root endpoint.
For MCP publishers, this returns an error (use specific tool/resource endpoints).

Operation: publisher_root_handler

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug identifier

Request Body (required)

PublisherRootRequestoneOf: [
DatabaseQueryRequest
database: string — Optional database name (primarily for SerenDB publishers)
params: array — Query parameters
query*: string — SQL query to execute
| any]

Responses

200 Request processed successfully
any
402 Payment required
404 Publisher not found
500 Internal server error
POST /publishers/{slug}/estimate

Estimate query cost without payment

Operation: estimate_query

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug

Request Body (required)

EstimateRequestBody
asset_id: string — Optional asset id to estimate pricing for (defaults to publisher primary asset)
publisher_id*: string — Publisher UUID
query*: string — SQL query to estimate

Responses

200 Cost estimate
EstimateResponse
asset_symbol*: string — Asset symbol (e.g., USDC, USDT)
estimated_cost*: string — Estimated cost in configured asset
estimated_cost_atomic*: integer — Estimated cost in atomic units
estimated_rows*: integer — Estimated rows to be returned
publisher_name*: string — Publisher name
publisher_slug*: string — Publisher slug
404 Publisher not found
500 Internal server error
GET /publishers/{slug}/{path}

Operation: proxy_to_publisher_get

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug identifier
path path string Yes Path to proxy to the publisher

Responses

200 Request proxied successfully
any
402 Payment required
404 Publisher or endpoint not found
500 Internal server error
POST /publishers/{slug}/{path}

Operation: proxy_to_publisher_post

Parameters

NameInTypeRequiredDescription
slug path string Yes Publisher slug identifier
path path string Yes Path to proxy to the publisher

Responses

200 Request proxied successfully
any
402 Payment required
404 Publisher or endpoint not found
500 Internal server error

Agent Analytics

GET /organizations/{organization_id}/publishers/{publisher_id}/analytics/revenue

GET /organizations/:org_id/publishers/:publisher_id/analytics/revenue

Get revenue metrics with period-over-period comparison.

Operation: get_revenue_metrics

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID
days query integer No Number of days to analyze (default: 30)

Responses

200 Revenue metrics
RevenueMetrics
active_agents*: integer — Number of active agents in the period
agents_change_pct*: integer — Agent count change from previous period (percentage)
avg_query_cost_atomic*: integer — Average query cost (atomic units)
period_end*: string — Period end date (ISO 8601)
period_start*: string — Period start date (ISO 8601)
queries_change_pct*: integer — Query count change from previous period (percentage)
revenue_change_pct*: integer — Revenue change from previous period (percentage, e.g., 15 = +15%)
total_queries*: integer — Total queries executed in the period
total_revenue*: string — Total revenue as decimal string
total_revenue_atomic*: integer — Total revenue in the period (atomic units)
401 Unauthorized
404 Publisher not found
GET /organizations/{organization_id}/publishers/{publisher_id}/analytics/revenue-by-day

GET /organizations/:org_id/publishers/:publisher_id/analytics/revenue-by-day

Get daily revenue breakdown.

Operation: get_revenue_by_day

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID
days query integer No Number of days to analyze (default: 30)

Responses

200 Daily revenue breakdown
Array<
RevenueByDay
date*: string — Date (YYYY-MM-DD)
query_count*: integer — Number of queries on this day
revenue*: string — Revenue as decimal string
revenue_atomic*: integer — Revenue on this day (atomic units)
unique_agents*: integer — Number of unique agents on this day
>
401 Unauthorized
404 Publisher not found
GET /organizations/{organization_id}/publishers/{publisher_id}/analytics/top-agents

GET /organizations/:org_id/publishers/:publisher_id/analytics/top-agents

Get top agents by spending.

Operation: get_top_agents

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID
limit query integer No Number of agents to return (default: 10)

Responses

200 Top agents by spending
Array<
TopAgent
agent_wallet*: string — Agent wallet address
balance_atomic*: integer — Current balance (atomic units)
last_active: string — Last activity timestamp (ISO 8601)
query_count*: integer — Number of queries executed
rank*: integer — Rank (1 = highest spender)
total_spent*: string — Total amount spent as decimal string
total_spent_atomic*: integer — Total amount spent (atomic units)
>
401 Unauthorized
404 Publisher not found

templates

GET /organizations/{organization_id}/templates/analytics/{publisher_id}

GET /organizations/{organization_id}/templates/analytics/{publisher_id}

Get template analytics for a specific publisher

Operation: get_publisher_template_analytics

Parameters

NameInTypeRequiredDescription
organization_id path string Yes Organization ID
publisher_id path string Yes Publisher ID

Responses

200 Analytics retrieved successfully
PublisherAnalyticsResponse
publisher_id*: string
templates*: array
totals*: PublisherAnalyticsTotals
401 Unauthorized
403 Not authorized
404 Publisher not found
500 Internal server error
GET /templates

GET /templates

List available templates in the catalog

Operation: list_templates

Parameters

NameInTypeRequiredDescription
verified_only query boolean No Filter to verified templates only
language query string No Filter by language (python, typescript, rust)
min_price query integer No Minimum price in atomic units
max_price query integer No Maximum price in atomic units
search query string No Search in name and description
sort_by query string No Sort order (popularity, price_asc, price_desc, newest, oldest)
limit query integer No Maximum number of templates to return (default: 50)
offset query integer No Offset for pagination (default: 0)

Responses

200 Templates retrieved successfully
TemplateListResponse
data*: array
total*: integer
500 Internal server error
POST /templates/publish

POST /templates/publish

Publish a new agent template

Operation: publish_template

Request Body (required)

CreateTemplateRequest
code*: string — Template source code implementing run(input) -> output
computeBackend: string — Preferred compute backend (e.g., "daytona", "modal"). If not specified, uses def
dependencies: array — Package dependencies (e.g., ["requests", "openai"])
description: string — Description of what the template does
language*: string — Programming language (python, typescript, rust)
llmConfig: any
name*: string — Display name
price*: string — Price per invocation (e.g., "0.05" for $0.05)
slug*: string — URL-friendly slug (unique identifier)

Responses

201 Template published successfully
TemplateDataResponse
data*: CreateTemplateResponse
400 Invalid request
401 Authentication required
409 Template slug already exists
500 Internal server error
GET /templates/{slug}

GET /templates/{slug}

Get template details by slug

Operation: get_template

Parameters

NameInTypeRequiredDescription
slug path string Yes Template slug

Responses

200 Template retrieved successfully
TemplateDataResponse
data*: CreateTemplateResponse
404 Template not found
500 Internal server error
POST /templates/{slug}/invoke

POST /templates/{slug}/invoke

Invoke an agent template.

Supports two modes:
- **Bearer auth present**: uses the authenticated user's SerenBucks balance.
- **No bearer auth**: uses x402 (requires `X-AGENT-WALLET` + payment headers).

Operation: invoke_template

Parameters

NameInTypeRequiredDescription
slug path string Yes Template slug

Request Body (required)

InvokeTemplateRequest
input*: any — Input data to pass to the template

Responses

200 Template invoked successfully
InvokeDataResponse
data*: InvokeTemplateResponse
400 Invalid request
401 Authentication failed
402 Payment required
404 Template not found
500 Internal server error
503 Sandbox execution failed

webhooks

POST /webhooks/stripe

POST /webhooks/stripe

Handle Stripe webhook events

Operation: handle_stripe_webhook

Responses

200 Webhook processed
400 Invalid webhook signature
500 Internal server error