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

# Refresh User Group Token

<Info>
  The End User Group API is now deprecated and has been replaced by the Customer
  API. Each End User Group entity corresponds to a Customer entity, with its
  `user_group_id` corresponding to a Customer `customer_id`.

  This API method has been replaced by <a href="/api-reference/customer-api/refresh-token">Refresh Customer Token</a>.
</Info>

This endpoint refreshes a user group token. This is useful when you want to force a user group token to rotate because an existing one may be compromised.

### Body

<ParamField body="current_token" type="string">
  This is the current user group token you have for the user group that you want
  to rotate.
</ParamField>

### Response

<ResponseField name="success" type="number">
  Indicates whether the call was successful. 1 if successful, 0 if not.
</ResponseField>

<ResponseField name="user_group" type="object">
  The contents of the user group

  <Expandable title="Toggle object">
    <ResponseField name="team_id" type="number">
      This is Explo's internal ID for this user group. You don't need to record this
      information, since you will not need to use it.
    </ResponseField>

    <ResponseField name="token" type="string">
      This is the user group token (customerToken or CUSTOMER\_TOKEN) that will be
      used to identify which user group is viewing the dashboard. You should save
      this on your end to use when rendering an embedded dashboard.
    </ResponseField>

    <ResponseField name="name" type="string">
      This is the name of the user group provided in the request body.
    </ResponseField>

    <ResponseField name="provided_id" type="string">
      This is the user\_group\_id provided in the request body.
    </ResponseField>

    <ResponseField name="api_environment_tag" type="JSON or null">
      This is the environment tag of the user group. Possible values are 'Customer'
      and 'Testing'. User group id's must be unique to each environment, so you can
      not create multiple user groups with with same id. If you have a production
      customer and a test user group with the same id, you will be required to label
      one as 'Customer' and another as 'Testing'
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.explo.co/api/refresh_user_group_token/' \
  --header 'Content-Type: application/json' \
  --header 'Explo-Authorization: Token <token>' \
  --data-raw '{
      "current_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": 1,
    "user_group": {
      "team_id": 3,
      "token": "<user_group_token_to_auth_dashboard>",
      "name": "Example 1",
      "provided_id": "example_1"
    }
  }
  ```
</ResponseExample>
