curl --request PATCH \
--url https://api.engagefabric.com/projects/{projectId}/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production Mobile App Key v2",
"scopes": [
"events:write",
"players:read",
"players:write",
"quests:read"
],
"rateLimit": 2000,
"expiresAt": "2027-12-31T23:59:59Z",
"metadata": {
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/api-keys/{id}"
payload = {
"name": "Production Mobile App Key v2",
"scopes": ["events:write", "players:read", "players:write", "quests:read"],
"rateLimit": 2000,
"expiresAt": "2027-12-31T23:59:59Z",
"metadata": {
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}
}
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: 'Production Mobile App Key v2',
scopes: ['events:write', 'players:read', 'players:write', 'quests:read'],
rateLimit: 2000,
expiresAt: '2027-12-31T23:59:59Z',
metadata: {updatedBy: 'admin@example.com', notes: 'Extended permissions'}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/api-keys/{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://api.engagefabric.com/projects/{projectId}/api-keys/{id}",
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' => 'Production Mobile App Key v2',
'scopes' => [
'events:write',
'players:read',
'players:write',
'quests:read'
],
'rateLimit' => 2000,
'expiresAt' => '2027-12-31T23:59:59Z',
'metadata' => [
'updatedBy' => 'admin@example.com',
'notes' => 'Extended permissions'
]
]),
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 := "https://api.engagefabric.com/projects/{projectId}/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\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("https://api.engagefabric.com/projects/{projectId}/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/api-keys/{id}")
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\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Production Mobile App Key",
"prefix": "pp_live_",
"scopes": [
"events:write",
"players:read",
"players:write"
],
"status": "ACTIVE",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z",
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": "2025-01-15T10:30:00Z",
"metadata": {
"createdBy": "admin@example.com"
},
"deletedAt": null
}Update an API key
curl --request PATCH \
--url https://api.engagefabric.com/projects/{projectId}/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production Mobile App Key v2",
"scopes": [
"events:write",
"players:read",
"players:write",
"quests:read"
],
"rateLimit": 2000,
"expiresAt": "2027-12-31T23:59:59Z",
"metadata": {
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/api-keys/{id}"
payload = {
"name": "Production Mobile App Key v2",
"scopes": ["events:write", "players:read", "players:write", "quests:read"],
"rateLimit": 2000,
"expiresAt": "2027-12-31T23:59:59Z",
"metadata": {
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}
}
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: 'Production Mobile App Key v2',
scopes: ['events:write', 'players:read', 'players:write', 'quests:read'],
rateLimit: 2000,
expiresAt: '2027-12-31T23:59:59Z',
metadata: {updatedBy: 'admin@example.com', notes: 'Extended permissions'}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/api-keys/{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://api.engagefabric.com/projects/{projectId}/api-keys/{id}",
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' => 'Production Mobile App Key v2',
'scopes' => [
'events:write',
'players:read',
'players:write',
'quests:read'
],
'rateLimit' => 2000,
'expiresAt' => '2027-12-31T23:59:59Z',
'metadata' => [
'updatedBy' => 'admin@example.com',
'notes' => 'Extended permissions'
]
]),
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 := "https://api.engagefabric.com/projects/{projectId}/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\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("https://api.engagefabric.com/projects/{projectId}/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/api-keys/{id}")
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\": \"Production Mobile App Key v2\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\",\n \"quests:read\"\n ],\n \"rateLimit\": 2000,\n \"expiresAt\": \"2027-12-31T23:59:59Z\",\n \"metadata\": {\n \"updatedBy\": \"admin@example.com\",\n \"notes\": \"Extended permissions\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Production Mobile App Key",
"prefix": "pp_live_",
"scopes": [
"events:write",
"players:read",
"players:write"
],
"status": "ACTIVE",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z",
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": "2025-01-15T10:30:00Z",
"metadata": {
"createdBy": "admin@example.com"
},
"deletedAt": null
}Authorizations
JWT token for admin console authentication
Body
API key name/description
2 - 255"Production Mobile App Key v2"
API key scopes/permissions
[
"events:write",
"players:read",
"players:write",
"quests:read"
]
API key status
ACTIVE, REVOKED, EXPIRED Custom rate limit (requests per minute)
x >= 12000
API key expiration date (ISO 8601)
"2027-12-31T23:59:59Z"
Additional metadata
{
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}
Response
API key updated successfully
Unique API key identifier
"123e4567-e89b-12d3-a456-426614174000"
Project ID this key belongs to
"123e4567-e89b-12d3-a456-426614174000"
API key name/description
"Production Mobile App Key"
API key prefix (for identification)
"pp_live_"
API key scopes/permissions
[
"events:write",
"players:read",
"players:write"
]
API key status
ACTIVE, REVOKED, EXPIRED "ACTIVE"
Creation timestamp
"2025-01-15T10:30:00Z"
Last update timestamp
"2025-01-15T10:30:00Z"
Custom rate limit (requests per minute)
1000
API key expiration date
"2026-12-31T23:59:59Z"
Last time this key was used
"2025-01-15T10:30:00Z"
Additional metadata
{ "createdBy": "admin@example.com" }
Soft deletion timestamp
null
