Update Sub-Account
Update a Sub-Account, either paid or unpaid, via API
https://app.stammer.ai/en/api/v1/subaccounts/updateContent-Type: application/json
Authorization: Token <Your-API-Token>Last updated
Update a Sub-Account, either paid or unpaid, via API
https://app.stammer.ai/en/api/v1/subaccounts/updateContent-Type: application/json
Authorization: Token <Your-API-Token>Last updated
import requests
# Define the API endpoint
url = "https://app.stammer.ai/en/api/v1/subaccounts/update"
# Set up authentication and headers
headers = {
'Authorization': 'Token <YOUR-API-TOKEN>',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
# Data is passed in the request body as JSON
data = {
"assign_permissions": True,
"permissions_to_assign": ['can_create_chatbot', 'can_view_dashboard', 'can_update_chatbot', 'can_embed_chatbot', 'can_delete_chatbot', 'can_update_knowledge_base', 'can_update_leads', 'can_update_scheduling', 'can_view_conversations', 'can_customize_appearance', 'can_update_integrations', 'can_update_functions', 'can_use_chatbot_audio', 'can_use_eleven_labs_api', 'can_access_api_and_webhooks', 'can_access_master_chat'],
"email": "[email protected]",
"allocated_chatbots": 610,
"allocated_character_count": 610,
"allocated_wallet_balance": "1.1",
"is_directly_billable": True
}
response = requests.put(url, headers=headers, json=data)
# Process the response
if response.status_code in (200, 201, 202):
result = response.json()
print("Response data:", result)
else:
try:
error_data = response.json()
error_message = error_data.get('message') or error_data.get('error', 'Unknown error')
print(f"Error: {error_message}")
except ValueError:
print(f"Error: Status code {response.status_code}")
{
"message": "Sub-Account has been successfully updated π"
}