End Users
Manage End Users, AI credit allocation, and consumption history.
End Users are users from your own product who open and use the editor.
They are not AuroraSendCloud Accounts and do not log in to the Platform Console. Your backend identifies them with a stable external userId when calling access and email resource APIs.
Application access token
First obtain an Application-scoped access token:
POST /access/tokenThis endpoint uses HTTP Basic Auth with the Application Client ID and Client Secret. It has no request body and does not create an End User.
Create or resolve an End User
POST /access/code finds or creates an End User under the authenticated Application using the request userId:
{
"userId": "user_12345",
"name": "Jane Doe"
}Use the Application access token as a Bearer token. userId is required and must:
- Be unique within the Application.
- Remain stable across editor sessions.
- Contain only letters, numbers, underscores, and hyphens.
- Be no longer than 255 characters.
The endpoint returns a one-time editor code, its lifetime in seconds, and the same userId:
{
"code": "example_code",
"expires_in": 300,
"userId": "user_12345"
}Creating an email through POST /resource/email also requires userId. A previously unknown userId is created automatically by that operation.
Synchronize user profiles
name, email, and phone are optional fields:
- Non-blank
name,email, andphonevalues update the stored End User profile. - Omitting the fields, or passing
nullor empty strings, preserves existing values (will not clear them). - Profile updates are processed only when calling
POST /access/code; backend resource API calls do not update profile details.
End-User custom variables (extra.variables)
When calling POST /access/code, you can supply the optional extra.variables field to dynamically inject custom variables specific to that End User into the editor (such as membership levels, loyalty points balance, or custom tags).
{
"userId": "user_12345",
"name": "Jane Doe",
"email": "[email protected]",
"extra": {
"variables": [
{
"category": "Customer Attributes",
"name": "Member Level",
"value": "member_level",
"preview": "Gold Member",
"description": "User current membership level"
}
]
}
}- Constraints: Up to 100 items.
name(≤ 50 characters) andvalue(≤ 100 characters) are required;category(≤ 50 characters),preview(≤ 100 characters), anddescription(≤ 200 characters) are optional. - Clearing Semantics: If
extrais omitted orvariablesis an empty array[], any previously saved variables for that user are cleared to prevent leaking stale variables across sessions. - Storage Characteristics: Variables are held strictly in the session cache and never persisted to the database. The editor frontend receives them during the code exchange (
code2auth) for insertion into templates.
End User scope
An End User belongs to one Application. The same external userId can be used in different Applications without sharing email records or editor sessions.
Always use the same userId when creating or selecting an email and generating the one-time editor code. This ensures the editor opens under the correct End User context.
Do not send an internal ASC Editor Plugin database ID as userId.
Updated 3 days ago
