Rotate App Key for Enhanced Security

This API regenerates a new app key for an existing project. Use this when an app key is compromised or needs to be updated. This call does not affect any existing valid JWT token signed by the app.

Endpoint

GET /root/{app_id}/rotate/key

Headers

Name Type Required Description
Authorization string Yes The root-key of the project.

Example Request

curl --request GET \
--url http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key \
--header 'Authorization: {{root-key}}'
const request = require('request');

const options = {
    method: 'GET',
    url: 'http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key',
    headers: {Authorization: '{{root-key}}'}
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
import requests

url = "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key"

headers = {"Authorization": "{{root-key}}"}

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

print(response.json())
<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key', [
    'headers' => [
    'Authorization' => '{{root-key}}',
    ],
]);

echo $response->getBody();
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

    url := "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key"

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

    req.Header.Add("Authorization", "{{root-key}}")

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

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

    fmt.Println(res)
    fmt.Println(string(body))

}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/key")
    .setHeader("Authorization", "{{root-key}}")
    .execute()
    .toCompletableFuture()
    .thenAccept(System.out::println)
    .join();

client.close();

Example Success Response

{
"status": "ok"
}

Response Fields

Field Type Description
status string Indicates whether the call was successful.

Responses

Status Code Description
200 Ok Success
400 Bad Request Mostly when the form validation fails. The error will be returned as a response.
403 Access Denied When the provided root key in Authorization header is invalid.
500 Internal Server Error Mostly because of the database error. Check the log for root cause.