Generate API Key
curl --request POST \
--url https://{brand_domain}/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Super-Admin-Email: <x-super-admin-email>' \
--data '
{
"name": "POS-System-Integration",
"scopes": [
"read",
"write"
]
}
'import requests
url = "https://{brand_domain}/api/v1/api-keys"
payload = {
"name": "POS-System-Integration",
"scopes": ["read", "write"]
}
headers = {
"X-Super-Admin-Email": "<x-super-admin-email>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Super-Admin-Email': '<x-super-admin-email>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'POS-System-Integration', scopes: ['read', 'write']})
};
fetch('https://{brand_domain}/api/v1/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://{brand_domain}/api/v1/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' => 'POS-System-Integration',
'scopes' => [
'read',
'write'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Super-Admin-Email: <x-super-admin-email>"
],
]);
$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://{brand_domain}/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Super-Admin-Email", "<x-super-admin-email>")
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://{brand_domain}/api/v1/api-keys")
.header("X-Super-Admin-Email", "<x-super-admin-email>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{brand_domain}/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Super-Admin-Email"] = '<x-super-admin-email>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key": "op_live_5gH2k8S3m9F0a1D2...",
"prefix": "op_live_5gH2",
"warning": "Store this key securely. It cannot be retrieved again."
}
}{
"success": false,
"error": "amount must be a positive number",
"errors": [
{
"code": "INVALID_AMOUNT",
"message": "amount must be a positive number",
"field": "amount"
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}Generate API Key
Generates a new API key for the active brand. Displays the generated plain key exactly once.
Requires special admin authorization: API key must possess write and admin scopes, and the X-Super-Admin-Email header
must identify an active superadmin user.
POST
/
api-keys
Generate API Key
curl --request POST \
--url https://{brand_domain}/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Super-Admin-Email: <x-super-admin-email>' \
--data '
{
"name": "POS-System-Integration",
"scopes": [
"read",
"write"
]
}
'import requests
url = "https://{brand_domain}/api/v1/api-keys"
payload = {
"name": "POS-System-Integration",
"scopes": ["read", "write"]
}
headers = {
"X-Super-Admin-Email": "<x-super-admin-email>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Super-Admin-Email': '<x-super-admin-email>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'POS-System-Integration', scopes: ['read', 'write']})
};
fetch('https://{brand_domain}/api/v1/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://{brand_domain}/api/v1/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' => 'POS-System-Integration',
'scopes' => [
'read',
'write'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Super-Admin-Email: <x-super-admin-email>"
],
]);
$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://{brand_domain}/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Super-Admin-Email", "<x-super-admin-email>")
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://{brand_domain}/api/v1/api-keys")
.header("X-Super-Admin-Email", "<x-super-admin-email>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{brand_domain}/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Super-Admin-Email"] = '<x-super-admin-email>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"POS-System-Integration\",\n \"scopes\": [\n \"read\",\n \"write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key": "op_live_5gH2k8S3m9F0a1D2...",
"prefix": "op_live_5gH2",
"warning": "Store this key securely. It cannot be retrieved again."
}
}{
"success": false,
"error": "amount must be a positive number",
"errors": [
{
"code": "INVALID_AMOUNT",
"message": "amount must be a positive number",
"field": "amount"
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}Authorizations
Provide the Bearer API Key generated for your brand.
Headers
Email of an active platform super-administrator.
Body
application/json
Last modified on July 12, 2026
Related topics
Developer Quickstart - Build Your First Payment IntegrationList API KeysRevoke API KeyNode.js SDK - TypeScript-First Payment IntegrationOwnPay API Overview - REST API for Multi-Brand PaymentsWas this page helpful?
⌘I