Copy a version into the draft
curl --request POST \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": [
123
],
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": [
123
],
"version_number": 123
},
"latest_version_number": 123
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"allowed_plans": [
"<string>"
],
"current_plan": "<string>",
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Management
Copy a version into the draft
Overwrites the draft with an older version’s graph, without deploying it. Requires the dynamic_routes:write scope.
POST
/
management
/
v1
/
dynamic-routes
/
{name}
/
versions
/
{version_number}
/
restore-to-draft
Copy a version into the draft
curl --request POST \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": [
123
],
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": [
123
],
"version_number": 123
},
"latest_version_number": 123
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"allowed_plans": [
"<string>"
],
"current_plan": "<string>",
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
Management API authentication. Pass an op-mak-… management token as a Bearer token. Runtime op-… API keys are rejected with 403 — they belong on the data-plane endpoints. Mint a management key from the platform UI under Settings → API keys.
Path Parameters
Route name
Version number, from 1
Required range:
x >= 1