Delete prompt
curl --request DELETE \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID} \
--header 'API-Key: <api-key>'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}"
headers = {"API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'API-Key': '<api-key>'}};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}', 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 => "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$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 := "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "COMMON_BINDING",
"details": [
"PLATFORM_INVALID_ID: Invalid ID format."
],
"message": "Unable to process the request data"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "QUESTION_NOT_FOUND",
"message": "Question not found"
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Prompts
Delete a prompt
Deletes a prompt.
Returns 204 No Content on success. The response body is empty.
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | COMMON_BINDING | Invalid promptID format (PLATFORM_INVALID_ID in details) |
| 401 | COMMON_UNAUTHORIZED | API key or access token is missing or invalid |
| 402 | INSUFFICIENT_CREDITS | The organization’s credit balance is lower than the unit price of this request |
| 404 | QUESTION_NOT_FOUND | The prompt does not exist or is owned by another organization |
| 429 | PLATFORM_RATE_LIMIT_EXCEEDED | Rate limit exceeded. Wait for the number of seconds in the Retry-After header, then retry |
| 500 | — | Internal server error. Returns message and requestID without a code |
DELETE
/
v1
/
platform
/
prompts
/
{promptID}
Delete prompt
curl --request DELETE \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID} \
--header 'API-Key: <api-key>'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}"
headers = {"API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'API-Key': '<api-key>'}};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}', 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 => "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$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 := "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompts/{promptID}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "COMMON_BINDING",
"details": [
"PLATFORM_INVALID_ID: Invalid ID format."
],
"message": "Unable to process the request data"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "QUESTION_NOT_FOUND",
"message": "Question not found"
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}