Manage discard reasons
Create, rename and delete reasons and subreasons for explicitly selected tasks.
POST
/
workflows
/
discard-reasons
/
changes
Manage discard reasons
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows/discard-reasons/changes \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"workflow_ids": [
"00000000-0000-4000-8000-000000000001"
],
"changes": [
{
"action": "create_reason",
"label": "Missing capability"
},
{
"action": "create_subreason",
"reason_code": "missing_capability",
"label": "Reporting"
}
]
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows/discard-reasons/changes"
payload = {
"workflow_ids": ["00000000-0000-4000-8000-000000000001"],
"changes": [
{
"action": "create_reason",
"label": "Missing capability"
},
{
"action": "create_subreason",
"reason_code": "missing_capability",
"label": "Reporting"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workflow_ids: ['00000000-0000-4000-8000-000000000001'],
changes: [
{action: 'create_reason', label: 'Missing capability'},
{
action: 'create_subreason',
reason_code: 'missing_capability',
label: 'Reporting'
}
]
})
};
fetch('https://api.getnexor.ai/api/public/workflows/discard-reasons/changes', 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/workflows/discard-reasons/changes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_ids' => [
'00000000-0000-4000-8000-000000000001'
],
'changes' => [
[
'action' => 'create_reason',
'label' => 'Missing capability'
],
[
'action' => 'create_subreason',
'reason_code' => 'missing_capability',
'label' => 'Reporting'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getnexor.ai/api/public/workflows/discard-reasons/changes"
payload := strings.NewReader("{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://api.getnexor.ai/api/public/workflows/discard-reasons/changes")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows/discard-reasons/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"workflows": [
{
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field_key": "<string>",
"definition_max": 500,
"reasons": [
{
"code": "<string>",
"label": "<string>",
"definition": "<string>",
"requires_subreason": true,
"subreasons": [
{
"code": "<string>",
"label": "<string>"
}
]
}
]
}
]
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}Use
The first reason creates a missing list. A reason can start with no subreasons. A required subreason must exist in the final saved list; replace the last one or disable the requirement in the same request. Deleting the last reason leaves an empty list.
Renaming preserves codes. Recreating a deleted name gets a new code. Deleting a reason also removes its subreasons from the available choices; historical discards keep their recorded values. Duplicate names are rejected within the same list. The same subreason label may appear under different parents.
Use
change_discard_reasons through MCP, or send this request directly. Read the selected task with get_discard_reasons first.
| Action | Fields |
|---|---|
create_reason | label, optional definition |
rename_reason | code, label |
delete_reason | code |
create_subreason | reason_code, label |
rename_subreason | reason_code, subreason_code, label |
delete_subreason | reason_code, subreason_code |
set_reason_definition | reason_code, definition (empty clears) |
set_requires_subreason | reason_code, boolean required |
set_reason_definition in the batch for atomic description changes across tasks. set_discard_reason_definitions remains available for one task; an empty string clears a description. Omitted properties stay unchanged. Read every selected task again after saving. If a response is lost, read before retrying. Changes across the selected tasks either all succeed or none is saved.
New codes may need matching options in your external CRM. Configure those options separately; saving the Nexor list does not verify CRM synchronization.Authorizations
Body
application/json
Last modified on November 12, 2026
⌘I
Manage discard reasons
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows/discard-reasons/changes \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"workflow_ids": [
"00000000-0000-4000-8000-000000000001"
],
"changes": [
{
"action": "create_reason",
"label": "Missing capability"
},
{
"action": "create_subreason",
"reason_code": "missing_capability",
"label": "Reporting"
}
]
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows/discard-reasons/changes"
payload = {
"workflow_ids": ["00000000-0000-4000-8000-000000000001"],
"changes": [
{
"action": "create_reason",
"label": "Missing capability"
},
{
"action": "create_subreason",
"reason_code": "missing_capability",
"label": "Reporting"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workflow_ids: ['00000000-0000-4000-8000-000000000001'],
changes: [
{action: 'create_reason', label: 'Missing capability'},
{
action: 'create_subreason',
reason_code: 'missing_capability',
label: 'Reporting'
}
]
})
};
fetch('https://api.getnexor.ai/api/public/workflows/discard-reasons/changes', 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/workflows/discard-reasons/changes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_ids' => [
'00000000-0000-4000-8000-000000000001'
],
'changes' => [
[
'action' => 'create_reason',
'label' => 'Missing capability'
],
[
'action' => 'create_subreason',
'reason_code' => 'missing_capability',
'label' => 'Reporting'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getnexor.ai/api/public/workflows/discard-reasons/changes"
payload := strings.NewReader("{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://api.getnexor.ai/api/public/workflows/discard-reasons/changes")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows/discard-reasons/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_ids\": [\n \"00000000-0000-4000-8000-000000000001\"\n ],\n \"changes\": [\n {\n \"action\": \"create_reason\",\n \"label\": \"Missing capability\"\n },\n {\n \"action\": \"create_subreason\",\n \"reason_code\": \"missing_capability\",\n \"label\": \"Reporting\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"workflows": [
{
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field_key": "<string>",
"definition_max": 500,
"reasons": [
{
"code": "<string>",
"label": "<string>",
"definition": "<string>",
"requires_subreason": true,
"subreasons": [
{
"code": "<string>",
"label": "<string>"
}
]
}
]
}
]
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}{
"error": "<string>",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_index": 123
}