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

# Create Account

> Create a new TikTok or Instagram account on a specific phone

## Path Parameters

<ParamField path="phoneId" type="string" required>
  The ID of the phone to create the account on.

  **One account per platform per phone:** Each phone supports one TikTok account and one Instagram account. Attempting to create a second account on the same platform will return an error.
</ParamField>

## Request Body

<ParamField body="platform" type="string" required>
  The platform to create an account on. Either `tiktok` or `instagram`.
</ParamField>

<ParamField body="name" type="string" required>
  The display name for the account (e.g., "John Smith").
</ParamField>

<ParamField body="username" type="string">
  The desired username. If not provided, one will be auto-generated.

  **Note:** TikTok usernames can only be set after Day 5 of warmup.
</ParamField>

<ParamField body="password" type="string" required>
  Password for the account.

  **Requirements:** Minimum 8 characters, must include at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character (`!`, `@`, `#`, `$`, `%`, etc.).
</ParamField>

<ParamField body="bio" type="string">
  Account bio/description.
</ParamField>

<ParamField body="warmupKeywords" type="array">
  Array of keywords to use for content discovery during warmup (e.g., `["fashion", "style", "outfit"]`).

  Optional: If not provided, platform-appropriate trending keywords will be used automatically.
</ParamField>

<ParamField body="profilePictureUrl" type="string">
  URL of the profile picture to use. Must be a publicly accessible image URL.

  **Requirements:** Image must have a 1:1 aspect ratio (square). Non-square images will return an error.
</ParamField>

## Response

<ResponseField name="accountId" type="string">
  Unique identifier for the account.
</ResponseField>

<ResponseField name="platform" type="string">
  The platform (`tiktok` or `instagram`).
</ResponseField>

<ResponseField name="name" type="string">
  The account's display name.
</ResponseField>

<ResponseField name="username" type="string">
  The account's username (may be null for new TikTok accounts).
</ResponseField>

<ResponseField name="accountStatus" type="string">
  Current status: `awaiting_creation`, `created_pending_warmup`, `warming_up`, or `ready`.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the account was created.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.infinipost.co/v1/phones/phone_abc123/accounts \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "platform": "tiktok",
      "name": "Fashion Insider",
      "bio": "Daily fashion tips and trends 👗",
      "password": "Secure1!",
      "warmupKeywords": ["fashion", "ootd", "style"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.infinipost.co/v1/phones/phone_abc123/accounts', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      platform: 'tiktok',
      name: 'Fashion Insider',
      bio: 'Daily fashion tips and trends 👗',
      password: 'Secure1!',
      warmupKeywords: ['fashion', 'ootd', 'style']
    })
  });

  const data = await response.json();
  ```

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

  response = requests.post(
      'https://api.infinipost.co/v1/phones/phone_abc123/accounts',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'platform': 'tiktok',
          'name': 'Fashion Insider',
          'bio': 'Daily fashion tips and trends 👗',
          'password': 'Secure1!',
          'warmupKeywords': ['fashion', 'ootd', 'style']
      }
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "accountId": "acc_1a2b3c4d5e",
    "platform": "tiktok",
    "name": "Fashion Insider",
    "username": null,
    "bio": "Daily fashion tips and trends 👗",
    "accountStatus": "created_pending_warmup",
    "createdAt": "2024-04-21T19:30:00Z"
  }
  ```
</ResponseExample>

## Account Creation Process

1. **Account Setup** (a few hours): TikTok/Instagram account is created on the phone
2. **Status Update**: Account status changes from `created_pending_warmup` to `warming_up`
3. **Warmup** (7 days): Gradual engagement ramp-up to avoid platform restrictions

<Info>
  **TikTok Username Restriction:** New TikTok accounts cannot set a custom username until Day 5 of warmup. The `username` field will be `null` until then.
</Info>

## Error Responses

```json Username Already Taken theme={null}
{
  "error": {
    "code": "username_taken",
    "message": "The username 'fashioninsider' is already taken"
  }
}
```

```json Account Limit Reached theme={null}
{
  "error": {
    "code": "account_limit_exceeded",
    "message": "You have reached your account limit. Upgrade your plan to create more accounts."
  }
}
```

```json Invalid Profile Picture Ratio theme={null}
{
  "error": {
    "code": "invalid_image_ratio",
    "message": "Profile picture must have a 1:1 aspect ratio (square). Provided image is 1920x1080."
  }
}
```

```json Invalid Profile Picture URL theme={null}
{
  "error": {
    "code": "invalid_image_url",
    "message": "Unable to access the profile picture URL. Please ensure the URL is publicly accessible."
  }
}
```

```json Missing Required Fields theme={null}
{
  "error": {
    "code": "missing_required_fields",
    "message": "Missing required field: platform"
  }
}
```

```json Invalid Platform theme={null}
{
  "error": {
    "code": "invalid_platform",
    "message": "Platform must be either 'tiktok' or 'instagram'"
  }
}
```

```json Account Already Exists theme={null}
{
  "error": {
    "code": "account_exists",
    "message": "This phone already has a TikTok account"
  }
}
```

```json Phone Not Found theme={null}
{
  "error": {
    "code": "not_found",
    "message": "Phone phone_abc123 not found"
  }
}
```

```json Invalid Password theme={null}
{
  "error": {
    "code": "invalid_password",
    "message": "Password must be at least 8 characters with uppercase, lowercase, number, and special character"
  }
}
```
