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

# Update User

> Update the account or user data of the social network

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/docs/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

Update the account or user data of the social network. Currently Google Business Profile and WhatsApp are supported.

<Note>Google limits updating some Google Business Profile location fields to being updated 5 times
within a rolling 24-hour period. For example updating `phoneNumbers` more than 5 times in a
rolling 24-hour period will return a 400 Response. This limit is specific to Google Business
Profile and does not apply to WhatsApp.</Note>

## Header Parameters

<HeaderAPI />

## Path Parameters

<ParamField path=":platform" type="string" required>
  Values: `gbp`, `whatsapp`
</ParamField>

## Body Parameters

<ParamField body="phoneNumbers" type="object">
  Object containing the different phone numbers that customers can use to get in touch with the business.

  ```json theme={"system"}
  "phoneNumbers": {
      "primaryPhone": "212-123-4567",
      "additionalPhones": [
          "212-432-2342"
      ]
  }
  ```
</ParamField>

<ParamField body="name" type="string">
  Google identifier for this location in the form.
</ParamField>

<ParamField body="adPhone" type="string">
  An alternate phone number to display on AdWords location extensions instead of the location's
  primary phone number.
</ParamField>

<ParamField body="storeCode" type="string">
  External identifier for this location, which must be unique within a given account. This is a
  means of associating the location with your own records.
</ParamField>

<ParamField body="title" type="string">
  Location name should reflect your business's real-world name, as used consistently on your storefront, website, and stationery, and as known to customers.
</ParamField>

<ParamField body="websiteUrl" type="string">
  A URL for this business.
</ParamField>

<ParamField body="labels" type="array">
  A collection of free-form strings to allow you to tag your business. These labels are not user facing; only you can see them. Must be between 1-255 characters per label.
</ParamField>

<ParamField body="latlng" type="object">
  An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard.

  ```json theme={"system"}
  {
      "latitude": number,
      "longitude": number
  }
  ```

  Values must be within normalized ranges.

  The latitude in degrees. It must be in the range \[-90.0, +90.0].

  The longitude in degrees. It must be in the range \[-180.0, +180.0].
</ParamField>

<ParamField body="profile" type="object">
  This field contains a description of the location in your own voice. The description is not editable by anyone else.

  ```json theme={"system"}
  {
      "description": string
  }
  ```
</ParamField>

### WhatsApp

<Info>
  **WhatsApp is in Private Beta.** Updating a WhatsApp business profile requires an account
  approved for WhatsApp. If you'd like early access, email
  [lotty@ayrshare.com](mailto:lotty@ayrshare.com).
</Info>

Send only the fields you want to change. At least one is required, and sending a field that this
endpoint does not recognize rejects the entire request.

To **clear** a field, send it as an empty string: `{"description": ""}` removes the description,
and the field then stops appearing in the profile at all. This works for `description`, `address`
and `email`. It does not work for `about`, which WhatsApp requires to be at least one character —
to change that one, overwrite it. `vertical` cannot be cleared either, once it has been set.

The response fields `messaging_product` and `profile_picture_url` (see [WhatsApp Business
Profile](/docs/apis/user/whatsapp-profile)) are read-only: sending either one back is rejected as an
unrecognized field. Use `profilePictureUrl` to set the photo.

<ParamField body="about" type="string">
  Text shown beneath the profile image. 1–139 characters. This is the one text field WhatsApp
  will not let you clear — overwrite it instead.
</ParamField>

<ParamField body="description" type="string">
  Business description. Up to 512 characters. Send `""` to clear it.
</ParamField>

<ParamField body="address" type="string">
  Business address. Up to 256 characters. Send `""` to clear it.
</ParamField>

<ParamField body="email" type="string">
  Contact email address. Up to 128 characters, and must be a valid address unless you are
  sending `""` to clear it.
</ParamField>

<ParamField body="websites" type="array">
  A non-empty array of up to 2 URLs, each starting with `http://` or `https://`.
</ParamField>

<ParamField body="vertical" type="string">
  Business category. WhatsApp currently accepts: `OTHER`, `AUTO`, `BEAUTY`, `APPAREL`,
  `EDU`, `ENTERTAIN`, `EVENT_PLAN`, `FINANCE`, `GROCERY`, `GOVT`, `HOTEL`, `HEALTH`,
  `NONPROFIT`, `PROF_SERVICES`, `RETAIL`, `TRAVEL`, `RESTAURANT`, `ALCOHOL`,
  `ONLINE_GAMBLING`, `PHYSICAL_GAMBLING`, `OTC_DRUGS`, `MATRIMONY_SERVICE`. This list is
  WhatsApp's and may grow over time — Ayrshare does not restrict the value, so any
  category WhatsApp accepts works. Normalized to uppercase, so a value sent as `retail`
  is returned as `RETAIL`. WhatsApp does not allow the category to be cleared once it has
  been set, and rejects a value it does not accept — the rejection is returned as a `101`
  with WhatsApp's own message naming the currently accepted values.
</ParamField>

<ParamField body="profilePictureUrl" type="string">
  Publicly reachable JPEG or PNG, 5 MB or smaller. The image must be square and at least
  192×192 — 640×640 is recommended. There is no maximum resolution: a larger image is
  accepted and scaled down by WhatsApp. An image that is not square or is below 192×192
  is rejected with a `400` naming the problem, before anything is sent to WhatsApp. See the
  [WhatsApp media guidelines](/docs/media-guidelines/whatsapp) for the full requirements.
</ParamField>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
      "gmb": {
          "status": "success",
          "data": {
              "name": "locations/4913369732395328466",
              "languageCode": "en",
              "title": "Ayrshare",
              "phoneNumbers": {},
              "categories": {
                  "primaryCategory": {
                      "name": "categories/gcid:software_company",
                      "displayName": "Software company",
                      "serviceTypes": [
                          {
                              "serviceTypeId": "job_type_id:application_development",
                              "displayName": "Application development"
                          },
                          {
                              "serviceTypeId": "job_type_id:big_data_consulting_and_implementation",
                              "displayName": "Big data consulting & implementation"
                          },
                          {
                              "serviceTypeId": "job_type_id:data_center_management",
                              "displayName": "Data center management"
                          },
                          {
                              "serviceTypeId": "job_type_id:data_quality_management",
                              "displayName": "Data quality management"
                          },
                          {
                              "serviceTypeId": "job_type_id:enterprise_software_development",
                              "displayName": "Enterprise software development"
                          },
                          {
                              "serviceTypeId": "job_type_id:it_consulting",
                              "displayName": "It consulting"
                          },
                          {
                              "serviceTypeId": "job_type_id:mobile_app_development",
                              "displayName": "Mobile app development"
                          },
                          {
                              "serviceTypeId": "job_type_id:platform_consulting",
                              "displayName": "Platform consulting"
                          },
                          {
                              "serviceTypeId": "job_type_id:security_services_management",
                              "displayName": "Security services management"
                          },
                          {
                              "serviceTypeId": "job_type_id:software_consulting",
                              "displayName": "Software consulting"
                          },
                          {
                              "serviceTypeId": "job_type_id:software_development",
                              "displayName": "Software development"
                          },
                          {
                              "serviceTypeId": "job_type_id:software_development_outsourcing",
                              "displayName": "Software development outsourcing"
                          },
                          {
                              "serviceTypeId": "job_type_id:solution_consulting",
                              "displayName": "Solution consulting"
                          }
                      ],
                      "moreHoursTypes": [
                          {
                              "hoursTypeId": "ACCESS",
                              "displayName": "Access",
                              "localizedDisplayName": "Access"
                          },
                          {
                              "hoursTypeId": "BREAKFAST",
                              "displayName": "Breakfast",
                              "localizedDisplayName": "Breakfast"
                          },
                          {
                              "hoursTypeId": "BRUNCH",
                              "displayName": "Brunch",
                              "localizedDisplayName": "Brunch"
                          },
                          {
                              "hoursTypeId": "DELIVERY",
                              "displayName": "Delivery",
                              "localizedDisplayName": "Delivery"
                          },
                          {
                              "hoursTypeId": "DINNER",
                              "displayName": "Dinner",
                              "localizedDisplayName": "Dinner"
                          },
                          {
                              "hoursTypeId": "DRIVE_THROUGH",
                              "displayName": "Drive through",
                              "localizedDisplayName": "Drive through"
                          },
                          {
                              "hoursTypeId": "HAPPY_HOUR",
                              "displayName": "Happy hours",
                              "localizedDisplayName": "Happy hours"
                          },
                          {
                              "hoursTypeId": "KITCHEN",
                              "displayName": "Kitchen",
                              "localizedDisplayName": "Kitchen"
                          },
                          {
                              "hoursTypeId": "LUNCH",
                              "displayName": "Lunch",
                              "localizedDisplayName": "Lunch"
                          },
                          {
                              "hoursTypeId": "ONLINE_SERVICE_HOURS",
                              "displayName": "Online service hours",
                              "localizedDisplayName": "Online service hours"
                          },
                          {
                              "hoursTypeId": "PICKUP",
                              "displayName": "Pickup",
                              "localizedDisplayName": "Pickup"
                          },
                          {
                              "hoursTypeId": "TAKEOUT",
                              "displayName": "Takeout",
                              "localizedDisplayName": "Takeout"
                          },
                          {
                              "hoursTypeId": "SENIOR_HOURS",
                              "displayName": "Senior hours",
                              "localizedDisplayName": "Senior hours"
                          }
                      ]
                  },
                  "additionalCategories": [
                      {
                          "name": "categories/gcid:automation_company",
                          "displayName": "Automation company",
                          "moreHoursTypes": [
                              {
                                  "hoursTypeId": "ACCESS",
                                  "displayName": "Access",
                                  "localizedDisplayName": "Access"
                              },
                              {
                                  "hoursTypeId": "BREAKFAST",
                                  "displayName": "Breakfast",
                                  "localizedDisplayName": "Breakfast"
                              },
                              {
                                  "hoursTypeId": "BRUNCH",
                                  "displayName": "Brunch",
                                  "localizedDisplayName": "Brunch"
                              },
                              {
                                  "hoursTypeId": "DELIVERY",
                                  "displayName": "Delivery",
                                  "localizedDisplayName": "Delivery"
                              },
                              {
                                  "hoursTypeId": "DINNER",
                                  "displayName": "Dinner",
                                  "localizedDisplayName": "Dinner"
                              },
                              {
                                  "hoursTypeId": "DRIVE_THROUGH",
                                  "displayName": "Drive through",
                                  "localizedDisplayName": "Drive through"
                              },
                              {
                                  "hoursTypeId": "HAPPY_HOUR",
                                  "displayName": "Happy hours",
                                  "localizedDisplayName": "Happy hours"
                              },
                              {
                                  "hoursTypeId": "KITCHEN",
                                  "displayName": "Kitchen",
                                  "localizedDisplayName": "Kitchen"
                              },
                              {
                                  "hoursTypeId": "LUNCH",
                                  "displayName": "Lunch",
                                  "localizedDisplayName": "Lunch"
                              },
                              {
                                  "hoursTypeId": "ONLINE_SERVICE_HOURS",
                                  "displayName": "Online service hours",
                                  "localizedDisplayName": "Online service hours"
                              },
                              {
                                  "hoursTypeId": "PICKUP",
                                  "displayName": "Pickup",
                                  "localizedDisplayName": "Pickup"
                              },
                              {
                                  "hoursTypeId": "TAKEOUT",
                                  "displayName": "Takeout",
                                  "localizedDisplayName": "Takeout"
                              },
                              {
                                  "hoursTypeId": "SENIOR_HOURS",
                                  "displayName": "Senior hours",
                                  "localizedDisplayName": "Senior hours"
                              }
                          ]
                      }
                  ]
              },
              "storefrontAddress": {
                  "regionCode": "US",
                  "languageCode": "en",
                  "postalCode": "10019",
                  "administrativeArea": "NY",
                  "locality": "New York",
                  "addressLines": [
                      "142 W 57th St"
                  ]
              },
              "websiteUri": "https://www.ayrshare.com/",
              "regularHours": {
                  "periods": [
                      {
                          "openDay": "SUNDAY",
                          "openTime": {},
                          "closeDay": "SUNDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "MONDAY",
                          "openTime": {},
                          "closeDay": "MONDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "TUESDAY",
                          "openTime": {},
                          "closeDay": "TUESDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "WEDNESDAY",
                          "openTime": {},
                          "closeDay": "WEDNESDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "THURSDAY",
                          "openTime": {},
                          "closeDay": "THURSDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "FRIDAY",
                          "openTime": {},
                          "closeDay": "FRIDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      },
                      {
                          "openDay": "SATURDAY",
                          "openTime": {},
                          "closeDay": "SATURDAY",
                          "closeTime": {
                              "hours": 24
                          }
                      }
                  ]
              },
              "serviceArea": {
                  "businessType": "CUSTOMER_AND_BUSINESS_LOCATION",
                  "places": {
                      "placeInfos": [
                          {
                              "placeName": "United States",
                              "placeId": "ChIJCzYy5IS16lQRQrfeQ5K5Oxw"
                          }
                      ]
                  },
                  "regionCode": "US"
              },
              "openInfo": {
                  "status": "OPEN",
                  "canReopen": true
              },
              "metadata": {
                  "hasPendingEdits": true,
                  "canDelete": true,
                  "canModifyServiceList": true,
                  "placeId": "ChIJN53jw8BZwokRBEeVVtPLkkg",
                  "mapsUri": "https://maps.google.com/maps?cid=5229466225881728772",
                  "newReviewUri": "https://search.google.com/local/writereview?placeid=ChIJN53jw8BZwokRBEeVVtPLkkg",
                  "hasVoiceOfMerchant": true
              },
              "profile": {
                  "description": "Easy to integrate Social Media APIs allow you to manage all your users' social accounts right from your product. Post, Auto Schedule, and Analytics. Great for SaaS, CMS, DAM, Agencies, and Apps."
              }
          }
      }
  }
  ```

  ```json 400: Too Many Updates theme={"system"}
  {
      "action": "authorization",
      "status": "error",
      "code": 227,
      "message": "Error updating GBP location data. This can occur if you attempt more than 5 updates within a rolling 24 hours period. Please wait and try again."
  }
  ```

  ```json 200: Success (WhatsApp) theme={"system"}
  {
    "whatsapp": {
      "status": "success",
      "data": {
        "messaging_product": "whatsapp",
        "about": "Open 9am-6pm",
        "description": "Bike shop since 1998",
        "address": "123 Example St, Springfield",
        "email": "hello@example.com",
        "websites": ["https://example.com"],
        "vertical": "RETAIL",
        "profile_picture_url": "https://scontent.whatsapp.net/..."
      }
    }
  }
  ```

  ```json 400: Missing or Incorrect Parameters (WhatsApp) theme={"system"}
  {
    "action": "request",
    "status": "error",
    "code": 101,
    "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
    "details": "`about` must be 139 characters or fewer (received 150)."
  }
  ```

  ```json 400: WhatsApp Not Linked theme={"system"}
  {
    "action": "post",
    "status": "error",
    "code": 156,
    "message": "whatsapp is not linked. Please confirm the linkage on the Social Accounts page in the dashboard. https://www.ayrshare.com/docs/dashboard/connect-social-accounts/overview"
  }
  ```

  ```json 403: WhatsApp Not Enabled theme={"system"}
  {
    "action": "request",
    "status": "error",
    "code": 472,
    "message": "This feature is not yet available on your account. Please contact us if you'd like early access."
  }
  ```

  ```json 429: Too Many Requests (WhatsApp) theme={"system"}
  {
    "action": "rate limit",
    "status": "error",
    "code": 364,
    "message": "You are making too many requests. Please reduce the number of requests.",
    "details": "Meta rejected the WhatsApp profile request."
  }
  ```

  ```json 500: Connection Issue (WhatsApp) theme={"system"}
  {
    "action": "authorization",
    "status": "error",
    "code": 141,
    "message": "There was an issue connecting. Please try linking the social account again.",
    "details": "Network error updating the WhatsApp business profile."
  }
  ```
</ResponseExample>
