Skip to main content
PUT
/
v1
/
aggregators
/
{raast-aggregator-id}
/
keys
/
{access-key-id}
/
rotate
Rotate Access Key
curl --request PUT \
  --url https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate \
  --header 'X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>'
import requests

url = "https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate"

headers = {"X-SFPY-AGGREGATOR-SECRET-KEY": "<api-key>"}

response = requests.put(url, headers=headers)

print(response.text)
const options = {method: 'PUT', headers: {'X-SFPY-AGGREGATOR-SECRET-KEY': '<api-key>'}};

fetch('https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate', 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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>"
],
]);

$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://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate"

req, _ := http.NewRequest("PUT", url, nil)

req.Header.Add("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate")
.header("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/keys/{access-key-id}/rotate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-SFPY-AGGREGATOR-SECRET-KEY"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "api_version": "v1",
  "data": {
    "id": "ak_da8f1c10-346a-4be8-895a-b6187a9a9662",
    "token": "ak_tok_fede37a6",
    "key_id": "key_live_e111f1c10",
    "aggregator_id": "agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e",
    "is_active": true,
    "name": "Primary Production Key",
    "secret": "sk_live_uMPN7cX2b1",
    "created_at": "2025-03-13T09:12:34.000Z",
    "updated_at": "2025-03-13T09:12:34.000Z"
  }
}

Authorizations

X-SFPY-AGGREGATOR-SECRET-KEY
string
header
required

Path Parameters

raast-aggregator-id
string
required

The unique identifier for the aggregator

Example:

"agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e"

access-key-id
string
required

The unique identifier for the access key

Example:

"ak_da8f1c10-346a-4be8-895a-b6187a9a9662"

Response

200 - application/json

This response contains details of an access key

Standard response structure for successful operations

api_version
string

The current version of the API spec

Example:

"v1"

data
object

Access key credential used to authenticate aggregator API requests