API: REST Response

action_api_response · action · HTTP & Webhook · Available · v1.0.0

Description

Turn your workflow into a real REST API with a STRUCTURED, consistent response envelope: placed after a Webhook trigger (respond-node mode), it builds the status/body/headers of the HTTP reply in standard REST shape.

⚙️ Configuration parameters

Fields shown in the editor when configuring the node. Generated directly from the NodeDefconfigFields.

FieldTypeRequiredDefaultDescription
mode
Tipo di risposta
enum
successerror
yessuccesssuccess = { ok:true, data } · error = { ok:false, error } con status mappato automaticamente.
data
Dati (payload)
expressionnoinputIl contenuto della risposta (oggetto/JSON o expression upstream). Vuoto = usa l'input del nodo.
statusSuccess
Status di successo
enum
200201202204
no200200 OK · 201 Created · 202 Accepted · 204 No Content (senza body).
meta
Meta (JSON, opzionale)
JSON object/arrayno
{ "page": 1, "pageSize": 20, "total": 137 }
Metadati aggiunti come { ok, data, meta }. Tipico per paginazione/totali.
errorCode
Codice errore
enum
bad_requestunauthorizedforbiddennot_foundconflictvalidation_errorrate_limitedserver_error
nobad_requestMappa automaticamente sullo status HTTP (es. not_found→404, validation_error→422).
errorMessage
Messaggio errore
stringno
Risorsa non trovata
Messaggio leggibile. Vuoto = derivato dal codice.
errorDetails
Dettagli errore (JSON, opzionale)
JSON object/arrayno
{ "field": "email", "reason": "formato non valido" }
Dettagli strutturati (es. errori di validazione per campo).
envelope
Envelope { ok, data/error }
booleannotrueAvvolge la risposta nel formato standard. Disattiva per restituire i dati grezzi.
cors
Abilita CORS
booleannoAggiunge gli header CORS — necessario se l'API è chiamata dal browser di una SPA.
corsOrigin
CORS Origin
stringno*Origine consentita (* o un dominio specifico).
corsMethods
CORS Metodi
stringnoGET,POST,PUT,DELETE,OPTIONS
corsHeaders
CORS Header consentiti
stringnoContent-Type,Authorization
corsCredentials
CORS Credentials
booleannoConsente l'invio di cookie/credenziali (Access-Control-Allow-Credentials).
headers
Header personalizzati (JSON)
JSON object/arrayno
{ "Cache-Control": "no-store", "X-Api-Version": "1" }
Header extra. I valori con a-capo (CRLF) vengono scartati (anti-injection).

⬆️ Node output

Fields available to downstream nodes via $node.<alias>.json.<field>:

  • default

💡 Configuration example

JSON snippet of the node as it appears in the workflow. Values are derived fromdefaultValue and from required parameters.

{
  "id": "node-action_api_response-1",
  "defId": "action_api_response",
  "label": "API: REST Response",
  "config": {
    "mode": "success",
    "data": "input",
    "statusSuccess": "200",
    "errorCode": "bad_request",
    "envelope": true,
    "corsOrigin": "*",
    "corsMethods": "GET,POST,PUT,DELETE,OPTIONS",
    "corsHeaders": "Content-Type,Authorization"
  }
}

🔗 Related nodes in the same category

Ready to use API: REST Response?

Available now on all FlowForge plans. Try it free without a credit card.

Start freeBrowse all nodes