Update API key
curl --request PATCH \
--url https://management-api.fpjs.io/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"name": "<string>",
"description": "<string>",
"rate_limit": 1.1
}
'import requests
url = "https://management-api.fpjs.io/api-keys/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"rate_limit": 1.1
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', description: '<string>', rate_limit: 1.1})
};
fetch('https://management-api.fpjs.io/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://management-api.fpjs.io/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' => '<string>',
'description' => '<string>',
'rate_limit' => 1.1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$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://management-api.fpjs.io/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
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://management-api.fpjs.io/api-keys/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "tok_No3jUysGLCDuqB3RnCVf1weo",
"name": "My Public Key",
"status": "enabled",
"environment": "ae_rrETjdWcfqI6AFsk",
"type": "public",
"rateLimit": 5,
"createdAt": "2024-05-31T01:24:39.506Z",
"description": "Description for my public key",
"token": "eWDrrpGGLjDQW0LBA0Wj",
"disabledAt": null
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}api-keys
Update API key
deprecated
Updates a single API key. You can update the keys name, description, status, and rate limit. You cannot mutate the actual key itself.
PATCH
/
api-keys
/
{id}
Update API key
curl --request PATCH \
--url https://management-api.fpjs.io/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"name": "<string>",
"description": "<string>",
"rate_limit": 1.1
}
'import requests
url = "https://management-api.fpjs.io/api-keys/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"rate_limit": 1.1
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', description: '<string>', rate_limit: 1.1})
};
fetch('https://management-api.fpjs.io/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://management-api.fpjs.io/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' => '<string>',
'description' => '<string>',
'rate_limit' => 1.1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$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://management-api.fpjs.io/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
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://management-api.fpjs.io/api-keys/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rate_limit\": 1.1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "tok_No3jUysGLCDuqB3RnCVf1weo",
"name": "My Public Key",
"status": "enabled",
"environment": "ae_rrETjdWcfqI6AFsk",
"type": "public",
"rateLimit": 5,
"createdAt": "2024-05-31T01:24:39.506Z",
"description": "Description for my public key",
"token": "eWDrrpGGLjDQW0LBA0Wj",
"disabledAt": null
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Management API version.
Path Parameters
Body
application/json
Name of an API key.
Required string length:
3 - 255Description for an API key.
Required string length:
3 - 255Set API key status. Use to enable or disable an API key.
Available options:
enabled, disabled Set rate limit for an API key. Value is in request-per-second.
Required range:
x >= 0.1Response
Updated API key object.
Show child attributes
Show child attributes
Was this page helpful?
⌘I