Node

A Node represents a collection of NodeActions and NodeTransitions within a Flow. A Node is also known as a Step in the Recrubo platform.

Endpoints

  • GET /nodes - Retrieve all nodes (of all flows)

  • GET /nodes/{id} - Retrieve a single node by ID

  • POST /nodes - Create a new node

  • PATCH /nodes/{id} - Update a node by ID

  • DELETE /nodes/{id} - Delete a node by ID

Attributes

Field
Type
Description

name

String

Display name of the node

index

Integer

Index of the node

flowId

String

ID of the flow the node belongs to

isStartFlow

Boolean

Marks the starting node of a flow (only 1 per flow)

isEndFlow

Boolean

Marks an ending node of the flow (endFlowType is required when true)

endFlowType

String

Type of ending (allowed values are 'accepted', 'declined', 'update' and 'reset'

HTTP methods

Field
GET
POST
PATCH

name

X

X

X

index

X

X

X

flowId

X

isStartFlow

X

X

X

isEndFlow

X

X

X

endFlowType

X

X

X

When setting isEndFlow to 'true', make sure to also provide an endFlowType.

Example bodies

Post

{
    "data": {
        "type": "nodes",
        "attributes": {
            "name": "My first Node",
            "index": 0,
            "isStartFlow": true
        },
        "relationships": {
            "flow": {
                "data": {
                    "type": "flows",
                    "id": "your-flow-id"
                }
            }
        }
    }
}

Patch

{
    "data": {
        "id": "target-node-id",
        "type": "nodes",
        "attributes": {
            "isStartFlow": false,
            "isEndFlow": true,
            "endFlowType": "accepted"
        }
    }
}

OpenAPI

Get a Node

get
Authorizations
Path parameters
idstringRequired
Responses
200

Node found

application/vnd.api+json
get
GET /public/v2/nodes/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*
200

Node found

{
  "data": {
    "id": "8d328918-2622-4de5-a41c-9a8749fedeb0",
    "type": "nodes",
    "attributes": {
      "createdAt": "2024-08-20T10:45:10+00:00",
      "updatedAt": "2024-08-20T10:45:10+00:00",
      "name": null,
      "index": null,
      "isStartFlow": null,
      "isEndFlow": null,
      "endFlowType": null
    },
    "relationships": {
      "flow": {
        "links": {
          "related": "/public/v2/flows/d59eda89-c5ed-456a-b20c-799e4c08f094"
        }
      },
      "nodeActions": {
        "links": {
          "related": "/public/v2/node-actions?filter[nodeId]=8d328918-2622-4de5-a41c-9a8749fedeb0"
        }
      },
      "nodeTransitions": {
        "links": {
          "related": "/public/v2/node-transitions?filter[nodeId]=8d328918-2622-4de5-a41c-9a8749fedeb0"
        }
      }
    }
  },
  "meta": {}
}

Patch a Node

patch
Authorizations
Path parameters
idstringRequired
Body
Responses
200

Node updated

application/vnd.api+json
patch
PATCH /public/v2/nodes/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 132

{
  "data": {
    "id": "text",
    "type": "text",
    "attributes": {
      "name": "text",
      "index": 1,
      "isStartFlow": true,
      "isEndFlow": true,
      "endFlowType": "text"
    }
  }
}
200

Node updated

{
  "data": {
    "id": "325adb99-db21-4773-817f-90c21bbd8a4f",
    "type": "nodes",
    "attributes": {
      "createdAt": "2024-08-20T10:45:10+00:00",
      "updatedAt": "2024-08-20T10:45:10+00:00",
      "name": "Newest Name",
      "index": null,
      "isStartFlow": null,
      "isEndFlow": null,
      "endFlowType": null
    },
    "relationships": {
      "flow": {
        "links": {
          "related": "/public/v2/flows/ac9c0791-a018-49e5-8881-0c06204b6c78"
        }
      },
      "nodeActions": {
        "links": {
          "related": "/public/v2/node-actions?filter[nodeId]=325adb99-db21-4773-817f-90c21bbd8a4f"
        }
      },
      "nodeTransitions": {
        "links": {
          "related": "/public/v2/node-transitions?filter[nodeId]=325adb99-db21-4773-817f-90c21bbd8a4f"
        }
      }
    }
  },
  "meta": {}
}

Last updated