List Content Versions
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versionsimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions', 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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"version": 123,
"typeVersion": 123,
"status": "<string>",
"content": {},
"createdAt": "<string>",
"createdBy": "<string>"
}
],
"pagination": {}
}Content
List Content Versions
Retrieve the version history for a content item
GET
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
{id}
/
versions
List Content Versions
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versionsimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions', 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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"version": 123,
"typeVersion": 123,
"status": "<string>",
"content": {},
"createdAt": "<string>",
"createdBy": "<string>"
}
],
"pagination": {}
}Path Parameters
Organization ID
Project ID
Content ID
Query Parameters
Items per page
Cursor for pagination (from previous response)
Response
Pagination information
Example Response
{
"data": [
{
"version": 3,
"typeVersion": 2,
"status": "published",
"content": {
"title": "Getting Started Guide v3",
"components": [...]
},
"createdAt": "2024-03-22T10:00:00Z",
"createdBy": "user123"
},
{
"version": 2,
"typeVersion": 2,
"status": "published",
"content": {
"title": "Getting Started Guide v2",
"components": [...]
},
"createdAt": "2024-03-21T10:00:00Z",
"createdBy": "user456"
},
{
"version": 1,
"typeVersion": 1,
"status": "published",
"content": {
"title": "Getting Started Guide",
"components": [...]
},
"createdAt": "2024-03-20T10:00:00Z",
"createdBy": "user123"
}
],
"pagination": {
"lastKey": "eyJwayI6Ik9SR..."
}
}
Versions are returned in reverse chronological order (newest first).
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/versions" \
-H "Authorization: Bearer YOUR_JWT"
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/versions',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const { data: versions } = await response.json();
console.log(`Content has ${versions.length} versions`);
// Compare versions
const latest = versions[0];
const previous = versions[1];
console.log(`Title changed from "${previous.content.title}" to "${latest.content.title}"`);
⌘I