Once you've registered as an RCS for Business partner, you have a partner
account. To access your partner account settings, open the
[RCS for Business Developer Console](https://business-communications.cloud.google.com/?utm_source=/business-communications/business-messages/guides/how-to/agents&utm_medium=devsite&utm_campaign=rcs-business-messaging)
and click **Partner account settings**. From here, you can do the following:

- [Update your partner account information](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account#update_partner_account_information)
- [Add, edit, and remove the brands linked to your account](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account#manage_brands)
- [Manage account users](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account#manage_users)
- [Create a service account and key to authenticate API calls](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account#set_up_service_account_to_authenticate_api_calls)

## Update partner account information

From the **Settings** page, you can view your partner ID and update the
following information:

| Field | Description |
|---|---|
| Partner name | Name of your partner account |
| Display name | Name will appear in the [billing reports](https://developers.google.com/business-communications/rcs-business-messaging/carriers/reports#format) that carriers receive (as the `owner_name` field). Carriers will use this to identify you as a trusted partner and generate the correct invoicing information for your use of RCS for Business to reach their subscribers. The name you provide here should align with the name used in your carrier messaging contracts. |
| Technical point of contact | The person Google will contact if there are any technical issues with your agents. You can update their - Name - Corporate email address - Phone number |
| Webhook | This is your webhook endpoint URL. Click **Configure** to update it. When you [configure your partner webhook](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account#configure_your_partner_webhook), it applies to all of your agents. If you want to use a different webhook for an individual agent, you can [configure an agent webhook](https://developers.google.com/business-communications/rcs-business-messaging/guides/integrate/webhooks#configure_an_agent_webhook) that will only apply to that agent. |

## Manage brands

As an RCS for Business partner, you can create agents on behalf of
[brands](https://developers.google.com/business-communications/rcs-business-messaging/reference/glossary#brand).

Use the **Brands** page in the [Account settings](https://business-communications.cloud.google.com/console/partner/settings?utm_source=/business-communications/business-messages/guides/how-to/set-webhook&utm_medium=devsite&utm_campaign=rcs-business-messaging)
to add, edit, and remove the brands associated
with your partner account.

### Add a brand

> [!NOTE]
> **Note:** To add a brand using the RBM Management API, refer to the [Create a brand](https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/brands#create_a_brand) documentation.

To add a brand, enter its name in the input field and click **Add**.

### Edit a brand

> [!NOTE]
> **Note:** To edit a brand using the RBM Management API, refer to the [Rename a brand](https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/brands#rename_a_brand) documentation.

To edit a brand:

1. Click the checkbox next to the brand's name.
2. Click the button, and click **Edit name**.
3. Make your edits, and click **Done**.

### Remove a brand

A brand can't be removed if it's associated with an agent, even if the agent
is not launched.

To remove a brand, click the checkbox next to the brand's name, and click
**Delete**.

## Manage users

The **Users** page in the [Account settings](https://business-communications.cloud.google.com/console/partner/settings?utm_source=/business-communications/business-messages/guides/how-to/set-webhook&utm_medium=devsite&utm_campaign=rcs-business-messaging)
is where you manage the users of your partner account. The user who created the
partner account has the role of Owner. New users can have the role of Manager or
Reader.

- **Managers** can access all the capabilities of the Developer Console, to manage any and all agents belonging to the partner account.
- **Readers** have read-only access to the Developer Console, to view any and all agents belonging to the partner account.

### Add a user

To add a user, enter their email address in the input field and select their
**Role**.

When you add a new user, they receive an email notifying them that they have
access to the partner account.

### Remove a user

To remove a user:

1. Find the user you want to remove, and click the button in their table row.
2. Select **Remove user**.
3. Confirm the removal.

The user you removed receives an email notifying them that they no longer have
access to the partner account.

You can't remove a user with an Owner role. To change or remove the Owner, you
need to reach out to [support](https://support.google.com/messages/contact/contact_us).

### Change a user's role

To update a user's role:

1. Find the user you want to update, and click the button in their table row.
2. Select **Edit role**.
3. Choose a new role from the drop-down.
4. Click **Save**.

## Set up service account to authenticate API calls

When you make calls to the [RBM API](https://developers.google.com/business-communications/rcs-business-messaging/reference/rest),
you authenticate calls with a service account key. This key lets you create
and manage brands and agents, and to send messages and requests as an agent.
A service account can have up to 10 keys.

To securely authenticate API calls, you also need the
[oauth2l](https://github.com/google/oauth2l) command line tool.

Follow these steps to generate a service account key:

1. In the [Account settings](https://business-communications.cloud.google.com/console/partner/settings?utm_source=/business-communications/business-messages/guides/how-to/set-webhook&utm_medium=devsite&utm_campaign=rcs-business-messaging), navigate to the **Service account** page.
2. Click **Create key** , then click **Create**. Your browser downloads the service account key.

Store your service account key in a secure, private location. Don't share your
key publicly. You'll need this key later to access the RBM APIs.

## Configure your partner webhook

To learn how to configure your partner webhook, see the
[Webhooks](https://developers.google.com/business-communications/rcs-business-messaging/guides/integrate/webhooks#configure_an_agent_webhook)
guide.

For guidance on processing webhooks asynchronously to prevent delivery
failures, see [Message handling](https://developers.google.com/business-communications/rcs-business-messaging/guides/integrate/webhooks#message_handling).

## Verify incoming messages

Because webhooks can receive messages from any senders, you should verify that
Google sent incoming messages before processing message content.

To verify that Google sent a message you received, follow these steps:

1. Extract the message's `X-Goog-Signature` header. This is a hashed, base64-encoded copy of the message body payload.
2. Base-64-decode the RBM payload in the `message.body` element of the request.
3. Using your webhook's client token (which you specified when you set up your webhook) as a key, create a SHA512 HMAC of the bytes of the base-64 decoded message payload and base64-encode the result.
4. Compare the `X-Goog-Signature` hash with the hash you created.
   - If the hashes match, you've confirmed that Google sent the message.
   - If the hashes don't match, check your hashing process on a known-good
     message.

     If your hashing process is working correctly and you receive a
     message that you believe was fraudulently sent to you,
     [contact us](https://support.google.com/messages/contact/contact_us).

### Node.js

```javascript
  if ((requestBody.hasOwnProperty('message')) && (requestBody.message.hasOwnProperty('data'))) {
    // Validate the received hash to ensure the message came from Google RBM
    const headerHash = req.header('X-Goog-Signature');
    const userEventString = Buffer.from(requestBody.message.data, 'base64');
    const hmac = crypto.createHmac('sha512', myClientToken);
    const genHash = hmac.update(userEventString).digest('base64');

    if (headerHash === genHash) {
      const userEvent = JSON.parse(userEventString);
      const webhookType = req.header('X-Goog-Webhook-Type');

      // Route based on the header type
      if (webhookType === 'message_callback') {
        handleMessage(userEvent);
      } else if (webhookType === 'agent_callback') {
        handleAgentEvent(userEvent);
      }
    } else {
      console.log('Hash mismatch - ignoring message');
      res.sendStatus(401);
      return;
    }
  }

  res.sendStatus(200);
  
```

## Next steps

Now that your partner account is set up, it's time to
[build your first agent](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/first-agent).