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

# Manage proxy consent for a User

> Allow a user to give or revoke consent for proxy actions

This endpoint allows your platform to manage consent given by the end user for [SCA-triggering actions taken under proxy](/guides/sca/proxy-management).

Your platform needs to retrieve the returned `PendingUserAction.RedirectUrl`, add an encoded `returnUrl` query parameter for them to be returned to after the SCA session, and redirect the user (read more about [SCA redirection](/guides/sca/session)).

On the SCA session link in the response, the user can:

* Give consent for the first time
* Give consent to additional actions included by your platform
* Revoke consent (which your platform must allow at any time)

Read more about [proxy consent for SCA-triggering actions](/guides/sca/proxy-management) **→**

### Path parameters

<ParamField path="UserId" type="string" required>
  The unique identifier of the user.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200" defaultOpen>
    <ResponseField name="PendingUserAction" type="object">
      Object containing the link needed for SCA redirection if triggered by the API call (otherwise returned `null`).

      <Expandable title="properties" defaultOpen>
        <ResponseField name="RedirectUrl" type="string">
          The URL to which to redirect the user to perform strong customer authentication (SCA) via a Mangopay-hosted webpage. This value is a variable and should not be hardcoded.

          The SCA session link expires 10 minutes after it's generated.

          **Caution:** Before redirecting the user on this URL, you must add the query parameter `ReturnUrl`  with the percent-encoded URL to which you want the SCA session to return the user after authentication (whether successful or not).

          For more details, see [How to redirect a user for an SCA session](/guides/sca/session#how-to-redirect-a-user-for-sca).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="400 - Proxy management not activated">
    ```json theme={null}
    {
        "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
        "Type": "param_error",
        "Id": "b66bd1bf-6176-4416-8e1e-82e4f5cffad7#1762179938",
        "Date": 1762179940,
        "errors": {
            "Invalid SCA request": "Consent cannot be given when no proxy is required by the client."
        }
    }
    ```
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
      "PendingUserAction": {
          "RedirectUrl": "https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13"
      }
  }
  ```
</ResponseExample>

<RequestExample>
  ```json REST theme={null}
  // This POST has no body
  ```

  ```csharp .NET theme={null}
  using MangoPay.SDK;
  using Newtonsoft.Json;

  public class EnrollUser
  {
      public void Run()
      {
          Task.Run(async () =>
          {
              MangoPayApi api = new MangoPayApi();

              api.Config.ClientId = "your-client-id";
              api.Config.ClientPassword = "your-api-key";

              var result =
                  await api.Users.ManageConsent("user_m_01K8B28H25JBHX1QFVC0T54S1Q");

              string prettyPrint = JsonConvert.SerializeObject(result, Formatting.Indented);
              Console.WriteLine(prettyPrint);
          }).GetAwaiter().GetResult();
      }
  }
  ```
</RequestExample>
