List Component Versions
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/versionsimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/versions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{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}/components/{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}/components/{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}/components/{id}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{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": [
{}
],
"pagination": {}
}Components
List Component Versions
Retrieve version history for a component
GET
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
components
/
{id}
/
versions
List Component Versions
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/versionsimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/versions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{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}/components/{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}/components/{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}/components/{id}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{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": [
{}
],
"pagination": {}
}Path Parameters
Organization ID
Project ID
Component ID
Query Parameters
Items per page
Cursor for pagination (from previous response)
Response
Array of version objects
Pagination information
Example Response
{
"data": [
{
"version": 3,
"status": "published",
"content": "const metadata = () => ({...});\nconst body = (props) => {...};",
"compiled": "const metadata = () => ({...});\nconst body = (props) => {...};",
"schema": {...},
"createdAt": "2024-03-22T10:00:00Z",
"createdBy": "user123",
"packageVersion": "2.0.0"
},
{
"version": 2,
"status": "published",
"content": "...",
"compiled": "...",
"schema": {...},
"createdAt": "2024-03-15T10:00:00Z",
"createdBy": "user123",
"packageVersion": "1.1.0"
},
{
"version": 1,
"status": "published",
"content": "...",
"compiled": "...",
"schema": {...},
"createdAt": "2024-03-10T10:00:00Z",
"createdBy": "user456",
"packageVersion": "1.0.0"
}
],
"pagination": {
"limit": 20,
"lastKey": null
}
}
Component versions are created when the component is included in a package. Each version is immutable and tied to a specific package version.
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/versions" \
-H "Authorization: Bearer YOUR_JWT"
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/versions',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const { data: versions, pagination } = await response.json();
⌘I