Retrieve Sub-Account

Retrieve a Sub-Account, either paid or unpaid, via API

You can interact with this API by sending a GET request. This allows you to retrieve 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/retrieve

Request 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:

  • email (Type: Email, Required)

    • Email address of the user.

Request Example

Here's an example of the request:

import requests

# Define the API endpoint
url = "https://app.stammer.ai/en/api/v1/subaccounts/retrieve"

# Set up authentication and headers
headers = {
    'Authorization': 'Token <YOUR-API-TOKEN>',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}



# Data is passed as URL query parameters
params = {

    "email": "[email protected]"

}
response = requests.get(url, headers=headers, params=params)



# 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:

{

  "name": "string here.",

  "email": "[email protected]",

  "creation_type": "string here.",

  "billing_status": "Any string here.",

  "allocated_chatbots": 10,

  "used_chatbots": 10,

  "current_wallet_balance": "61.981",

  "used_wallet_balance": "61.981",

  "character_count": 10,

  "used_character_count": 10
        
}

Last updated