curl --request PATCH \
--url https://api.usefoil.com/v1/gate/services/{serviceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Growth Workspace"
}
'import requests
url = "https://api.usefoil.com/v1/gate/services/{serviceId}"
payload = { "name": "Acme Growth Workspace" }
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({name: 'Acme Growth Workspace'})
};
fetch('https://api.usefoil.com/v1/gate/services/{serviceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usefoil.com/v1/gate/services/{serviceId}"
payload := strings.NewReader("{\n \"name\": \"Acme Growth Workspace\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.usefoil.com/v1/gate/services/{serviceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Growth Workspace\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usefoil.com/v1/gate/services/{serviceId}",
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([
'name' => 'Acme Growth Workspace'
]),
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;
}{
"data": {
"object": "gate_service",
"id": "gsvc_0123456789abcdefghjkmnpqrs",
"status": "active",
"discoverable": true,
"name": "Acme Growth Workspace",
"description": "203.0.113.10",
"website": "https://app.acme.co/signup",
"dashboard_login_url": "https://app.acme.co/signup",
"env_vars": [
{
"name": "Acme Growth Workspace",
"key": "FOIL_PUBLISHABLE_KEY",
"secret": true
}
],
"docs_url": "https://app.acme.co/signup",
"sdks": [
{
"label": "Chrome",
"install": "npm install @foil/server-node",
"url": "https://app.acme.co/signup"
}
],
"branding": {
"logo_url": "https://app.acme.co/signup",
"primary_color": "#111827",
"secondary_color": "#60a5fa",
"ascii_art": "FOIL",
"verified": true
},
"consent": {
"terms_url": "https://app.acme.co/signup",
"privacy_url": "https://app.acme.co/signup"
},
"created_at": "2026-03-24T20:00:00.000Z",
"updated_at": "2026-03-24T20:00:05.000Z",
"webhook_endpoint_id": "we_0123456789abcdef0123456789abcdef"
},
"meta": {
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1"
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}Update a Gate service for the authenticated organization
Requires Authorization: Bearer sk_* with the gate:services:manage scope.
curl --request PATCH \
--url https://api.usefoil.com/v1/gate/services/{serviceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Growth Workspace"
}
'import requests
url = "https://api.usefoil.com/v1/gate/services/{serviceId}"
payload = { "name": "Acme Growth Workspace" }
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({name: 'Acme Growth Workspace'})
};
fetch('https://api.usefoil.com/v1/gate/services/{serviceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usefoil.com/v1/gate/services/{serviceId}"
payload := strings.NewReader("{\n \"name\": \"Acme Growth Workspace\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.usefoil.com/v1/gate/services/{serviceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Growth Workspace\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usefoil.com/v1/gate/services/{serviceId}",
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([
'name' => 'Acme Growth Workspace'
]),
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;
}{
"data": {
"object": "gate_service",
"id": "gsvc_0123456789abcdefghjkmnpqrs",
"status": "active",
"discoverable": true,
"name": "Acme Growth Workspace",
"description": "203.0.113.10",
"website": "https://app.acme.co/signup",
"dashboard_login_url": "https://app.acme.co/signup",
"env_vars": [
{
"name": "Acme Growth Workspace",
"key": "FOIL_PUBLISHABLE_KEY",
"secret": true
}
],
"docs_url": "https://app.acme.co/signup",
"sdks": [
{
"label": "Chrome",
"install": "npm install @foil/server-node",
"url": "https://app.acme.co/signup"
}
],
"branding": {
"logo_url": "https://app.acme.co/signup",
"primary_color": "#111827",
"secondary_color": "#60a5fa",
"ascii_art": "FOIL",
"verified": true
},
"consent": {
"terms_url": "https://app.acme.co/signup",
"privacy_url": "https://app.acme.co/signup"
},
"created_at": "2026-03-24T20:00:00.000Z",
"updated_at": "2026-03-24T20:00:05.000Z",
"webhook_endpoint_id": "we_0123456789abcdef0123456789abcdef"
},
"meta": {
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1"
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}Authorizations
Send Authorization: Bearer . Gate business endpoints require sk_* secret keys. Gate workflow endpoints use gate-native bearer tokens such as gtpoll_* or agt_* where documented.
Path Parameters
Canonical Gate service slug used by the public registry and by npx signup . Lowercase letters, numbers, dashes, and underscores only; must start and end with a letter or number.
3 - 32^[a-z0-9](?:[a-z0-9_-]{1,30}[a-z0-9])$"gsvc_0123456789abcdefghjkmnpqrs"
Body
Partial Gate service update. Nested objects and arrays replace the existing value wholesale.
true
"Acme Growth Workspace"
"203.0.113.10"
"https://app.acme.co/signup"
"https://app.acme.co/signup"
Show child attributes
Show child attributes
[ { "name": "Acme Growth Workspace", "key": "FOIL_PUBLISHABLE_KEY", "secret": true } ]
"https://app.acme.co/signup"
Show child attributes
Show child attributes
[ { "label": "Chrome", "install": "npm install @foil/server-node", "url": "https://app.acme.co/signup" } ]
Show child attributes
Show child attributes
{ "logo_url": "https://app.acme.co/signup", "primary_color": "#111827", "secondary_color": "#60a5fa", "ascii_art": "FOIL", "verified": true }
Show child attributes
Show child attributes
{ "terms_url": "https://app.acme.co/signup", "privacy_url": "https://app.acme.co/signup" }
^we_[0-9a-f]{32}$"we_0123456789abcdef0123456789abcdef"
Response
Updated Gate service.
Show child attributes
Show child attributes
{ "object": "gate_service", "id": "gsvc_0123456789abcdefghjkmnpqrs", "status": "active", "discoverable": true, "name": "Acme Growth Workspace", "description": "203.0.113.10", "website": "https://app.acme.co/signup", "dashboard_login_url": "https://app.acme.co/signup", "env_vars": [ { "name": "Acme Growth Workspace", "key": "FOIL_PUBLISHABLE_KEY", "secret": true } ], "docs_url": "https://app.acme.co/signup", "sdks": [ { "label": "Chrome", "install": "npm install @foil/server-node", "url": "https://app.acme.co/signup" } ], "branding": { "logo_url": "https://app.acme.co/signup", "primary_color": "#111827", "secondary_color": "#60a5fa", "ascii_art": "FOIL", "verified": true }, "consent": { "terms_url": "https://app.acme.co/signup", "privacy_url": "https://app.acme.co/signup" }, "created_at": "2026-03-24T20:00:00.000Z", "updated_at": "2026-03-24T20:00:05.000Z", "webhook_endpoint_id": "we_0123456789abcdef0123456789abcdef" }
Show child attributes
Show child attributes
{ "request_id": "req_cf147349a4134208aebb8c70e25fb7e1" }