Class Rename
Renames a class in a repository.
URL
POST https://api.synodic.ai/v0/{user}/{repo}/class/rename
Headers
- x-api-key:
YOUR_API_KEY
(string)
Path Parameters
- {user}: username (string)
- {repo}: repository name (string)
Body
- index: class index (integer)
- class: class name (string)
Example Request
- Bash
- Python
- Node.js
- Rust
curl -X POST "https://api.synodic.ai/v0/{user}/{repo}/class/rename" -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"index": 0, "class": "new_class_name"}'
import requests
headers = {
"x-api-key": "YOUR_API_KEY"
}
response = requests.post("https://api.synodic.ai/v0/{user}/{repo}/class/rename", headers=headers, json={"index": 0, "class": "new_class_name"})
print(response.json())
const axios = require('axios');
const headers = {
"x-api-key": "YOUR_API_KEY"
};
axios.post("https://api.synodic.ai/v0/{user}/{repo}/class/rename", { index: 0, class: "new_class_name" }, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
use reqwest;
fn main() {
let client = reqwest::blocking::Client::new();
let response = client.post("https://api.synodic.ai/v0/{user}/{repo}/class/rename")
.header("x-api-key", "YOUR_API_KEY")
.json(&serde_json::json!({ "index": 0, "class": "new_class_name" }))
.send()
.expect("Failed to send request");
println!("{:?}", response.text());
}
Example Response
{
"classes": [
"Renamed Class 0",
"Existing Class 1",
"Existing Class 2"
]
}