> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/users/manage-proxy-consent/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Manage proxy consent for a User POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/sca/users/{UserId}/consent 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) **→**" Reference: https://docs.mangopay.com/api-reference/users/manage-proxy-consent ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL. ## Servers - `https://api.sandbox.mangopay.com` (Sandbox, default) - `https://api.mangopay.com` (Production) - `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox) - `https://api-mtls.mangopay.com` (mTLS Production) ## Request ### Path parameters - `ClientId` (string, required) — Platform's API account identifier, associated with the API key. - `UserId` (string, required) — The unique identifier of the user. ## Response ### 200 Success - `PendingUserAction` (PendingUserAction, optional) — Object containing the `RedirectUrl` needed for SCA redirection if triggered by the API call (otherwise returned `null`). ## Errors ### 400 Bad Request Error Bad Request - `Message` (string, optional) — Description of the error. - `Type` (string, optional) — The category of the error. - `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support. - `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered. - `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors. ## Types ### PendingUserAction Object containing the `RedirectUrl` needed for SCA redirection if triggered by the API call (otherwise returned `null`). - `RedirectUrl` (string, optional) — 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). ## Examples **Response** ```json { "PendingUserAction": { "RedirectUrl": "string" } } ``` **SDK Code** ```csharp 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(); } } ```