Create Sub-Accounts API
Who is this for: Partners and developers who need to programmatically create and configure sub-accounts under a primary MomentScience account.
Outcome: Use the sub-accounts POST endpoint to create sub-accounts with custom credentials, copied configurations, and scoped permissions via Bearer token authentication.
Overview
The Sub-Accounts API allows you to programmatically create and configure sub-accounts under your primary MomentScience account, When creating a sub-account, you can:
- Define login credentials and basic profile details.
- Copy campaigns, snippets, and behavior settings from the parent account.
- Apply default configurations such as timezone, test mode, or delivery preferences.
This API is authenticated with a Bearer token and requires the Accounts permission scope.
Prerequisites
Before you start, make sure you have:
- An API key generated from the MomentScience Dashboard.
- The API key must include the Accounts permission scope.
ο»ΏLearn more about generating and managing API keys.Learn more about generating and managing API keys.ο»Ώ
Endpoint
POST https://api.adspostx.com/native/account.json
Request Headers
Header | Type | Description |
|---|---|---|
Authorization | String | This endpoint requires a Bearer token with Accounts permission enabled. Requests without the correct scope will be rejected. Bearer <api-key> |
Content-Type | String | Must be application/json |
Query Parameters
Use query parameters to inherit configurations from the parent account when creating a sub-account.
Parameter | Type | Description |
|---|---|---|
copyParentCampaigns | Boolean | Set to true to copy campaigns from the parent account. |
copyParentSnippets | Boolean | Set to true to copy MomentPerks and Perkswall themes. |
setDefaultSnippetAsParent | Boolean | Set to true to use the parentβs default theme for the sub-account. |
copyParentBehaviorSettings | Boolean | Set to true to copy parent behavior settings into the sub-account. |
Request Body
Field | Type | Required | Description |
|---|---|---|---|
String | Yes | Sub-account login email. | |
firstname | String | Conditional | Required if lastname or organization is not provided. |
lastname | String | Conditional | Required if firstname or organization is not provided. |
organization | String | Conditional | Required if firstname or lastname is not provided. |
password | String | Yes | Must be at least 8 characters, including uppercase, lowercase, and a number. |
confirmPassword | String | Yes | Must match the password. |
mobile | String | Optional | Mobile number of the sub-account holder. |
country | String | Optional | Country code (e.g., US). |
zipcode | String | Optional | Zip/postal code. |
website_url | String | Optional | Website associated with the sub-account. Use a fully qualified URL (for example, `https://example.com). |
internalNotes | String | Optional | Internal notes visible only within your organization. |
settings | Object | Optional | Custom account settings (for example, timezone: "America/Chicago"). |
Example Request
curl -X POST "https://api.adspostx.com/native/account.json?copyParentCampaigns=true©ParentSnippets=true" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "Example123!",
"confirmPassword": "Example123!",
"firstname": "Jane",
"lastname": "Doe",
"country": "US",
"zipcode": "10001",
"internalNotes": "Partner onboarding",
"settings": { "timezone": "America/New_York" }
}'API Response
Once the success response 200 OK The API response includes:
- data.account: Contains the newly created sub-account details, including fields provided in the request.
- data.settings: Contains the full configuration object for the sub-account, including all default platform settings and feature flags.
{
"status": "success",
"data": {
"account": {
"id": 5074,
"firstname": "Jon",
"lastname": "Peter",
"username": "[email protected]",
"email": "[email protected]",
"sdk_id": "605590e3bc3863ca",
"organization": "Acme Corp"
},
"settings": {
"no_of_ads": 3,
"is_active": true,
"timezone": "America/Los_Angeles",
"delivery_options": {
"platform": {
"mobile": 100,
"tablet": 100,
"desktop": 100,
"unknown": 100
}
}
}
}
}
π’ If you're running into any issues while going through the integration process, feel free to contact us at [email protected].