Rotate API Key
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key} \
--header 'Authorization: Bearer <token>' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>'
}
};
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 => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("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>")
.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::Post.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
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
Rotate API Key
The rotate endpoint generates a new API Key Secret. If you run this endpoint, any previous implementations where the old API Key secret is being used will no longer work.
POST
/
api
/
v1
/
csp
/
apikey
/
{secret_key}
Rotate API Key
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key} \
--header 'Authorization: Bearer <token>' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>'
}
};
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 => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/apikey/{secret_key}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("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>")
.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::Post.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
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"
Was this page helpful?
⌘I