Skip to main content
POST
/
api
/
public
/
v1
/
games
/
{game}
/
decks
/
{id}
/
rollback
Roll a deck back to a historical version
curl --request POST \
  --url https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Partner-Id: <api-key>' \
  --header 'X-Signature: <api-key>' \
  --data '
{
  "version_number": 2
}
'
import requests

url = "https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback"

payload = { "version_number": 2 }
headers = {
"X-Signature": "<api-key>",
"X-Partner-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Signature': '<api-key>',
'X-Partner-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({version_number: 2})
};

fetch('https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback', 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.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback",
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([
'version_number' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Partner-Id: <api-key>",
"X-Signature: <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"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback"

payload := strings.NewReader("{\n \"version_number\": 2\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Signature", "<api-key>")
req.Header.Add("X-Partner-Id", "<api-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.post("https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback")
.header("X-Signature", "<api-key>")
.header("X-Partner-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_number\": 2\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.flexslot.gg/api/public/v1/games/{game}/decks/{id}/rollback")

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

request = Net::HTTP::Post.new(url)
request["X-Signature"] = '<api-key>'
request["X-Partner-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_number\": 2\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "notes": "<string>",
  "visibility": [
    "<string>"
  ],
  "format": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "youtube_url": "<string>",
  "thumbnail": "<string>",
  "legal": true,
  "is_archived": true,
  "likes": 123,
  "pageviews": 123,
  "version": 123,
  "source_provider": "<string>",
  "source_external_id": "<string>",
  "source_external_version": "<string>",
  "source_external_url": "<string>",
  "source_imported_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-Signature
string
header
required

HMAC-SHA256 over canonical request string. Format: v1.<unix_seconds>.<hex_hmac_sha256>.

X-Partner-Id
string
header
required

Partner identifier slug. Required alongside X-Signature for HMAC auth.

Authorization
string
header
required

User-issued personal access token (format: flx_pat_).

Path Parameters

game
string
required
id
string<uuid>
required

Body

version_number
integer
required
Required range: x >= 1

Response

id
string<uuid>
required
read-only
name
string | null
required
read-only
notes
string | null
required
read-only
visibility
string[]
required
read-only
format
string<uuid> | null
required
read-only
youtube_url
string<uri> | null
required
read-only
thumbnail
string | null
required
read-only
is_archived
boolean
required
read-only
likes
integer
required
read-only
pageviews
integer
required
read-only
version
integer
required
read-only
source_provider
string
required
read-only
source_external_id
string
required
read-only
source_external_version
string
required
read-only
source_external_url
string
required
read-only
source_imported_at
string<date-time> | null
required
read-only
created_at
string<date-time>
required
read-only
updated_at
string<date-time>
required
read-only