Documentation
Databases

Initialize Database Schema

Initialize default messaging platform tables for a nameserver (database)

POST
/
v1
/
organizations
/
{organizationSlug}
/
databases
/
{databaseName}
/
initialize
curl -L -X POST 'https://flux.postacksolutions.com/v1/organizations/{organizationSlug}/databases/{databaseName}/initialize' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "schemaType": "messaging",
    "dropExisting": false
  }'
{
  "message": "Schema initialized successfully",
  "schemaType": "messaging",
  "tablesCreated": 6,
  "verifiedTables": [
    "conversations_db2",
    "end_users_db2",
    "messages_db2",
    "files_db2"
  ],
  "databaseName": "db2"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Schema initialization parameters

schemaType
string

Schema type: "messaging" | "analytics" | "both"

dropExisting
boolean

If true, drops existing tables before creating new ones

Response

200
application/json

Successful response

message
string

Success message