Replace a schema
Replaces the schema document of an existing schema record. The release it belongs to
cannot change: a body with release is refused. To describe another release, register a
new schema.
Callable by an account_admin or developer of the owning account when model serving is
enabled for the account.
PUT
/
models
/
{id}
/
schemas
/
{schema_id}
Replace a schema
curl --request PUT \
--url https://api.reactor.inc/models/{id}/schemas/{schema_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
}
}
'import requests
url = "https://api.reactor.inc/models/{id}/schemas/{schema_id}"
payload = { "schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schema: {
openapi: '3.0.0',
info: {title: 'your-org/your-model', version: '1.0.5'},
paths: {}
}
})
};
fetch('https://api.reactor.inc/models/{id}/schemas/{schema_id}', 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.reactor.inc/models/{id}/schemas/{schema_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'schema' => [
'openapi' => '3.0.0',
'info' => [
'title' => 'your-org/your-model',
'version' => '1.0.5'
],
'paths' => [
]
]
]),
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://api.reactor.inc/models/{id}/schemas/{schema_id}"
payload := strings.NewReader("{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.reactor.inc/models/{id}/schemas/{schema_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/models/{id}/schemas/{schema_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cf868483-fa9f-4744-a4ce-aa2724e45f0a",
"model_id": "7b3f1bc2-a4e5-4d78-b9c1-0e6c2f9a1d34",
"release": "v1.0.5-ge6187a05",
"schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
},
"created_at": "2025-05-11T21:46:40Z",
"updated_at": "2025-05-11T22:46:40Z"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}Authorizations
A Reactor API key (rk_...), sent as Authorization: Bearer rk_.... Keep it on a server.
Path Parameters
The model's ID (not its project ID). Find it with GET /models?name=your-org/your-model.
The schema's ID.
Body
application/json
A non-empty OpenAPI document that replaces the current one.
Response
The updated schema.
The OpenAPI document, stored as sent.
When it was created, as an RFC 3339 timestamp.
Example:
"2026-01-15T10:30:00Z"
When it was last updated, as an RFC 3339 timestamp.
Example:
"2026-01-15T10:30:00Z"
⌘I
Replace a schema
curl --request PUT \
--url https://api.reactor.inc/models/{id}/schemas/{schema_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
}
}
'import requests
url = "https://api.reactor.inc/models/{id}/schemas/{schema_id}"
payload = { "schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schema: {
openapi: '3.0.0',
info: {title: 'your-org/your-model', version: '1.0.5'},
paths: {}
}
})
};
fetch('https://api.reactor.inc/models/{id}/schemas/{schema_id}', 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.reactor.inc/models/{id}/schemas/{schema_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'schema' => [
'openapi' => '3.0.0',
'info' => [
'title' => 'your-org/your-model',
'version' => '1.0.5'
],
'paths' => [
]
]
]),
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://api.reactor.inc/models/{id}/schemas/{schema_id}"
payload := strings.NewReader("{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.reactor.inc/models/{id}/schemas/{schema_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/models/{id}/schemas/{schema_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"schema\": {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"your-org/your-model\",\n \"version\": \"1.0.5\"\n },\n \"paths\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cf868483-fa9f-4744-a4ce-aa2724e45f0a",
"model_id": "7b3f1bc2-a4e5-4d78-b9c1-0e6c2f9a1d34",
"release": "v1.0.5-ge6187a05",
"schema": {
"openapi": "3.0.0",
"info": {
"title": "your-org/your-model",
"version": "1.0.5"
},
"paths": {}
},
"created_at": "2025-05-11T21:46:40Z",
"updated_at": "2025-05-11T22:46:40Z"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}