- Authentication
- Flows
- User
- Templates
- Executions
- Webhooks
Add a new template to the repository
POST
https://api.platform.openintegrationhub.com/templates
templates
Request
Body Params application/json
name
string
required
Example:
SnazzyToCodeComponent
description
string
optional
Example:
This flow polls for persons and posts them on webhoo.site.
graph
object (FlowGraph)
required
nodes
array [object {7}]
optional
edges
array [object {4}]
optional
type
enum<string>
required
Allowed values:
ordinaryrealtime
Example:
ordinary
cron
string
optional
Example:
* /2 * * * *
owners
array[object (Owner) {2}]
optional
id
string
required
type
string
required
Example
{
"name": "SnazzyToCodeComponent",
"description": "This flow polls for persons and posts them on webhoo.site.",
"graph": {
"nodes": [
[
{
"id": "step_1",
"componentId": "string",
"name": "snazzy adapter for oih",
"function": "getPersonsPolling",
"description": "New description in progress"
},
{
"id": "step_2",
"componentId": "string",
"name": "code_component",
"function": "execute",
"description": "",
"fields": {
"code": "function* run() {console.log('Calling external URL');yield request.post({uri: 'http://webhook.site/debc8244-3ca0-4449-af2b-e346c4f57b85', body: msg.body, json: true});}"
}
}
]
],
"edges": [
{
"id": "string",
"config": {
"condition": "string",
"mapper": {}
},
"source": "step_1",
"target": "step_2"
}
]
},
"type": "ordinary",
"cron": "* /2 * * * *",
"owners": [
{
"id": "string",
"type": "string"
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.platform.openintegrationhub.com/templates' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "SnazzyToCodeComponent",
"description": "This flow polls for persons and posts them on webhoo.site.",
"graph": {
"nodes": [
[
{
"id": "step_1",
"componentId": "string",
"name": "snazzy adapter for oih",
"function": "getPersonsPolling",
"description": "New description in progress"
},
{
"id": "step_2",
"componentId": "string",
"name": "code_component",
"function": "execute",
"description": "",
"fields": {
"code": "function* run() {console.log('\''Calling external URL'\'');yield request.post({uri: '\''http://webhook.site/debc8244-3ca0-4449-af2b-e346c4f57b85'\'', body: msg.body, json: true});}"
}
}
]
],
"edges": [
{
"id": "string",
"config": {
"condition": "string",
"mapper": {}
},
"source": "step_1",
"target": "step_2"
}
]
},
"type": "ordinary",
"cron": "* /2 * * * *",
"owners": [
{
"id": "string",
"type": "string"
}
]
}'
Responses
🟢201Created
application/json
Body
data
object (FlowTemplate)
optional
name
string
required
Example:
SnazzyToCodeComponent
description
string
optional
Example:
This flow polls for persons and posts them on webhoo.site.
graph
object
FlowGraph
type
enum<string>
required
Allowed values:
ordinaryrealtime
Example:
ordinary
cron
string
optional
Example:
* /2 * * * *
owners
array[object (Owner) {2}]
optional
id
string
required
status
enum<string>
optional
Allowed values:
publisheddraft
Example:
draft
tags
array[string]
optional
Example:
["advanced","premium"]
createdAt
string <date-time>
required
Example:
2019-07-30T12:52:45.957Z
updatedAt
string <date-time>
required
Example:
2019-07-30T12:52:45.957Z
meta
object
optional
Example
{
"data": {
"name": "SnazzyToCodeComponent",
"description": "This flow polls for persons and posts them on webhoo.site.",
"graph": {
"nodes": [
[
{
"id": "step_1",
"componentId": "string",
"name": "snazzy adapter for oih",
"function": "getPersonsPolling",
"description": "New description in progress"
},
{
"id": "step_2",
"componentId": "string",
"name": "code_component",
"function": "execute",
"description": "",
"fields": {
"code": "function* run() {console.log('Calling external URL');yield request.post({uri: 'http://webhook.site/debc8244-3ca0-4449-af2b-e346c4f57b85', body: msg.body, json: true});}"
}
}
]
],
"edges": [
{
"id": "string",
"config": {
"condition": "string",
"mapper": {}
},
"source": "step_1",
"target": "step_2"
}
]
},
"type": "ordinary",
"cron": "* /2 * * * *",
"owners": [
{
"id": "string",
"type": "string"
}
],
"id": "string",
"status": "published",
"tags": [
"advanced",
"premium"
],
"createdAt": "2019-07-30T12:52:45.957Z",
"updatedAt": "2019-07-30T12:52:45.957Z"
},
"meta": {}
}
Modified at 2025-01-16 10:20:25