> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkedcamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register Sub-Account

> Create a new sub-account under an agency account.

<Note>
  This endpoint requires an **agency owner** token.
</Note>

## Headers

<ParamField header="token" type="string" required>
  Token from the agency owner account.
</ParamField>

## Body Parameters

<ParamField body="name" type="string" required>
  Full name of the new sub-account user.
</ParamField>

<ParamField body="email" type="string" required>
  Email address for the new sub-account. Must be unique and not already registered.
</ParamField>

<ParamField body="planId" type="string">
  The plan ID to assign to the sub-account. If not provided, defaults to "CUSTOMER".
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable result message.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.linkedcamp.com/users/register \
    -H "token: YOUR_AGENCY_OWNER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Jane Smith",
      "email": "jane@example.com",
      "planId": "60f7a1b2c3d4e5f6a7b8c9d0"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.linkedcamp.com/users/register",
      headers={"token": "YOUR_AGENCY_OWNER_TOKEN"},
      json={
          "name": "Jane Smith",
          "email": "jane@example.com",
          "planId": "60f7a1b2c3d4e5f6a7b8c9d0",
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.linkedcamp.com/users/register", {
    method: "POST",
    headers: {
      "token": "YOUR_AGENCY_OWNER_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Jane Smith",
      email: "jane@example.com",
      planId: "60f7a1b2c3d4e5f6a7b8c9d0",
    }),
  });
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Sub-account added successfully!"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "message": "User is already registered with this email!"
  }
  ```
</ResponseExample>
