Skip to main content
POST
/
api
/
v1
/
developers
/
{developerId}
/
api-keys
Generate API Key
curl --request POST \
  --url https://uat.gateway.verify-group.io/api/v1/developers/{developerId}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "permissions": [
    "<string>"
  ],
  "expiresAt": "<string>"
}
'
import requests

url = "https://uat.gateway.verify-group.io/api/v1/developers/{developerId}/api-keys"

payload = {
    "name": "<string>",
    "permissions": ["<string>"],
    "expiresAt": "<string>"
}
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: '<string>', permissions: ['<string>'], expiresAt: '<string>'})
};

fetch('https://uat.gateway.verify-group.io/api/v1/developers/{developerId}/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://uat.gateway.verify-group.io/api/v1/developers/{developerId}/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' => '<string>',
    'permissions' => [
        '<string>'
    ],
    'expiresAt' => '<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 := "https://uat.gateway.verify-group.io/api/v1/developers/{developerId}/api-keys"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"permissions\": [\n    \"<string>\"\n  ],\n  \"expiresAt\": \"<string>\"\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://uat.gateway.verify-group.io/api/v1/developers/{developerId}/api-keys")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"permissions\": [\n    \"<string>\"\n  ],\n  \"expiresAt\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://uat.gateway.verify-group.io/api/v1/developers/{developerId}/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\": \"<string>\",\n  \"permissions\": [\n    \"<string>\"\n  ],\n  \"expiresAt\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "key": "<string>",
  "id": "<string>",
  "name": "<string>"
}
developerId
string
required
Your developer account UUID.
name
string
required
Label for this key (e.g. production-server, staging-worker).
permissions
string[]
Scopes this key can access. Defaults to all scopes on your developer account.
expiresAt
string
ISO 8601 expiry date. Leave unset for no expiry.
key
string
The API key — prefixed vg_live_ (production) or vg_test_ (sandbox). Shown once only.
id
string
Key ID for revocation.
name
string
Key label.
Use the key in requests as:
Authorization: Bearer vg_live_xxxxx
or
X-API-Key: vg_live_xxxxx