JavaScript: Organizations, projects and keys
Manage organizations, members, invites, roles, project settings, API keys and project databases with @sovaria/sdk.
These methods manage your Sovaria account itself — organizations, team members, projects, keys and databases. They need a team member's session (console login or CLI token), never an app user's.
await sovaria.graph.createInvite(orgId, { email: 'sam@example.com', role: 'MEMBER' })
const members = await sovaria.graph.listMembers(orgId)#Organizations, members and settings
sovaria.graph.createNode
Create an org, project or environment node.
sovaria.graph.createNode(
nodeType: string,
name: string,
metadata?: JsonObject = {},
options?: { databasePassword?: string } = {},
): Promise<JsonObject>For a PROJECT, options.databasePassword sets the project's database password (12–72 characters, letters, numbers and symbols; no spaces, quotes, backslashes or backticks). Without it the database gets a random password you can change later.
Parameters
nodeTypestringrequirednamestringrequiredmetadataJsonObjectoptionaldefault{}options{ databasePassword?: string }optionaldefault{}
Returns
Promise<JsonObject>
- HTTP
- POST /api/v1/org
{
"node_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"type": "PROJECT",
"name": "Skolist shop"
}sovaria.graph.createEdge
Create edge.
sovaria.graph.createEdge(
sourceId: string,
targetId: string,
relationType: string,
role?: string,
): Promise<JsonObject>Parameters
sourceIdstringrequiredtargetIdstringrequiredrelationTypestringrequiredrolestringoptional
Returns
Promise<JsonObject>
{
"status": "ok",
"source_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"target_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"relation_type": "MEMBER_OF"
}sovaria.graph.addMember
Add member.
sovaria.graph.addMember(
orgId: string,
userId: string,
role?: string = 'MEMBER',
): Promise<JsonObject>Parameters
orgIdstringrequireduserIdstringrequiredrolestringoptionaldefault'MEMBER'
Returns
Promise<JsonObject>
{
"status": "ok",
"user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"role": "MEMBER"
}sovaria.graph.getContext
Get context.
sovaria.graph.getContext(
userId: string,
resourceId: string,
): Promise<JsonObject>Parameters
userIdstringrequiredresourceIdstringrequired
Returns
Promise<JsonObject>
{
"roles": [
"ADMIN"
],
"mfa_required": false
}sovaria.graph.listNodes
List nodes.
sovaria.graph.listNodes(nodeType?: string): Promise<JsonValue>Parameters
nodeTypestringoptional
Returns
Promise<JsonValue>
- HTTP
- GET /api/v1/org
[
{
"id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"type": "ORG",
"name": "Skolist",
"metadata_json": {
"settings": {
"require_mfa": false
}
},
"role": "OWNER",
"env_id": null,
"env_name": null,
"env_db_type": null
}
]sovaria.graph.getNode
Get node.
sovaria.graph.getNode(nodeId: string): Promise<JsonObject>Parameters
nodeIdstringrequired
Returns
Promise<JsonObject>
{
"id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"type": "ORG",
"name": "Skolist",
"metadata_json": {
"settings": {
"default_member_role": "MEMBER"
}
},
"created_at": "2026-09-01T10:00:00+00:00"
}sovaria.graph.getChildren
Get children.
sovaria.graph.getChildren(
parentId: string,
relation?: string = 'OWNS',
): Promise<JsonValue>Parameters
parentIdstringrequiredrelationstringoptionaldefault'OWNS'
Returns
Promise<JsonValue>
[
{
"id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"type": "PROJECT",
"name": "Skolist shop",
"metadata_json": {
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"region": "ap-south-1"
},
"role": null,
"env_id": "8d1e5c2a-…",
"env_name": "production",
"env_db_type": "postgres"
}
]sovaria.graph.updateOrg
Update org.
sovaria.graph.updateOrg(
orgId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequiredbodyJsonObjectrequired
Returns
Promise<JsonObject>
sovaria.graph.deleteOrg
Delete org.
sovaria.graph.deleteOrg(orgId: string): Promise<JsonObject>Parameters
orgIdstringrequired
Returns
Promise<JsonObject>
{
"status": "deleting",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90"
}sovaria.graph.setOrgPlan
Set org plan.
sovaria.graph.setOrgPlan(
orgId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequiredbodyJsonObjectrequired
Returns
Promise<JsonObject>
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"plan": "free"
}sovaria.graph.listMembers
List members.
sovaria.graph.listMembers(orgId: string): Promise<JsonValue>Parameters
orgIdstringrequired
Returns
Promise<JsonValue>
[
{
"id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"type": "USER",
"name": "Ana Lima",
"metadata_json": {},
"role": "ADMIN",
"email": "ana@skolist.com",
"mfa_enabled": true
}
]sovaria.graph.removeMember
Remove member.
sovaria.graph.removeMember(
orgId: string,
userId: string,
): Promise<JsonObject>Parameters
orgIdstringrequireduserIdstringrequired
Returns
Promise<JsonObject>
{
"status": "ok",
"user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"role": "MEMBER"
}sovaria.graph.updateMember
Update member.
sovaria.graph.updateMember(
orgId: string,
userId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequireduserIdstringrequiredbodyJsonObjectrequired
Returns
Promise<JsonObject>
{
"status": "ok",
"user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"role": "VIEWER"
}sovaria.graph.createInvite
Create invite.
sovaria.graph.createInvite(
orgId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequired- Organization id.
bodyJsonObjectrequiredemailandrole(OWNER,ADMIN,MEMBERorVIEWER).
Returns
Promise<JsonObject>
{
"invite_id": "5a0f…",
"token": "Qm9…(43 characters)",
"expires_at": "2026-10-25T11:00:00+00:00",
"accept_url": "https://console.sovaria.in/invite/accept?token=Qm9…"
}sovaria.graph.acceptInvite
Accept invite.
sovaria.graph.acceptInvite(body: JsonObject): Promise<JsonObject>Parameters
bodyJsonObjectrequired
Returns
Promise<JsonObject>
{
"status": "accepted",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"user_id": "c1d2…",
"role": "MEMBER"
}sovaria.graph.getRoleMatrix
Get role matrix.
sovaria.graph.getRoleMatrix(): Promise<JsonObject>Returns
Promise<JsonObject>
{
"admin": {
"read": true,
"write": true,
"delete": true,
"manage_users": true,
"manage_roles": true,
"manage_settings": true,
"manage_api_keys": true,
"manage_policies": true,
"execute_functions": true,
"manage_storage": true,
"view_logs": true,
"manage_billing": true
},
"staff": {
"read": true,
"write": true,
"delete": false,
"manage_users": false,
"manage_roles": false,
"manage_settings": false,
"manage_api_keys": false,
"manage_policies": false,
"execute_functions": true,
"manage_storage": true,
"view_logs": false,
"manage_billing": false
}
}sovaria.graph.setRoleMatrix
Set role matrix.
sovaria.graph.setRoleMatrix(body: JsonObject): Promise<JsonObject>Parameters
bodyJsonObjectrequired
Returns
Promise<JsonObject>
{
"status": "ok",
"roles": [
"admin",
"customer",
"staff"
]
}sovaria.graph.getRoleCatalog
Get role catalog.
sovaria.graph.getRoleCatalog(): Promise<JsonValue>Returns
Promise<JsonValue>
{
"orgTeamRoles": [
"OWNER",
"ADMIN",
"MEMBER",
"VIEWER"
],
"appUserRoles": [
"admin",
"customer",
"staff"
]
}sovaria.graph.getProjectRef
Get project ref.
sovaria.graph.getProjectRef(projectId: string): Promise<JsonObject>Parameters
projectIdstringrequired
Returns
Promise<JsonObject>
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"project_ref": "3f9a1c0b7e2d",
"project_url": "https://3f9a1c0b7e2d.sovarias.in",
"project_url_local": "http://localhost:8000 (X-Sovaria-Project-Ref: 3f9a1c0b7e2d)",
"client_endpoints": {
"auth_base": "https://3f9a1c0b7e2d.sovarias.in/auth/v1",
"functions_base": "https://3f9a1c0b7e2d.sovarias.in/functions/v1",
"rest_doc_base": "https://3f9a1c0b7e2d.sovarias.in/rest/doc",
"rest_sql": "https://3f9a1c0b7e2d.sovarias.in/rest/sql/query",
"storage_base": "https://3f9a1c0b7e2d.sovarias.in/storage/v1",
"realtime_base": "https://3f9a1c0b7e2d.sovarias.in/realtime/v1"
}
}sovaria.graph.getProjectSettings
Get project settings.
sovaria.graph.getProjectSettings(): Promise<JsonObject>Returns
Promise<JsonObject>
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"settings": {
"allowPublicSignup": true,
"allowInviteOnlySignup": false,
"anonymousSignIn": false,
"emailVerification": true,
"secureEmailChange": true,
"phoneVerification": false,
"mfaEnforcement": false,
"passwordMinLength": 8,
"passwordRequireUppercase": true,
"passwordRequireDigit": true,
"passwordRequireSpecial": true,
"captchaProtection": false,
"bruteForceProtection": true,
"rateLimiting": true,
"sessionTimeout": 60,
"apiRateLimitPerMinute": 120,
"apiRateLimitPerUserPerMinute": 0,
"allowedOrigins": [
"https://app.skolist.com",
"http://localhost:*"
],
"realtime_cdc": {
"enabled": true,
"tables": [
"orders"
]
},
"stagingFirst": false,
"containsPHI": false,
"customSmtpEnabled": false,
"projectDisplayName": "Skolist shop",
"authProviders": {
"email": true,
"magic_link": true,
"google": false
},
"authConfig": {
"sessions": {
"timeBoxMinutes": 0,
"inactivityMinutes": 0,
"singleSession": false,
"reuseIntervalSeconds": 10
},
"urls": {
"siteUrl": "https://app.skolist.com",
"redirectUrls": [
"https://app.skolist.com/**",
"skolist://auth-callback"
]
},
"rateLimits": {
"emailsPerHour": 30,
"smsPerHour": 30,
"tokenRefreshesPer5Min": 150,
"verificationsPer5Min": 30,
"anonymousSignInsPerHour": 30,
"signInsPer5Min": 30,
"failedSignInsPerAccount15Min": 10,
"magicLinksPerEmailHour": 3,
"magicLinksPerIpHour": 5,
"passwordResetsPerEmailHour": 3,
"passwordResetsPerIpHour": 5,
"emailCodeAttempts": 5,
"smsPerNumberHour": 10
},
"mfa": {
"totp": true,
"phone": false,
"maxFactors": 10
},
"attack": {
"leakedPasswordCheck": false,
"preventEnumeration": true
},
"passkeys": {
"enabled": false,
"rpId": "",
"rpName": "",
"origins": []
},
"mobile": {
"requirePkce": true
}
},
"realtimeConfig": {
"allowPublicAccess": true,
"maxConcurrentClients": 0,
"maxEventsPerSecond": 100,
"maxPayloadKB": 128
}
},
"ignored_keys": []
}sovaria.graph.setProjectSettings
Set project settings.
sovaria.graph.setProjectSettings(body: JsonObject): Promise<JsonObject>Parameters
bodyJsonObjectrequired- Settings to change (merged with the current ones), e.g.
allowedOrigins,stagingFirst.
Returns
Promise<JsonObject>
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"settings": {
"allowPublicSignup": false,
"allowInviteOnlySignup": false,
"anonymousSignIn": false,
"emailVerification": true,
"secureEmailChange": true,
"phoneVerification": false,
"mfaEnforcement": false,
"passwordMinLength": 8,
"passwordRequireUppercase": true,
"passwordRequireDigit": true,
"passwordRequireSpecial": true,
"captchaProtection": false,
"bruteForceProtection": true,
"rateLimiting": true,
"sessionTimeout": 60,
"apiRateLimitPerMinute": 300,
"apiRateLimitPerUserPerMinute": 0,
"allowedOrigins": [
"https://app.skolist.com"
],
"realtime_cdc": {
"enabled": true,
"tables": [
"orders"
]
},
"stagingFirst": false,
"containsPHI": false,
"customSmtpEnabled": false,
"projectDisplayName": "Skolist shop",
"authProviders": {
"email": true,
"magic_link": true,
"google": false
},
"authConfig": {
"sessions": {
"timeBoxMinutes": 0,
"inactivityMinutes": 0,
"singleSession": false,
"reuseIntervalSeconds": 10
},
"urls": {
"siteUrl": "https://app.skolist.com",
"redirectUrls": [
"https://app.skolist.com/**",
"skolist://auth-callback"
]
},
"rateLimits": {
"emailsPerHour": 30,
"smsPerHour": 30,
"tokenRefreshesPer5Min": 150,
"verificationsPer5Min": 30,
"anonymousSignInsPerHour": 30,
"signInsPer5Min": 30,
"failedSignInsPerAccount15Min": 10,
"magicLinksPerEmailHour": 3,
"magicLinksPerIpHour": 5,
"passwordResetsPerEmailHour": 3,
"passwordResetsPerIpHour": 5,
"emailCodeAttempts": 5,
"smsPerNumberHour": 10
},
"mfa": {
"totp": true,
"phone": false,
"maxFactors": 10
},
"attack": {
"leakedPasswordCheck": false,
"preventEnumeration": true
},
"passkeys": {
"enabled": false,
"rpId": "",
"rpName": "",
"origins": []
},
"mobile": {
"requirePkce": true
}
},
"realtimeConfig": {
"allowPublicAccess": true,
"maxConcurrentClients": 0,
"maxEventsPerSecond": 100,
"maxPayloadKB": 128
}
},
"ignored_keys": []
}#API keys
sovaria.keys.list
List.
sovaria.keys.list(): Promise<JsonValue>Returns
Promise<JsonValue>
[
{
"id": "1c7e…",
"name": "Backend worker",
"prefix": "svr_9f3c…",
"role": "editor",
"kind": "custom",
"created": "2026-10-18T09:00:00+00:00",
"expires_at": "2027-10-18T09:00:00+00:00",
"last_used": null,
"is_active": true
},
{
"id": "0a1b…",
"name": "Anon Key",
"prefix": "svr_4c1d…",
"role": "viewer",
"kind": "anon",
"created": "2026-10-18T09:00:00+00:00",
"expires_at": null,
"last_used": "2026-10-18T11:59:00+00:00",
"is_active": true
}
]sovaria.keys.create
Create.
sovaria.keys.create(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired- Name, role and optional expiry for a custom key.
Returns
Promise<JsonObject>
- The key value is shown once in the response. Store it in a secret manager.
{
"id": "1c7e…",
"name": "Backend worker",
"prefix": "svr_9f3c…",
"role": "editor",
"kind": "custom",
"created": "2026-10-18T09:00:00+00:00",
"expires_at": "2027-10-18T09:00:00+00:00",
"last_used": null,
"is_active": true,
"raw_key": "svr_9f3c2a71e4b85d06c1a7f2e9…(52 characters)"
}sovaria.keys.ensureDefaults
Ensure defaults.
sovaria.keys.ensureDefaults(): Promise<JsonObject>Returns
Promise<JsonObject>
[]sovaria.keys.revoke
Revoke.
sovaria.keys.revoke(keyId: string): Promise<JsonObject>Parameters
keyIdstringrequired- The key id (not the key value).
Returns
Promise<JsonObject>
{
"status": "revoked",
"key_id": "1c7e…"
}#Databases and regions
sovaria.governance.listRegions
List regions.
sovaria.governance.listRegions(): Promise<JsonValue>Returns
Promise<JsonValue>
sovaria.governance.listAvailableRegions
List available regions.
sovaria.governance.listAvailableRegions(
query?: { size?: string; plan?: string },
): Promise<JsonValue>Parameters
query{ size?: string; plan?: string }optional
Returns
Promise<JsonValue>
sovaria.governance.getTenant
Get tenant.
sovaria.governance.getTenant(orgId: string): Promise<JsonObject>Parameters
orgIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.listTenantDatabases
List tenant databases.
sovaria.governance.listTenantDatabases(
orgId: string,
): Promise<JsonValue>Parameters
orgIdstringrequired
Returns
Promise<JsonValue>
sovaria.governance.provisionDatabase
Provision database.
sovaria.governance.provisionDatabase(
orgId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequiredbodyJsonObjectrequired
Returns
Promise<JsonObject>
sovaria.governance.getDatabaseConnection
Get database connection.
sovaria.governance.getDatabaseConnection(
orgId: string,
projectId: string,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.revealDatabaseConnection
Staff only: the connection string, with the active access grant that allows revealing it.
sovaria.governance.revealDatabaseConnection(
orgId: string,
projectId: string,
grantId: string,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequiredgrantIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.pauseDatabase
Pause database.
sovaria.governance.pauseDatabase(
orgId: string,
projectId: string,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.resumeDatabase
Resume database.
sovaria.governance.resumeDatabase(
orgId: string,
projectId: string,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.resizeDatabase
Resize database.
sovaria.governance.resizeDatabase(
orgId: string,
projectId: string,
body: JsonObject,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequiredbodyJsonObjectrequired
Returns
Promise<JsonObject>
sovaria.governance.deleteDatabase
Delete database.
sovaria.governance.deleteDatabase(
orgId: string,
projectId: string,
snapshot?: boolean = true,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequiredsnapshotbooleanoptionaldefaulttrue
Returns
Promise<JsonObject>
sovaria.governance.listDatabaseBackups
List database backups.
sovaria.governance.listDatabaseBackups(
orgId: string,
projectId: string,
limit?: number = 5,
): Promise<JsonValue>Parameters
orgIdstringrequiredprojectIdstringrequiredlimitnumberoptionaldefault5
Returns
Promise<JsonValue>
sovaria.governance.triggerDatabaseBackup
Trigger database backup.
sovaria.governance.triggerDatabaseBackup(
orgId: string,
projectId: string,
): Promise<JsonObject>Parameters
orgIdstringrequiredprojectIdstringrequired
Returns
Promise<JsonObject>
sovaria.governance.downloadDatabaseBackup
Download a completed backup (plain SQL, gzip) as a Blob — the whole database, so owners, admins and developers only (database.backup.read).
sovaria.governance.downloadDatabaseBackup(
orgId: string,
projectId: string,
backupId: number | string,
): Promise<Blob>Restore it anywhere with gunzip -c file | psql.
Parameters
orgIdstringrequiredprojectIdstringrequiredbackupIdnumber | stringrequired
Returns
Promise<Blob>
sovaria.governance.downloadProjectExport
Download a portable export bundle (tar.gz: Postgres dump + migration metadata) as a Blob.
sovaria.governance.downloadProjectExport(
orgId: string,
projectId: string,
exportId: string,
): Promise<Blob>Parameters
orgIdstringrequiredprojectIdstringrequiredexportIdstringrequired
Returns
Promise<Blob>
sovaria.governance.projectMetrics
Project metrics.
sovaria.governance.projectMetrics(
projectId: string,
since?: string = '24',
limit?: number = 500,
): Promise<JsonObject>Parameters
projectIdstringrequiredsincestringoptionaldefault'24'limitnumberoptionaldefault500
Returns
Promise<JsonObject>