{
"Url": "https://example.com",
"Status": "DISABLED",
"Tag": "Created using the Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$hookId = '198685419';
$hook = $api->Hooks->Get($hookId);
$hook->Url = 'http://example.com';
$hook->Status = 'ENABLED';
$hook->Tag = 'Updated using Mangopay PHP SDK';
$response = $api->Hooks->Update($hook);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myHook = {
Id: '144086866',
Url: 'http://example.com2',
Tag: 'Created using Mangopay NodeJS SDK',
Status: 'ENABLED',
}
const updateHook = async (hook) => {
return await mangopay.Hooks.update(hook)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
updateHook(myHook)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def updateHook(hookId, params)
begin
response = MangoPay::Hook.update(hookId, params)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to update Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
myParams = {
Url: 'http://example.com',
Tag: 'Updated using Mangopay Ruby SDK'
}
updateHook(myHook[:Id], myParams)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.HookStatus;
import com.mangopay.entities.Hook;
public class UpdateHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Hook hook = new Hook();
hook.setId("hook_m_01J3JQ13F0M5NY83M1GZKVNS95");
hook.setStatus(HookStatus.DISABLED);
hook.setTag("Updated using the Mangopay Java SDK");
Hook updateHook = mangopay.getHookApi().update(hook);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateHook);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hook = Notification(
id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B',
status = 'DISABLED'
)
update_hook = hook.save()
pprint(update_hook)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var hook = new HookPutDTO {
Status = HookStatus.DISABLED,
Tag = "Updated using the Mangopay .NET SDK"
};
var updateHook = await api.Hooks.UpdateAsync(hook, hookId);
string prettyPrint = JsonConvert.SerializeObject(updateHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Url": "https://example.com",
"Status": "DISABLED",
"Validity": "VALID",
"EventType": "UBO_DECLARATION_VALIDATION_ASKED",
"Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
"Tag": "Created using the Mangopay API Postman Collection",
"CreationDate": 1655991027
}
Webhooks
Update a Hook
PUT
/
v.2.01
/
{ClientId}
/
hooks
/
{HookId}
{
"Url": "https://example.com",
"Status": "DISABLED",
"Tag": "Created using the Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$hookId = '198685419';
$hook = $api->Hooks->Get($hookId);
$hook->Url = 'http://example.com';
$hook->Status = 'ENABLED';
$hook->Tag = 'Updated using Mangopay PHP SDK';
$response = $api->Hooks->Update($hook);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myHook = {
Id: '144086866',
Url: 'http://example.com2',
Tag: 'Created using Mangopay NodeJS SDK',
Status: 'ENABLED',
}
const updateHook = async (hook) => {
return await mangopay.Hooks.update(hook)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
updateHook(myHook)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def updateHook(hookId, params)
begin
response = MangoPay::Hook.update(hookId, params)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to update Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
myParams = {
Url: 'http://example.com',
Tag: 'Updated using Mangopay Ruby SDK'
}
updateHook(myHook[:Id], myParams)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.HookStatus;
import com.mangopay.entities.Hook;
public class UpdateHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Hook hook = new Hook();
hook.setId("hook_m_01J3JQ13F0M5NY83M1GZKVNS95");
hook.setStatus(HookStatus.DISABLED);
hook.setTag("Updated using the Mangopay Java SDK");
Hook updateHook = mangopay.getHookApi().update(hook);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateHook);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hook = Notification(
id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B',
status = 'DISABLED'
)
update_hook = hook.save()
pprint(update_hook)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var hook = new HookPutDTO {
Status = HookStatus.DISABLED,
Tag = "Updated using the Mangopay .NET SDK"
};
var updateHook = await api.Hooks.UpdateAsync(hook, hookId);
string prettyPrint = JsonConvert.SerializeObject(updateHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Url": "https://example.com",
"Status": "DISABLED",
"Validity": "VALID",
"EventType": "UBO_DECLARATION_VALIDATION_ASKED",
"Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
"Tag": "Created using the Mangopay API Postman Collection",
"CreationDate": 1655991027
}
Caution – Setting email for consecutive failures after April 2026In Production, if your platform had
VALID Hook objects before April 2, 2026, then Mangopay automatically populates the Email property with the previously used global address unless and until you set it proactively using this endpoint.If you send the Email on a POST or PUT request, other new Hooks created without the Email do not populate the Email automatically and do not emit alerts in case of consecutive failed notifications or if the Hook becomes INVALID.Platforms integrating after April 2, 2026 must proactively set the Email to receive alerts.Read more about this change →Path parameters
string
The unique identifier of the hook.
Body parameters
string
Max. length: 255 charactersThe URL to which the notification is sent.
string
Allowed values:
DISABLED, ENABLEDWhether the hook is enabled or not.string
Max. length: 255 charactersCustom data that you can add to this object.
string | null
Format: A valid email addressThe
Email address to which alerts are sent in case of consecutive failed notification attempts.Caution: Mangopay may populate this property automatically if your platform had webhooks integrated in Production before April 2, 2026. If so, setting the Email on a single Hook stops this automatic population for any new Hooks you create - read more.For all platforms, if this property is returned null then no alerts are sent but the Hook still becomes INVALID after 100 consecutive failed notifications.Responses
200
200
string
Max. length: 255 charactersThe URL to which the notification is sent.
string
Returned values:
DISABLED, ENABLEDWhether the hook is enabled or not.string
Returned values:
VALID, INVALIDWhether the hook is valid or not. Once INVALID (following unsuccessful retries) the hook must be disabled and re-enabled.string
Returned values: An
EventType listed in the event types listThe type of the event.string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
string
Max. length: 255 charactersCustom data that you can add to this object.
Unix timestamp
The date and time at which the object was created.
{
"Url": "https://example.com",
"Status": "DISABLED",
"Validity": "VALID",
"EventType": "UBO_DECLARATION_VALIDATION_ASKED",
"Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
"Tag": "Created using the Mangopay API Postman Collection",
"CreationDate": 1655991027
}
{
"Url": "https://example.com",
"Status": "DISABLED",
"Tag": "Created using the Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$hookId = '198685419';
$hook = $api->Hooks->Get($hookId);
$hook->Url = 'http://example.com';
$hook->Status = 'ENABLED';
$hook->Tag = 'Updated using Mangopay PHP SDK';
$response = $api->Hooks->Update($hook);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myHook = {
Id: '144086866',
Url: 'http://example.com2',
Tag: 'Created using Mangopay NodeJS SDK',
Status: 'ENABLED',
}
const updateHook = async (hook) => {
return await mangopay.Hooks.update(hook)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
updateHook(myHook)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def updateHook(hookId, params)
begin
response = MangoPay::Hook.update(hookId, params)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to update Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
myParams = {
Url: 'http://example.com',
Tag: 'Updated using Mangopay Ruby SDK'
}
updateHook(myHook[:Id], myParams)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.HookStatus;
import com.mangopay.entities.Hook;
public class UpdateHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Hook hook = new Hook();
hook.setId("hook_m_01J3JQ13F0M5NY83M1GZKVNS95");
hook.setStatus(HookStatus.DISABLED);
hook.setTag("Updated using the Mangopay Java SDK");
Hook updateHook = mangopay.getHookApi().update(hook);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateHook);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hook = Notification(
id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B',
status = 'DISABLED'
)
update_hook = hook.save()
pprint(update_hook)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var hook = new HookPutDTO {
Status = HookStatus.DISABLED,
Tag = "Updated using the Mangopay .NET SDK"
};
var updateHook = await api.Hooks.UpdateAsync(hook, hookId);
string prettyPrint = JsonConvert.SerializeObject(updateHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I