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

# Update Account Social Profile

> Update account social profile for one or more accounts (username, avatar, nickname, bio)

## Endpoint

```
POST https://api.ugc.inc/accounts/update-social
```

## Overview

Update the social media profile of one or more accounts including username, avatar, nickname (display name), and bio. For accounts that are already active on the social platform, changes are submitted as pending and applied manually within 24 hours. For accounts still being created, changes are applied directly.

<Warning>
  **Important Rate Limits (per account):**

  * **Username:** Can only be updated **once every 7 days**
  * **Nickname:** Can only be updated **once every 7 days**
  * **Avatar:** Can only be updated **once every 24 hours**
  * **Bio:** Can only be updated **once every 24 hours**

  If you attempt to update a field before its cooldown period has elapsed, that account update will fail with details about when the next update is allowed.
</Warning>

<Warning>
  **Avatar Image Requirements:**

  * **Aspect Ratio:** Avatar images must have a **1:1 aspect ratio** (square images)
  * **Minimum Dimensions:** At least **250x250 pixels**
  * **Supported Formats:** JPEG, PNG, WebP
  * **Accessibility:** URL must be publicly accessible

  If the image does not meet these requirements, the request will be rejected with an error showing the actual dimensions.
</Warning>

## Request Body

<ParamField body="updates" type="array" required>
  Array of account social profile updates to apply. Each update object contains:

  <Expandable title="Update object properties">
    <ParamField body="accountId" type="string" required>
      Account ID to update
    </ParamField>

    <ParamField body="username" type="string">
      New username for the account
    </ParamField>

    <ParamField body="avatarUrl" type="string">
      New avatar/profile picture URL (must be publicly accessible, have a 1:1 aspect ratio, and be at least 250x250 pixels)
    </ParamField>

    <ParamField body="nickName" type="string">
      New display name (max 30 characters)
    </ParamField>

    <ParamField body="bio" type="string">
      New bio text (max 80 characters for TikTok, 150 for Instagram)
    </ParamField>
  </Expandable>
</ParamField>

<Note>
  Each update in the array should include at least one field to update (username, avatarUrl, nickName, or bio).
</Note>

## Response

<ResponseField name="data" type="object">
  Response object containing success summary and results

  <Expandable title="Response properties">
    <ResponseField name="message" type="string">
      Summary message indicating how many profile update tasks were created
    </ResponseField>

    <ResponseField name="successful" type="number">
      Number of accounts for which profile update tasks were successfully created
    </ResponseField>

    <ResponseField name="failed" type="number">
      Number of accounts that failed
    </ResponseField>

    <ResponseField name="results" type="array">
      Array of individual update results

      <Expandable title="Result object properties">
        <ResponseField name="accountId" type="string">
          Account ID
        </ResponseField>

        <ResponseField name="success" type="boolean">
          Whether the update task was created successfully
        </ResponseField>

        <ResponseField name="error" type="string">
          Error message (only present on failure)
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.ugc.inc/accounts/update-social \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "updates": [
        {
          "accountId": "acc_123456",
          "nickName": "Cool Creator ✨",
          "bio": "Content creator 🎥 | Follow for daily tips"
        },
        {
          "accountId": "acc_789012",
          "avatarUrl": "https://storage.example.com/new-avatar.jpg"
        }
      ]
    }'
  ```

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

  response = requests.post(
      'https://api.ugc.inc/accounts/update-social',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'updates': [
              {
                  'accountId': 'acc_123456',
                  'nickName': 'Cool Creator ✨',
                  'bio': 'Content creator 🎥 | Follow for daily tips'
              },
              {
                  'accountId': 'acc_789012',
                  'avatarUrl': 'https://storage.example.com/new-avatar.jpg'
              }
          ]
      }
  )

  data = response.json()

  if data['ok']:
      print(f"Created profile update tasks for {data['data']['successful']} account(s)")
      if data['data']['failed'] > 0:
          for result in data['data']['results']:
              if not result['success']:
                  print(f"Failed: {result['accountId']} - {result['error']}")
  else:
      print('Error:', data['message'])
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.ugc.inc/accounts/update-social', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      updates: [
        {
          accountId: 'acc_123456',
          nickName: 'Cool Creator ✨',
          bio: 'Content creator 🎥 | Follow for daily tips'
        },
        {
          accountId: 'acc_789012',
          avatarUrl: 'https://storage.example.com/new-avatar.jpg'
        }
      ]
    })
  });

  const data = await response.json();

  if (data.ok) {
    console.log(`Created profile update tasks for ${data.data.successful} account(s)`);
    if (data.data.failed > 0) {
      data.data.results.filter(r => !r.success).forEach(r => {
        console.log(`Failed: ${r.accountId} - ${r.error}`);
      });
    }
  } else {
    console.error('Error:', data.message);
  }
  ```

  ```typescript React theme={null}
  import { UGCClient } from 'ugcinc';

  const client = new UGCClient({
    apiKey: 'YOUR_API_KEY'
  });

  const response = await client.accounts.updateSocial({
    updates: [
      {
        accountId: 'acc_123456',
        nickName: 'Cool Creator ✨',
        bio: 'Content creator 🎥 | Follow for daily tips'
      },
      {
        accountId: 'acc_789012',
        avatarUrl: 'https://storage.example.com/new-avatar.jpg'
      }
    ]
  });

  if (response.ok) {
    console.log(`Created profile update tasks for ${response.data.successful} account(s)`);
    response.data.results.forEach(result => {
      if (result.success) {
        console.log(`Account ${result.accountId}: update scheduled`);
      } else {
        console.log(`Account ${result.accountId} failed: ${result.error}`);
      }
    });
  } else {
    // Error includes when you can update again
    console.error('Error:', response.message);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Created profile update tasks for 2 account(s)",
    "data": {
      "message": "Created profile update tasks for 2 account(s)",
      "successful": 2,
      "failed": 0,
      "results": [
        {
          "accountId": "acc_123456",
          "success": true
        },
        {
          "accountId": "acc_789012",
          "success": true
        }
      ]
    }
  }
  ```

  ```json Partial Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Created profile update tasks for 1 account(s), 1 failed",
    "data": {
      "message": "Created profile update tasks for 1 account(s), 1 failed",
      "successful": 1,
      "failed": 1,
      "results": [
        {
          "accountId": "acc_123456",
          "success": true
        },
        {
          "accountId": "acc_789012",
          "success": false,
          "error": "Nickname can only be updated once every 7 days. Last update was 3 days ago. You can update again in 4 day(s) on 2024-12-29"
        }
      ]
    }
  }
  ```

  ```json Rate Limit Error theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Created profile update tasks for 0 account(s), 2 failed",
    "data": {
      "message": "Created profile update tasks for 0 account(s), 2 failed",
      "successful": 0,
      "failed": 2,
      "results": [
        {
          "accountId": "acc_123456",
          "success": false,
          "error": "Nickname can only be updated once every 7 days. Last update was 3 days ago. You can update again in 4 day(s) on 2024-12-29"
        },
        {
          "accountId": "acc_789012",
          "success": false,
          "error": "Avatar can only be updated once every 24 hours. Last update was 12 hours ago. You can update again in 12 hour(s) on 2024-12-26"
        }
      ]
    }
  }
  ```

  ```json Invalid Aspect Ratio Error theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Created profile update tasks for 0 account(s), 1 failed",
    "data": {
      "message": "Created profile update tasks for 0 account(s), 1 failed",
      "successful": 0,
      "failed": 1,
      "results": [
        {
          "accountId": "acc_123456",
          "success": false,
          "error": "Avatar image must have a 1:1 aspect ratio. Current image is 1920x1080 (1.78:1)"
        }
      ]
    }
  }
  ```
</ResponseExample>
