Update Sub-Account
Update a Sub-Account, either paid or unpaid, via API
You can interact with this API by sending a PUT request. This allows you to update a Sub-Account in your Agency Account.
API Endpoint
The following endpoint/URL should be used in order to access this API:
https://app.stammer.ai/en/api/v1/subaccounts/updateRequest Headers
The API must have the following request headers:
Content-Type: application/json
Authorization: Token <Your-API-Token>Query Parameters
The API accepts the following query parameters:
- assign_permissions(Type: Boolean, Optional)- Assign the permissions to the account Admin, set to True if you want to assign permissions. 
 
- permissions_to_assign(Type: List, Optional)- Permissions to assign to the account user. 
- Previous permissions of the users are overridden by the current ones. 
 
- email(Type: Email, Required)- Email address of the SubAccount. 
- Must be a valid email format. 
 
- allocated_chatbots(Type: Integer, Optional)- Number of chatbots allocated to the sub account. 
 
- allocated_character_count(Type: Integer, Optional)- Character count to allocate for the sub account. 
 
- allocated_wallet_balance(Type: Decimal, Optional)- Allocated wallet balance for the sub account. 
- The value should be in decimal format, with a maximum of two decimal places. 
 
- is_directly_billable(Type: Boolean, Optional)- To set the sub account is directly billable. 
- True or False. 
 
Request Example
Here's an example of the request:
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}")
Response Example
Here's an example of the response:
{
    "message": "Sub-Account has been successfully updated π"
}Learn More - https://app.stammer.ai/en/api-docs/subaccount/update/
Last updated
