Atomically replace the unlock-key generation
curl --request POST \
--url https://app.factorize.sh/api/v1/unlock-key/rotation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedGenerationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedRevision": 4503599627370495,
"encryptedVerification": "<string>",
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 4503599627370495,
"encryptedPayload": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 123,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"encryptedPayload": "<string>",
"recordRevision": 4503599627370495
}
]
}
'import requests
url = "https://app.factorize.sh/api/v1/unlock-key/rotation"
payload = {
"expectedGenerationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedRevision": 4503599627370495,
"encryptedVerification": "<string>",
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 4503599627370495,
"encryptedPayload": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 123,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"encryptedPayload": "<string>",
"recordRevision": 4503599627370495
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedGenerationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
generationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedRevision: 4503599627370495,
encryptedVerification: '<string>',
records: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
origin: '<string>',
description: '<string>',
revision: 4503599627370495,
encryptedPayload: '<string>',
deletedAt: '2023-11-07T05:31:56Z'
}
],
changes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
origin: '<string>',
description: '<string>',
revision: 123,
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
encryptedPayload: '<string>',
recordRevision: 4503599627370495
}
]
})
};
fetch('https://app.factorize.sh/api/v1/unlock-key/rotation', 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://app.factorize.sh/api/v1/unlock-key/rotation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expectedGenerationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'generationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedRevision' => 4503599627370495,
'encryptedVerification' => '<string>',
'records' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'origin' => '<string>',
'description' => '<string>',
'revision' => 4503599627370495,
'encryptedPayload' => '<string>',
'deletedAt' => '2023-11-07T05:31:56Z'
]
],
'changes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'origin' => '<string>',
'description' => '<string>',
'revision' => 123,
'idempotencyKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'encryptedPayload' => '<string>',
'recordRevision' => 4503599627370495
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.factorize.sh/api/v1/unlock-key/rotation"
payload := strings.NewReader("{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://app.factorize.sh/api/v1/unlock-key/rotation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/unlock-key/rotation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 4503599627370495,
"duplicate": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}unlock-key
Atomically replace the unlock-key generation
Owner browser session only. Commits a revision-checked encrypted generation and verification record, revokes grants, consumes enrollments, and locks the proxy. Fly connection and execution configuration are preserved.
Requires the integrations:write scope.
An interactive owner session is required; bearer tokens cannot call this operation.
POST
/
api
/
v1
/
unlock-key
/
rotation
Atomically replace the unlock-key generation
curl --request POST \
--url https://app.factorize.sh/api/v1/unlock-key/rotation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedGenerationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedRevision": 4503599627370495,
"encryptedVerification": "<string>",
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 4503599627370495,
"encryptedPayload": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 123,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"encryptedPayload": "<string>",
"recordRevision": 4503599627370495
}
]
}
'import requests
url = "https://app.factorize.sh/api/v1/unlock-key/rotation"
payload = {
"expectedGenerationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedRevision": 4503599627370495,
"encryptedVerification": "<string>",
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 4503599627370495,
"encryptedPayload": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"origin": "<string>",
"description": "<string>",
"revision": 123,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"encryptedPayload": "<string>",
"recordRevision": 4503599627370495
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedGenerationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
generationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedRevision: 4503599627370495,
encryptedVerification: '<string>',
records: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
origin: '<string>',
description: '<string>',
revision: 4503599627370495,
encryptedPayload: '<string>',
deletedAt: '2023-11-07T05:31:56Z'
}
],
changes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
origin: '<string>',
description: '<string>',
revision: 123,
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
encryptedPayload: '<string>',
recordRevision: 4503599627370495
}
]
})
};
fetch('https://app.factorize.sh/api/v1/unlock-key/rotation', 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://app.factorize.sh/api/v1/unlock-key/rotation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expectedGenerationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'generationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedRevision' => 4503599627370495,
'encryptedVerification' => '<string>',
'records' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'origin' => '<string>',
'description' => '<string>',
'revision' => 4503599627370495,
'encryptedPayload' => '<string>',
'deletedAt' => '2023-11-07T05:31:56Z'
]
],
'changes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'origin' => '<string>',
'description' => '<string>',
'revision' => 123,
'idempotencyKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'encryptedPayload' => '<string>',
'recordRevision' => 4503599627370495
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.factorize.sh/api/v1/unlock-key/rotation"
payload := strings.NewReader("{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://app.factorize.sh/api/v1/unlock-key/rotation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/unlock-key/rotation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedGenerationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"generationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedRevision\": 4503599627370495,\n \"encryptedVerification\": \"<string>\",\n \"records\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 4503599627370495,\n \"encryptedPayload\": \"<string>\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"changes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"origin\": \"<string>\",\n \"description\": \"<string>\",\n \"revision\": 123,\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"encryptedPayload\": \"<string>\",\n \"recordRevision\": 4503599627370495\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 4503599627370495,
"duplicate": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
bearerAuthcookieAuth
Body
application/json
Response
Key generation replaced