curl --request POST \
--url https://api-dev.rain.xyz/v1/issuing/keys \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Limited access key",
"role": "custom",
"expiresAt": "2027-01-01T00:00:00Z",
"permissions": [
"applications:read",
"transactionsAndDisputes:write",
"cardsAndShipping:delete"
],
"ipAddresses": [
"192.168.1.1",
"10.0.0.0/24"
]
}
'import requests
url = "https://api-dev.rain.xyz/v1/issuing/keys"
payload = {
"name": "Limited access key",
"role": "custom",
"expiresAt": "2027-01-01T00:00:00Z",
"permissions": ["applications:read", "transactionsAndDisputes:write", "cardsAndShipping:delete"],
"ipAddresses": ["192.168.1.1", "10.0.0.0/24"]
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Limited access key',
role: 'custom',
expiresAt: '2027-01-01T00:00:00Z',
permissions: [
'applications:read',
'transactionsAndDisputes:write',
'cardsAndShipping:delete'
],
ipAddresses: ['192.168.1.1', '10.0.0.0/24']
})
};
fetch('https://api-dev.rain.xyz/v1/issuing/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-dev.rain.xyz/v1/issuing/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' => 'Limited access key',
'role' => 'custom',
'expiresAt' => '2027-01-01T00:00:00Z',
'permissions' => [
'applications:read',
'transactionsAndDisputes:write',
'cardsAndShipping:delete'
],
'ipAddresses' => [
'192.168.1.1',
'10.0.0.0/24'
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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-dev.rain.xyz/v1/issuing/keys"
payload := strings.NewReader("{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
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-dev.rain.xyz/v1/issuing/keys")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/issuing/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"role": "admin",
"permissions": [
"<string>"
],
"ipAddresses": [
"<string>"
]
}Create a key
curl --request POST \
--url https://api-dev.rain.xyz/v1/issuing/keys \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Limited access key",
"role": "custom",
"expiresAt": "2027-01-01T00:00:00Z",
"permissions": [
"applications:read",
"transactionsAndDisputes:write",
"cardsAndShipping:delete"
],
"ipAddresses": [
"192.168.1.1",
"10.0.0.0/24"
]
}
'import requests
url = "https://api-dev.rain.xyz/v1/issuing/keys"
payload = {
"name": "Limited access key",
"role": "custom",
"expiresAt": "2027-01-01T00:00:00Z",
"permissions": ["applications:read", "transactionsAndDisputes:write", "cardsAndShipping:delete"],
"ipAddresses": ["192.168.1.1", "10.0.0.0/24"]
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Limited access key',
role: 'custom',
expiresAt: '2027-01-01T00:00:00Z',
permissions: [
'applications:read',
'transactionsAndDisputes:write',
'cardsAndShipping:delete'
],
ipAddresses: ['192.168.1.1', '10.0.0.0/24']
})
};
fetch('https://api-dev.rain.xyz/v1/issuing/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-dev.rain.xyz/v1/issuing/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' => 'Limited access key',
'role' => 'custom',
'expiresAt' => '2027-01-01T00:00:00Z',
'permissions' => [
'applications:read',
'transactionsAndDisputes:write',
'cardsAndShipping:delete'
],
'ipAddresses' => [
'192.168.1.1',
'10.0.0.0/24'
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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-dev.rain.xyz/v1/issuing/keys"
payload := strings.NewReader("{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
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-dev.rain.xyz/v1/issuing/keys")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/issuing/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Limited access key\",\n \"role\": \"custom\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"permissions\": [\n \"applications:read\",\n \"transactionsAndDisputes:write\",\n \"cardsAndShipping:delete\"\n ],\n \"ipAddresses\": [\n \"192.168.1.1\",\n \"10.0.0.0/24\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"role": "admin",
"permissions": [
"<string>"
],
"ipAddresses": [
"<string>"
]
}Authorizations
Body
The key to create
The name of the key
The time the key expires
The role of the key - if not provided, it will default to admin
admin, readonly, custom, webhookSigning The permissions of the key - required if role is custom, will ignore if provided and role is admin, readonly, or webhookSigning. Must contain at least one permission.
Items must be in the format resource:action and correspond to the available resources and actions in the Authenticating with the API reference
[
"applications:read",
"transactionsAndDisputes:write",
"cardsAndShipping:delete"
]
Optional list of IP addresses or CIDR ranges that are allowed to use this API key. If not provided or empty, requests from any IP address are allowed. Supports both IPv4 and IPv6. Maximum 100 entries.
100An IPv4 address (e.g., 192.168.1.1), IPv6 address, or CIDR range (e.g., 10.0.0.0/24)
["192.168.1.1", "10.0.0.0/24", "2001:db8::1"]
Response
Successful operation
The key's unique identifier
The key
The key's name
The time at which the key expires
The key's role
admin, readonly, custom, webhookSigning The key's permissions
The IP addresses or CIDR ranges allowed to use this key. If empty, any IP is allowed. Maximum 100 entries.
100