---
title: Create Sub-Accounts API
slug: create-sub-accounts-api
icon: {"apiMethod":"POST"}
docTags: 
createdAt: 2025-10-09T08:45:38.561Z
---

:::hint{type="info"}
**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.&#x20;
- Copy campaigns, snippets, and behavior settings from the parent account.&#x20;
- Apply default configurations such as timezone, test mode, or delivery preferences.&#x20;

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.&#x20;
- The API key must include the Accounts permission scope.&#x20;

:::hint{type="info"}
[Learn more about generating and managing API keys.](docId\:CD0hKzWhbqxqwKYfO_cZG)
:::

# 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.<br />`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**                                                                                           |
| ----------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------- |
| `email`           | 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

:::CodeblockTabs
Example Request

```javascript
curl -X POST "https://api.adspostx.com/native/account.json?copyParentCampaigns=true&copyParentSnippets=true" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "newuser@example.com",
    "password": "Example123!",
    "confirmPassword": "Example123!",
    "firstname": "Jane",
    "lastname": "Doe",
    "country": "US",
    "zipcode": "10001",
    "internalNotes": "Partner onboarding",
    "settings": { "timezone": "America/New_York" }
  }'
```
:::

## API Response&#x20;

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.

```javascript
{
  "status": "success",
  "data": {
    "account": {
      "id": 5074,
      "firstname": "Jon",
      "lastname": "Peter",
      "username": "newuser@example.com",
      "email": "newuser@example.com",
      "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 [help@momentscience.com](#).&#x20;
