enablePolicy/{id}
curl --request PUT \
--url https://rpc.etherspot.io/paymaster/enablePolicy/{id} \
--header 'apikey: <apikey>'import requests
url = "https://rpc.etherspot.io/paymaster/enablePolicy/{id}"
headers = {"apikey": "<apikey>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {apikey: '<apikey>'}};
fetch('https://rpc.etherspot.io/paymaster/enablePolicy/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.etherspot.io/paymaster/enablePolicy/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rpc.etherspot.io/paymaster/enablePolicy/{id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://rpc.etherspot.io/paymaster/enablePolicy/{id}")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.etherspot.io/paymaster/enablePolicy/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_body{
"message": "Successfully enabled policy with id 123"
}{
"error": "Invalid sponsorship policy ID or API key does not exist for the wallet address"
}{
"error": "Wallet address does not match for the API key"
}{
"error": "Sponsorship policy not found"
}{
"error": "Failed to enable sponsorship policy"
}Arka API calls
enablePolicy/{id}
Enables an existing sponsorship policy by its ID.
PUT
/
enablePolicy
/
{id}
enablePolicy/{id}
curl --request PUT \
--url https://rpc.etherspot.io/paymaster/enablePolicy/{id} \
--header 'apikey: <apikey>'import requests
url = "https://rpc.etherspot.io/paymaster/enablePolicy/{id}"
headers = {"apikey": "<apikey>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {apikey: '<apikey>'}};
fetch('https://rpc.etherspot.io/paymaster/enablePolicy/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.etherspot.io/paymaster/enablePolicy/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rpc.etherspot.io/paymaster/enablePolicy/{id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://rpc.etherspot.io/paymaster/enablePolicy/{id}")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.etherspot.io/paymaster/enablePolicy/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_body{
"message": "Successfully enabled policy with id 123"
}{
"error": "Invalid sponsorship policy ID or API key does not exist for the wallet address"
}{
"error": "Wallet address does not match for the API key"
}{
"error": "Sponsorship policy not found"
}{
"error": "Failed to enable sponsorship policy"
}Example values you can use to demo the API:
Example response:
{
"headers": {
"apikey": "your_api_key_here"
},
"pathVariables": {
"id": "policy_id_here"
}
}
{
"message": "Policy enabled successfully."
}
⌘I

