curl --request POST \
--url https://api.engagefabric.com/projects/{projectId}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production Mobile App Key",
"scopes": [
"events:write",
"players:read",
"players:write"
],
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"metadata": {
"createdBy": "admin@example.com",
"purpose": "mobile-app"
}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/api-keys"
payload = {
"name": "Production Mobile App Key",
"scopes": ["events:write", "players:read", "players:write"],
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"metadata": {
"createdBy": "admin@example.com",
"purpose": "mobile-app"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production Mobile App Key',
scopes: ['events:write', 'players:read', 'players:write'],
rateLimit: 1000,
expiresAt: '2026-12-31T23:59:59Z',
metadata: {createdBy: 'admin@example.com', purpose: 'mobile-app'}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/api-keys', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production Mobile App Key',
'scopes' => [
'events:write',
'players:read',
'players:write'
],
'rateLimit' => 1000,
'expiresAt' => '2026-12-31T23:59:59Z',
'metadata' => [
'createdBy' => 'admin@example.com',
'purpose' => 'mobile-app'
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.engagefabric.com/projects/{projectId}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\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",
"key": "pp_live_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": "2025-01-15T10:30:00Z",
"metadata": {
"createdBy": "admin@example.com"
},
"deletedAt": null
}Create a new API key
Creates a new API key for the project. The plain key is only returned once - store it securely!
curl --request POST \
--url https://api.engagefabric.com/projects/{projectId}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production Mobile App Key",
"scopes": [
"events:write",
"players:read",
"players:write"
],
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"metadata": {
"createdBy": "admin@example.com",
"purpose": "mobile-app"
}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/api-keys"
payload = {
"name": "Production Mobile App Key",
"scopes": ["events:write", "players:read", "players:write"],
"rateLimit": 1000,
"expiresAt": "2026-12-31T23:59:59Z",
"metadata": {
"createdBy": "admin@example.com",
"purpose": "mobile-app"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production Mobile App Key',
scopes: ['events:write', 'players:read', 'players:write'],
rateLimit: 1000,
expiresAt: '2026-12-31T23:59:59Z',
metadata: {createdBy: 'admin@example.com', purpose: 'mobile-app'}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/api-keys', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production Mobile App Key',
'scopes' => [
'events:write',
'players:read',
'players:write'
],
'rateLimit' => 1000,
'expiresAt' => '2026-12-31T23:59:59Z',
'metadata' => [
'createdBy' => 'admin@example.com',
'purpose' => 'mobile-app'
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.engagefabric.com/projects/{projectId}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production Mobile App Key\",\n \"scopes\": [\n \"events:write\",\n \"players:read\",\n \"players:write\"\n ],\n \"rateLimit\": 1000,\n \"expiresAt\": \"2026-12-31T23:59:59Z\",\n \"metadata\": {\n \"createdBy\": \"admin@example.com\",\n \"purpose\": \"mobile-app\"\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",
"key": "pp_live_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
"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
Path Parameters
Project UUID
Body
API key name/description
2 - 255"Production Mobile App Key"
API key scopes/permissions
[
"events:write",
"players:read",
"players:write"
]
Custom rate limit (requests per minute). If not set, uses project default.
x >= 11000
API key expiration date (ISO 8601)
"2026-12-31T23:59:59Z"
Additional metadata
{
"createdBy": "admin@example.com",
"purpose": "mobile-app"
}
Response
API key created successfully (plain key shown only once!)
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"
The actual API key (ONLY shown once during creation, store securely)
"pp_live_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"
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
