Update entity country activation
curl --request PATCH \
--url http://api.gu1.ai/entities/{id}/country-activations/{countryCode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'import requests
url = "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}"
payload = { "status": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: '<string>'})
};
fetch('http://api.gu1.ai/entities/{id}/country-activations/{countryCode}', 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 => "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}"
payload := strings.NewReader("{\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://api.gu1.ai/entities/{id}/country-activations/{countryCode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/country-activations/{countryCode}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
Update entity country activation
Update country activation status for a merchant entity. Idempotent when status is unchanged; emits entity.country_activation_changed webhook on change.
PATCH
/
entities
/
{id}
/
country-activations
/
{countryCode}
Update entity country activation
curl --request PATCH \
--url http://api.gu1.ai/entities/{id}/country-activations/{countryCode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'import requests
url = "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}"
payload = { "status": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: '<string>'})
};
fetch('http://api.gu1.ai/entities/{id}/country-activations/{countryCode}', 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 => "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://api.gu1.ai/entities/{id}/country-activations/{countryCode}"
payload := strings.NewReader("{\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://api.gu1.ai/entities/{id}/country-activations/{countryCode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/country-activations/{countryCode}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyOverview
Sets the operational activation status for one country on a merchant entity. This does not modify entity profile data β useGET /entities/{id} to re-fetch the dossier after activation.
On every real status change, Gu1 emits the entity.country_activation_changed webhook to subscribed endpoints. Transitions between statuses are free-form (any status may move to any other).
Supported countryCode values: AR, BR, CL, CO, MX, US (case-insensitive).
Endpoint
PATCH http://api.gu1.ai/entities/{id}/country-activations/{countryCode}
Authentication
Requiresentities:edit (legacy fallback: entities:write).
Authorization: Bearer YOUR_API_KEY
Path Parameters
string
required
UUID of the entity (merchant).
string
required
ISO 3166-1 alpha-2 country to update (
AR, BR, CL, CO, MX, US).Request Body
string
required
One of:
deactivated, activation_requested, activation_in_progress, activated.Response
| Field | Type | Description |
|---|---|---|
data.entityId | string | Entity UUID |
data.countryCode | string | Normalized country code |
data.status | string | New status |
data.previousStatus | string | Status before this call |
data.changed | boolean | false if status was already the requested value (no webhook) |
data.activatedAt | string | null | Last activated timestamp |
data.deactivatedAt | string | null | Last deactivated timestamp |
data.updatedAt | string | null | Last change timestamp |
data.countries | array | Full snapshot of all allowlist countries after this call |
Example
curl -X PATCH "https://api.gu1.ai/entities/550e8400-e29b-41d4-a716-446655440000/country-activations/CO" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"activation_requested"}'
{
"success": true,
"data": {
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"countryCode": "CO",
"status": "activation_requested",
"previousStatus": "deactivated",
"changed": true,
"activatedAt": null,
"deactivatedAt": null,
"updatedAt": "2026-07-03T15:00:00.000Z",
"countries": [
{ "countryCode": "AR", "status": "deactivated", "activatedAt": null, "deactivatedAt": null, "updatedAt": null },
{ "countryCode": "CO", "status": "activation_requested", "activatedAt": null, "deactivatedAt": null, "updatedAt": "2026-07-03T15:00:00.000Z" },
{ "countryCode": "MX", "status": "activated", "activatedAt": "2026-07-03T14:00:00.000Z", "deactivatedAt": null, "updatedAt": "2026-07-03T14:00:00.000Z" }
]
}
}
Webhook payload (on change)
Whenchanged is true, subscribers receive:
{
"event": "entity.country_activation_changed",
"timestamp": "2026-07-03T15:00:00.000Z",
"organizationId": "org-uuid",
"payload": {
"entity": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "merchant_123",
"name": "Acme Corp",
"type": "company",
"countryCode": "US"
},
"countryCode": "CO",
"status": "activation_requested",
"previousStatus": "deactivated",
"activeCountryCodes": ["MX"],
"countries": [
{ "countryCode": "AR", "status": "deactivated" },
{ "countryCode": "CO", "status": "activation_requested" },
{ "countryCode": "MX", "status": "activated" }
],
"timeline": [
{
"previousStatus": "deactivated",
"status": "activation_requested",
"changedAt": "2026-07-03T15:00:00.000Z"
}
],
"changedAt": "2026-07-03T15:00:00.000Z"
}
}
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | UNSUPPORTED_COUNTRY_CODE | Country not in v1 allowlist |
| 404 | ENTITY_NOT_FOUND | Entity does not exist in the current organization |
Was this page helpful?
βI