> ## 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.

# Edit Profile

> Update account profile information

## Path Parameters

<ParamField path="accountId" type="string" required>
  The unique account identifier.
</ParamField>

## Request Body

<ParamField body="platform" type="string" required>
  Platform to update: `tiktok` or `instagram`.
</ParamField>

<ParamField body="name" type="string">
  New display name.

  **Restrictions:**

  * TikTok: Can change once every 7 days (after Day 5 of warmup)
  * Instagram: Can change once every 14 days
</ParamField>

<ParamField body="username" type="string">
  New username. **Instagram only** - TikTok does not support username changes via this endpoint.

  **Restrictions:**

  * Instagram: No restriction on username changes
</ParamField>

<ParamField body="bio" type="string">
  New bio/description. No restrictions on frequency.
</ParamField>

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

  **IMPORTANT: Image must have a 1:1 aspect ratio (square).** Non-square images will be rejected.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the profile was updated successfully.
</ResponseField>

<ResponseField name="accountId" type="string">
  Account identifier.
</ResponseField>

<ResponseField name="platform" type="string">
  Platform: `tiktok` or `instagram`.
</ResponseField>

<ResponseField name="name" type="string">
  Updated display name.
</ResponseField>

<ResponseField name="username" type="string">
  Updated username (Instagram only).
</ResponseField>

<ResponseField name="bio" type="string">
  Updated bio.
</ResponseField>

<ResponseField name="profilePictureUrl" type="string">
  Updated profile picture URL.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp of when the profile was updated.
</ResponseField>

<ResponseField name="nextNameChangeAllowed" type="string">
  ISO 8601 timestamp of when the name can be changed again (if name was changed).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.infinipost.co/v1/accounts/acc_1a2b3c4d5e/profile \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "platform": "instagram",
      "bio": "Premium fashion content daily 👗✨",
      "profilePictureUrl": "https://example.com/new-pic.jpg"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.infinipost.co/v1/accounts/acc_1a2b3c4d5e/profile', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      platform: 'instagram',
      bio: 'Premium fashion content daily 👗✨',
      profilePictureUrl: 'https://example.com/new-pic.jpg'
    })
  });

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

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

  response = requests.patch(
      'https://api.infinipost.co/v1/accounts/acc_1a2b3c4d5e/profile',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'platform': 'instagram',
          'bio': 'Premium fashion content daily 👗✨',
          'profilePictureUrl': 'https://example.com/new-pic.jpg'
      }
  )

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

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "accountId": "acc_1a2b3c4d5e",
    "platform": "instagram",
    "name": "Fashion Insider",
    "username": "fashioninsider",
    "bio": "Premium fashion content daily 👗✨",
    "profilePictureUrl": "https://storage.googleapis.com/...",
    "updatedAt": "2024-04-21T19:45:00Z"
  }
  ```
</ResponseExample>

<Warning>
  **Name Change Restrictions**

  Attempting to change the name before the allowed time will return a `429` error with the next allowed change date.
</Warning>

## Error Responses

```json Name Change Too Soon theme={null}
{
  "error": {
    "code": "name_change_restricted",
    "message": "You can change your TikTok name again on 2024-04-28",
    "nextAllowedAt": "2024-04-28T10:00:00Z"
  }
}
```

```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 Username Not Supported (TikTok) theme={null}
{
  "error": {
    "code": "invalid_parameter",
    "message": "Username changes are only supported for Instagram accounts"
  }
}
```
