Update API Key
curl --request PUT \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"access": {
"customers_read": true,
"customers_write": true,
"transactions_read": true,
"transactions_write": true
},
"description": "Api key for customer API access",
"enabled": true,
"name": "Customers Api Key (Enabled)"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
payload = {
"access": {
"customers_read": True,
"customers_write": True,
"transactions_read": True,
"transactions_write": True
},
"description": "Api key for customer API access",
"enabled": True,
"name": "Customers Api Key (Enabled)"
}
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
access: {
customers_read: true,
customers_write: true,
transactions_read: true,
transactions_write: true
},
description: 'Api key for customer API access',
enabled: true,
name: 'Customers Api Key (Enabled)'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}', 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://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'access' => [
'customers_read' => true,
'customers_write' => true,
'transactions_read' => true,
'transactions_write' => true
],
'description' => 'Api key for customer API access',
'enabled' => true,
'name' => 'Customers Api Key (Enabled)'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
payload := strings.NewReader("{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
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.put("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"access": {
"customers_read": true,
"customers_write": true,
"transactions_read": true,
"transactions_write": true
},
"created_at": {
"seconds": 1692260424
},
"description": "Api key for customer API access",
"enabled": true,
"name": "Customers Api Key (Enabled)",
"partner_id": "part_cjes76vsemvj3obsnc30",
"secret_key": "AB6DBC62DBA42EE52BC3928E772FBE3C",
"token": "api_cjetgi7semvjct8hhqm0",
"updated_at": {
"seconds": 1692260453
}
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.not_found",
"message": "Requested resource not found"
}API Keys
Update API Key
Update a permissioned access token to access Paylias’s networked APIs
PUT
/
api
/
v1
/
csp
/
apikey
/
{secret_key}
Update API Key
curl --request PUT \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"access": {
"customers_read": true,
"customers_write": true,
"transactions_read": true,
"transactions_write": true
},
"description": "Api key for customer API access",
"enabled": true,
"name": "Customers Api Key (Enabled)"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
payload = {
"access": {
"customers_read": True,
"customers_write": True,
"transactions_read": True,
"transactions_write": True
},
"description": "Api key for customer API access",
"enabled": True,
"name": "Customers Api Key (Enabled)"
}
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
access: {
customers_read: true,
customers_write: true,
transactions_read: true,
transactions_write: true
},
description: 'Api key for customer API access',
enabled: true,
name: 'Customers Api Key (Enabled)'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}', 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://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'access' => [
'customers_read' => true,
'customers_write' => true,
'transactions_read' => true,
'transactions_write' => true
],
'description' => 'Api key for customer API access',
'enabled' => true,
'name' => 'Customers Api Key (Enabled)'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
payload := strings.NewReader("{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
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.put("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access\": {\n \"customers_read\": true,\n \"customers_write\": true,\n \"transactions_read\": true,\n \"transactions_write\": true\n },\n \"description\": \"Api key for customer API access\",\n \"enabled\": true,\n \"name\": \"Customers Api Key (Enabled)\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"access": {
"customers_read": true,
"customers_write": true,
"transactions_read": true,
"transactions_write": true
},
"created_at": {
"seconds": 1692260424
},
"description": "Api key for customer API access",
"enabled": true,
"name": "Customers Api Key (Enabled)",
"partner_id": "part_cjes76vsemvj3obsnc30",
"secret_key": "AB6DBC62DBA42EE52BC3928E772FBE3C",
"token": "api_cjetgi7semvjct8hhqm0",
"updated_at": {
"seconds": 1692260453
}
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.not_found",
"message": "Requested resource not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The Partner ID header used for authorization
The Idempotency Key - usually a UUID
Path Parameters
The API secret key
Example:
"36BFB7C90C7A1D3D4E09E2E2C05DDD3E"
Body
application/json
Request to update an existing API key
Was this page helpful?
⌘I