Discard a Cloud Function draft
curl --request DELETE \
--url https://api.getnexor.ai/api/public/cloud-functions/{id}/draft \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getnexor.ai/api/public/cloud-functions/{id}/draft"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getnexor.ai/api/public/cloud-functions/{id}/draft', 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.getnexor.ai/api/public/cloud-functions/{id}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-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 := "https://api.getnexor.ai/api/public/cloud-functions/{id}/draft"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-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("https://api.getnexor.ai/api/public/cloud-functions/{id}/draft")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/cloud-functions/{id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"function": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"trigger_event": "<string>",
"code": "<string>",
"is_active": true,
"run_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_run_status": "<string>",
"has_draft": true,
"draft_updated_at": "2023-11-07T05:31:56Z",
"deploy_error": "<string>",
"published_version": 123,
"code_draft": "<string>",
"draft_hash": "<string>"
}
}{
"error": "Invalid API key",
"message": "The provided API key is not valid"
}{
"error": "Forbidden",
"message": "This API key is missing the required scope: workflows:write"
}{
"error": "Not found",
"message": "Cloud Function not found"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Internal server error",
"message": "Failed to discard draft"
}Descartar un borrador de función en la nube
Descarta el borrador de código pendiente de una función en la nube. La versión publicada sigue ejecutándose.
DELETE
/
cloud-functions
/
{id}
/
draft
Discard a Cloud Function draft
curl --request DELETE \
--url https://api.getnexor.ai/api/public/cloud-functions/{id}/draft \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getnexor.ai/api/public/cloud-functions/{id}/draft"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getnexor.ai/api/public/cloud-functions/{id}/draft', 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.getnexor.ai/api/public/cloud-functions/{id}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-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 := "https://api.getnexor.ai/api/public/cloud-functions/{id}/draft"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-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("https://api.getnexor.ai/api/public/cloud-functions/{id}/draft")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/cloud-functions/{id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"function": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"trigger_event": "<string>",
"code": "<string>",
"is_active": true,
"run_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_run_status": "<string>",
"has_draft": true,
"draft_updated_at": "2023-11-07T05:31:56Z",
"deploy_error": "<string>",
"published_version": 123,
"code_draft": "<string>",
"draft_hash": "<string>"
}
}{
"error": "Invalid API key",
"message": "The provided API key is not valid"
}{
"error": "Forbidden",
"message": "This API key is missing the required scope: workflows:write"
}{
"error": "Not found",
"message": "Cloud Function not found"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Internal server error",
"message": "Failed to discard draft"
}Elimina el borrador pendiente de una función en la nube. El código publicado se sigue ejecutando en cada evento que coincide, y la función deja de mostrar cambios sin publicar.
Llamarlo cuando no hay borrador también funciona. Descartar no se puede deshacer, pero todas las versiones publicadas siguen disponibles en Versiones.
Autorizaciones
API key for authentication. Keys are prefixed with nxr_live_.
Parámetros de ruta
Cloud Function id.
Última modificación el 6 de octubre de 2026
⌘I