Get Workspace Settings
Retrieve workspace configuration and user profile information.
Request
curl -X GET "https://api.gostanna.com/api/settings?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"profile": {
"name": "John Doe",
"email": "john.doe@yourcompany.com",
"title": "Customer Success Manager"
},
"workspace": {
"workspaceName": "Your Company",
"domain": "yourcompany.com",
"timezone": "America/New_York",
"currency": "USD",
"defaultWindowDays": 7,
"riskThreshold": 40,
"dataRetentionDays": 365,
"notifications": {
"channels": {
"email": true
},
"dailyDigest": false,
"weeklyDigest": true,
"alertOnScoreDrop": true,
"scoreDropPct": 10,
"alertOnRenewals": true,
"renewalsAheadDays": 30,
"emailFrom": "notifications@yourcompany.com"
}
}
}
Update Workspace Settings
Update workspace configuration and user profile information.
Request
curl -X PUT "https://api.gostanna.com/api/settings?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"profile": {
"name": "John Doe",
"title": "Senior Customer Success Manager"
},
"workspace": {
"timezone": "America/Los_Angeles",
"currency": "USD",
"defaultWindowDays": 14,
"riskThreshold": 35,
"notifications": {
"dailyDigest": true,
"weeklyDigest": true,
"alertOnScoreDrop": true,
"scoreDropPct": 15
}
}
}'
Response
{
"success": true,
"message": "Settings updated successfully"
}
List API Keys
Retrieve all API keys for your workspace.
Request
curl -X GET "https://api.gostanna.com/api/settings/api-keys?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"apiKeys": [
{
"id": "key_abc123",
"name": "Production Dashboard",
"key": "sk-abc123...xyz789",
"lastUsedAt": "2024-01-31T10:30:00Z",
"isActive": true,
"createdAt": "2024-01-01T00:00:00Z"
},
{
"id": "key_def456",
"name": "Mobile App",
"key": "sk-def456...uvw123",
"lastUsedAt": null,
"isActive": true,
"createdAt": "2024-01-15T12:00:00Z"
}
]
}
Create API Key
Generate a new API key for your workspace.
Descriptive name for the API key
Request
curl -X POST "https://api.gostanna.com/api/settings/api-keys?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"name": "New Integration Key",
"workspaceId": "yourcompany.com"
}'
Response
{
"success": true,
"message": "API key created successfully",
"apiKey": {
"id": "key_ghi789",
"name": "New Integration Key",
"key": "sk-ghi789mnopqrstuvwxyz123456",
"isActive": true,
"createdAt": "2024-01-31T10:30:00Z"
}
}
The full API key is only shown once during creation. Store it securely as you won’t be able to retrieve it again.
Delete API Key
Remove an API key from your workspace.
Request
curl -X DELETE "https://api.gostanna.com/api/settings/api-keys/key_ghi789?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"success": true,
"message": "API key deleted successfully"
}
Test Email Notifications
Send a test notification email to verify your notification settings.
Notification channel to test (currently only email is supported)
Request
curl -X POST "https://api.gostanna.com/api/notifications/test?workspaceId=yourcompany.com&channel=email" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"success": true,
"message": "Test email sent successfully to john.doe@yourcompany.com"
}
Complete Onboarding
Mark user onboarding as complete to update their status.
Request
curl -X POST "https://api.gostanna.com/api/settings/complete-onboarding?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"success": true,
"hasCompletedOnboarding": true
}
Retrieve detailed user information and onboarding status.
Request
curl -X GET "https://api.gostanna.com/api/settings/user?workspaceId=yourcompany.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Response
{
"user": {
"email": "john.doe@yourcompany.com",
"name": "John Doe",
"title": "Customer Success Manager",
"hasCompletedOnboarding": true,
"createdAt": "2024-01-01T00:00:00Z",
"lastLoginAt": "2024-01-31T09:15:00Z"
},
"workspace": {
"domain": "yourcompany.com",
"name": "Your Company",
"plan": "professional",
"billingStatus": "active"
}
}