Skip to main content

Overview

The Accounts API provides methods for creating, retrieving, updating, and deleting Mention accounts. It supports account configuration including language, timezone, company information, and more.

Methods

Create Account

Create a new Mention account.
client.create_account(
    name: str,
    email: str,
    password: str,
    company: str | None = None,
    language: str = "en",
    timezone: str = "UTC"
) -> Account
name
string
required
Account name
email
string
required
Account email address
password
string
required
Account password
company
string
Company name (optional)
language
string
default:"en"
Language code (default: en)
timezone
string
default:"UTC"
Timezone (default: UTC)
Returns: Account object Example:
from mention import MentionClient

client = MentionClient(access_token="your-token")

account = client.create_account(
    name="Acme Corporation",
    email="[email protected]",
    password="secure-password",
    company="Acme Corp",
    language="en",
    timezone="America/New_York"
)

print(f"Created account: {account.id}")
Response:
{
  "id": "acc_123456",
  "name": "Acme Corporation",
  "email": "[email protected]",
  "company": "Acme Corp",
  "plan": "professional",
  "timezone": "America/New_York",
  "language": "en",
  "is_admin": true,
  "features": ["api_access", "advanced_analytics"],
  "quota": {
    "alerts": 10,
    "mentions": 100000,
    "api_calls": 10000
  },
  "stats": {
    "alerts_count": 0,
    "mentions_count": 0,
    "unread_mentions_count": 0
  },
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

Get Account

Retrieve account information by ID.
client.get_account(account_id: str) -> Account
account_id
string
required
The account ID
Returns: Account object Example:
account = client.get_account("acc_123456")
print(f"Account name: {account.name}")
print(f"Plan: {account.plan}")
print(f"Alerts: {account.stats.alerts_count}")

Get Current Account

Retrieve the current authenticated user’s account information.
client.get_account_me() -> Account
Returns: Account object for the authenticated user Example:
my_account = client.get_account_me()
print(f"My account: {my_account.name}")
print(f"Email: {my_account.email}")
print(f"Available alerts: {my_account.quota.alerts}")

Update Account

Update account information.
client.update_account(
    account_id: str,
    name: str | None = None,
    email: str | None = None,
    company: str | None = None,
    language: str | None = None,
    timezone: str | None = None
) -> Account
account_id
string
required
The account ID
name
string
New account name (optional)
email
string
New email address (optional)
company
string
New company name (optional)
language
string
New language code (optional)
timezone
string
New timezone (optional)
Returns: Updated Account object Example:
updated_account = client.update_account(
    "acc_123456",
    name="Acme Corporation Updated",
    timezone="Europe/London"
)
print(f"Updated: {updated_account.name}")

Delete Account

Delete an account permanently.
client.delete_account(account_id: str) -> bool
account_id
string
required
The account ID
Returns: True if deletion was successful Example:
success = client.delete_account("acc_123456")
if success:
    print("Account deleted successfully")

Models

Account

Represents a Mention account.
FieldTypeDescription
idstringAccount ID
namestringAccount name
emailstringEmail address
companystringCompany name
planstringSubscription plan
quotaAccountQuotaAccount quotas and limits
statsAccountStatsAccount usage statistics
timezonestringAccount timezone
languagestringAccount language
featureslist[string]Enabled features
is_adminbooleanAdmin status
subscription_expires_atdatetimeSubscription expiration
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp

AccountQuota

Account quota and limits.
FieldTypeDescription
alertsintegerMaximum number of alerts
mentionsintegerMaximum number of mentions
mentions_without_archiveintegerMentions limit without archive
api_callsintegerAPI calls limit

AccountStats

Account usage statistics.
FieldTypeDescription
alerts_countintegerNumber of alerts
mentions_countintegerTotal mentions
unread_mentions_countintegerUnread mentions

Build docs developers (and LLMs) love