curl --request POST \
--url https://api.nlbs.ai/workflow-endpoints/{entrypoint_key} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}"
payload = {
"document": "<string>",
"metadata": {}
}
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({document: '<string>', metadata: {}})
};
fetch('https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}', 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.nlbs.ai/workflow-endpoints/{entrypoint_key}",
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([
'document' => '<string>',
'metadata' => [
]
]),
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.nlbs.ai/workflow-endpoints/{entrypoint_key}"
payload := strings.NewReader("{\n \"document\": \"<string>\",\n \"metadata\": {}\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.nlbs.ai/workflow-endpoints/{entrypoint_key}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}")
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 \"document\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"execution_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"case_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deduplicated": false,
"desk_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queue_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"node_key": "<string>"
}
]
}{
"detail": "Resource not found."
}Invocar um workflow pelo seu entrypoint HTTP
Inicia um workflow para um CPF ou CNPJ. A resposta é sempre imediata e nunca carrega um resultado: retorna o identificador da execução, consultado via GET /workflow-executions/ com a mesma chave de API. A chave precisa ser a vinculada a este entrypoint; qualquer outra chave responde 404, exista ou não o entrypoint. A chave de deduplicação é ocupada pela EXECUÇÃO, não pelo caso de revisão: enquanto uma execução do mesma conta, subject e entrypoint estiver queued, running ou waiting_human, uma chamada repetida retorna a MESMA execução em vez de iniciar uma segunda, tenha ela chegado a um nó de mesa ou não. A chave só é liberada quando essa execução chega a succeeded, failed ou cancelled; decidir o caso de revisão sozinho não libera a chave enquanto o workflow ainda tem que rodar até seu nó final.
curl --request POST \
--url https://api.nlbs.ai/workflow-endpoints/{entrypoint_key} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}"
payload = {
"document": "<string>",
"metadata": {}
}
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({document: '<string>', metadata: {}})
};
fetch('https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}', 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.nlbs.ai/workflow-endpoints/{entrypoint_key}",
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([
'document' => '<string>',
'metadata' => [
]
]),
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.nlbs.ai/workflow-endpoints/{entrypoint_key}"
payload := strings.NewReader("{\n \"document\": \"<string>\",\n \"metadata\": {}\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.nlbs.ai/workflow-endpoints/{entrypoint_key}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlbs.ai/workflow-endpoints/{entrypoint_key}")
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 \"document\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"execution_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"case_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deduplicated": false,
"desk_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queue_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"node_key": "<string>"
}
]
}{
"detail": "Resource not found."
}Body
The payload an external client POSTs to /workflow-endpoints/{entrypoint_key}.
Exactly two fields, per the epic: the subject's document and free-form typed metadata. The model forbids unknown fields like every other model here, so a client that invents a third top-level key hears about it instead of having it silently dropped.
Objeto livre carregado junto com o subject. Campos declarados no metadata_schema do entrypoint são validados por tipo e ficam legíveis pelas condições do workflow; campos não declarados são aceitos e armazenados, mas nenhuma condição os lê. Ver WorkflowEntrypointSummary.metadata_schema para o formato da declaração.
Response
Successful Response
Identificador público do caso de revisão humana que esta execução abriu, ou nulo quando a execução ainda não chegou a um nó de mesa. Numa chamada deduplicada, é o caso ABERTO da execução que já ocupava a chave de deduplicação (hoje uma execução não-terminal do mesma conta, subject e entrypoint, não mais um caso aberto), não a execução em si: se esse caso já foi decidido, o campo vem nulo aqui mesmo com a execução ainda em andamento, porque a leitura filtra por caso aberto.

