curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/definitions/workflows?token=' \
--header 'Content-Type: application/json' \
--data '
{
"name": "wf_archive",
"startStateId": 1,
"states": [
{
"isAutomatic": true,
"stateId": 1,
"stateName": "<string>",
"isEditable": true,
"isReadOnly": true,
"isSignable": true,
"reconstructSignatures": true,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
],
"actions": [
{
"archive": true,
"id": 1,
"name": "<string>",
"nextState": 1,
"recipient": true,
"stateId": 1,
"allowedAddressingGroups": true,
"allowedAddressingUsers": true,
"allowedGroups": [
"<string>"
],
"allowedUsers": [
"john.doe+member@example.com"
],
"allowExternal": true,
"autoSign": true,
"commentForbidden": true,
"commentRequired": true,
"composeTemplate": [
"d_invoice"
],
"following": "<string>",
"groupFilter": "<string>",
"important": false,
"multipleReceivers": true,
"multipleSignFieldUsers": true,
"order": 123,
"predefinedReceiver": true,
"receiver": "<string>",
"rights": "<string>",
"send": true,
"sentiment": "neutral",
"signAction": true,
"signFields": true,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"cancelStateId": 1,
"requests": [
{
"id": 1,
"name": "<string>",
"stateId": 1,
"allowedAddressingGroups": true,
"allowedAddressingUsers": true,
"allowedGroups": [
"<string>"
],
"allowedUsers": [
"john.doe+member@example.com"
],
"allowExternal": true,
"autoSign": true,
"commentForbidden": true,
"commentRequired": true,
"composeTemplate": [
"<string>"
],
"groupFilter": "<string>",
"important": false,
"multipleReceivers": true,
"multipleSignFieldUsers": true,
"order": 123,
"predefinedReceiver": true,
"receiver": "<string>",
"recipient": true,
"resolvedBy": 1,
"revertSignatures": true,
"rework": false,
"rights": "<string>",
"sentiment": "neutral",
"signAction": true,
"signFields": true,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"reworkStateId": 1,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
'import requests
url = "https://sandbox.circularo.com/api/v1/definitions/workflows?token="
payload = {
"name": "wf_archive",
"startStateId": 1,
"states": [
{
"isAutomatic": True,
"stateId": 1,
"stateName": "<string>",
"isEditable": True,
"isReadOnly": True,
"isSignable": True,
"reconstructSignatures": True,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
],
"actions": [
{
"archive": True,
"id": 1,
"name": "<string>",
"nextState": 1,
"recipient": True,
"stateId": 1,
"allowedAddressingGroups": True,
"allowedAddressingUsers": True,
"allowedGroups": ["<string>"],
"allowedUsers": ["john.doe+member@example.com"],
"allowExternal": True,
"autoSign": True,
"commentForbidden": True,
"commentRequired": True,
"composeTemplate": ["d_invoice"],
"following": "<string>",
"groupFilter": "<string>",
"important": False,
"multipleReceivers": True,
"multipleSignFieldUsers": True,
"order": 123,
"predefinedReceiver": True,
"receiver": "<string>",
"rights": "<string>",
"send": True,
"sentiment": "neutral",
"signAction": True,
"signFields": True,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"cancelStateId": 1,
"requests": [
{
"id": 1,
"name": "<string>",
"stateId": 1,
"allowedAddressingGroups": True,
"allowedAddressingUsers": True,
"allowedGroups": ["<string>"],
"allowedUsers": ["john.doe+member@example.com"],
"allowExternal": True,
"autoSign": True,
"commentForbidden": True,
"commentRequired": True,
"composeTemplate": ["<string>"],
"groupFilter": "<string>",
"important": False,
"multipleReceivers": True,
"multipleSignFieldUsers": True,
"order": 123,
"predefinedReceiver": True,
"receiver": "<string>",
"recipient": True,
"resolvedBy": 1,
"revertSignatures": True,
"rework": False,
"rights": "<string>",
"sentiment": "neutral",
"signAction": True,
"signFields": True,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"reworkStateId": 1,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'wf_archive',
startStateId: 1,
states: [
{
isAutomatic: true,
stateId: 1,
stateName: '<string>',
isEditable: true,
isReadOnly: true,
isSignable: true,
reconstructSignatures: true,
scheduledTransition: {actionId: 3, after: 86400, when: 'dueDate'}
}
],
actions: [
{
archive: true,
id: 1,
name: '<string>',
nextState: 1,
recipient: true,
stateId: 1,
allowedAddressingGroups: true,
allowedAddressingUsers: true,
allowedGroups: ['<string>'],
allowedUsers: ['john.doe+member@example.com'],
allowExternal: true,
autoSign: true,
commentForbidden: true,
commentRequired: true,
composeTemplate: ['d_invoice'],
following: '<string>',
groupFilter: '<string>',
important: false,
multipleReceivers: true,
multipleSignFieldUsers: true,
order: 123,
predefinedReceiver: true,
receiver: '<string>',
rights: '<string>',
send: true,
sentiment: 'neutral',
signAction: true,
signFields: true,
transitionAction: '<string>',
userFilter: '<string>'
}
],
cancelStateId: 1,
requests: [
{
id: 1,
name: '<string>',
stateId: 1,
allowedAddressingGroups: true,
allowedAddressingUsers: true,
allowedGroups: ['<string>'],
allowedUsers: ['john.doe+member@example.com'],
allowExternal: true,
autoSign: true,
commentForbidden: true,
commentRequired: true,
composeTemplate: ['<string>'],
groupFilter: '<string>',
important: false,
multipleReceivers: true,
multipleSignFieldUsers: true,
order: 123,
predefinedReceiver: true,
receiver: '<string>',
recipient: true,
resolvedBy: 1,
revertSignatures: true,
rework: false,
rights: '<string>',
sentiment: 'neutral',
signAction: true,
signFields: true,
transitionAction: '<string>',
userFilter: '<string>'
}
],
reworkStateId: 1,
scheduledTransition: {actionId: 3, after: 86400, when: 'dueDate'}
})
};
fetch('https://sandbox.circularo.com/api/v1/definitions/workflows?token=', 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://sandbox.circularo.com/api/v1/definitions/workflows?token=",
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([
'name' => 'wf_archive',
'startStateId' => 1,
'states' => [
[
'isAutomatic' => true,
'stateId' => 1,
'stateName' => '<string>',
'isEditable' => true,
'isReadOnly' => true,
'isSignable' => true,
'reconstructSignatures' => true,
'scheduledTransition' => [
'actionId' => 3,
'after' => 86400,
'when' => 'dueDate'
]
]
],
'actions' => [
[
'archive' => true,
'id' => 1,
'name' => '<string>',
'nextState' => 1,
'recipient' => true,
'stateId' => 1,
'allowedAddressingGroups' => true,
'allowedAddressingUsers' => true,
'allowedGroups' => [
'<string>'
],
'allowedUsers' => [
'john.doe+member@example.com'
],
'allowExternal' => true,
'autoSign' => true,
'commentForbidden' => true,
'commentRequired' => true,
'composeTemplate' => [
'd_invoice'
],
'following' => '<string>',
'groupFilter' => '<string>',
'important' => false,
'multipleReceivers' => true,
'multipleSignFieldUsers' => true,
'order' => 123,
'predefinedReceiver' => true,
'receiver' => '<string>',
'rights' => '<string>',
'send' => true,
'sentiment' => 'neutral',
'signAction' => true,
'signFields' => true,
'transitionAction' => '<string>',
'userFilter' => '<string>'
]
],
'cancelStateId' => 1,
'requests' => [
[
'id' => 1,
'name' => '<string>',
'stateId' => 1,
'allowedAddressingGroups' => true,
'allowedAddressingUsers' => true,
'allowedGroups' => [
'<string>'
],
'allowedUsers' => [
'john.doe+member@example.com'
],
'allowExternal' => true,
'autoSign' => true,
'commentForbidden' => true,
'commentRequired' => true,
'composeTemplate' => [
'<string>'
],
'groupFilter' => '<string>',
'important' => false,
'multipleReceivers' => true,
'multipleSignFieldUsers' => true,
'order' => 123,
'predefinedReceiver' => true,
'receiver' => '<string>',
'recipient' => true,
'resolvedBy' => 1,
'revertSignatures' => true,
'rework' => false,
'rights' => '<string>',
'sentiment' => 'neutral',
'signAction' => true,
'signFields' => true,
'transitionAction' => '<string>',
'userFilter' => '<string>'
]
],
'reworkStateId' => 1,
'scheduledTransition' => [
'actionId' => 3,
'after' => 86400,
'when' => 'dueDate'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/definitions/workflows?token="
payload := strings.NewReader("{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/definitions/workflows?token=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/definitions/workflows?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Create a workflow definition
POST /definitions/workflows
Defines a new workflow: the states a document can be in, the actions and requests that move it between them, and which state it starts, cancels and reworks in. A metadata definition then points at it by name to put its document type on that lifecycle.
The workflow is stored as given; nothing checks that every stateId an action refers to actually exists among the states, so a definition can be saved into a shape that strands documents. Transitions can be put behind rights afterwards with PUT /definitions/workflows/{name}/restrict.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
Required user role: admin
curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/definitions/workflows?token=' \
--header 'Content-Type: application/json' \
--data '
{
"name": "wf_archive",
"startStateId": 1,
"states": [
{
"isAutomatic": true,
"stateId": 1,
"stateName": "<string>",
"isEditable": true,
"isReadOnly": true,
"isSignable": true,
"reconstructSignatures": true,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
],
"actions": [
{
"archive": true,
"id": 1,
"name": "<string>",
"nextState": 1,
"recipient": true,
"stateId": 1,
"allowedAddressingGroups": true,
"allowedAddressingUsers": true,
"allowedGroups": [
"<string>"
],
"allowedUsers": [
"john.doe+member@example.com"
],
"allowExternal": true,
"autoSign": true,
"commentForbidden": true,
"commentRequired": true,
"composeTemplate": [
"d_invoice"
],
"following": "<string>",
"groupFilter": "<string>",
"important": false,
"multipleReceivers": true,
"multipleSignFieldUsers": true,
"order": 123,
"predefinedReceiver": true,
"receiver": "<string>",
"rights": "<string>",
"send": true,
"sentiment": "neutral",
"signAction": true,
"signFields": true,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"cancelStateId": 1,
"requests": [
{
"id": 1,
"name": "<string>",
"stateId": 1,
"allowedAddressingGroups": true,
"allowedAddressingUsers": true,
"allowedGroups": [
"<string>"
],
"allowedUsers": [
"john.doe+member@example.com"
],
"allowExternal": true,
"autoSign": true,
"commentForbidden": true,
"commentRequired": true,
"composeTemplate": [
"<string>"
],
"groupFilter": "<string>",
"important": false,
"multipleReceivers": true,
"multipleSignFieldUsers": true,
"order": 123,
"predefinedReceiver": true,
"receiver": "<string>",
"recipient": true,
"resolvedBy": 1,
"revertSignatures": true,
"rework": false,
"rights": "<string>",
"sentiment": "neutral",
"signAction": true,
"signFields": true,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"reworkStateId": 1,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
'import requests
url = "https://sandbox.circularo.com/api/v1/definitions/workflows?token="
payload = {
"name": "wf_archive",
"startStateId": 1,
"states": [
{
"isAutomatic": True,
"stateId": 1,
"stateName": "<string>",
"isEditable": True,
"isReadOnly": True,
"isSignable": True,
"reconstructSignatures": True,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
],
"actions": [
{
"archive": True,
"id": 1,
"name": "<string>",
"nextState": 1,
"recipient": True,
"stateId": 1,
"allowedAddressingGroups": True,
"allowedAddressingUsers": True,
"allowedGroups": ["<string>"],
"allowedUsers": ["john.doe+member@example.com"],
"allowExternal": True,
"autoSign": True,
"commentForbidden": True,
"commentRequired": True,
"composeTemplate": ["d_invoice"],
"following": "<string>",
"groupFilter": "<string>",
"important": False,
"multipleReceivers": True,
"multipleSignFieldUsers": True,
"order": 123,
"predefinedReceiver": True,
"receiver": "<string>",
"rights": "<string>",
"send": True,
"sentiment": "neutral",
"signAction": True,
"signFields": True,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"cancelStateId": 1,
"requests": [
{
"id": 1,
"name": "<string>",
"stateId": 1,
"allowedAddressingGroups": True,
"allowedAddressingUsers": True,
"allowedGroups": ["<string>"],
"allowedUsers": ["john.doe+member@example.com"],
"allowExternal": True,
"autoSign": True,
"commentForbidden": True,
"commentRequired": True,
"composeTemplate": ["<string>"],
"groupFilter": "<string>",
"important": False,
"multipleReceivers": True,
"multipleSignFieldUsers": True,
"order": 123,
"predefinedReceiver": True,
"receiver": "<string>",
"recipient": True,
"resolvedBy": 1,
"revertSignatures": True,
"rework": False,
"rights": "<string>",
"sentiment": "neutral",
"signAction": True,
"signFields": True,
"transitionAction": "<string>",
"userFilter": "<string>"
}
],
"reworkStateId": 1,
"scheduledTransition": {
"actionId": 3,
"after": 86400,
"when": "dueDate"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'wf_archive',
startStateId: 1,
states: [
{
isAutomatic: true,
stateId: 1,
stateName: '<string>',
isEditable: true,
isReadOnly: true,
isSignable: true,
reconstructSignatures: true,
scheduledTransition: {actionId: 3, after: 86400, when: 'dueDate'}
}
],
actions: [
{
archive: true,
id: 1,
name: '<string>',
nextState: 1,
recipient: true,
stateId: 1,
allowedAddressingGroups: true,
allowedAddressingUsers: true,
allowedGroups: ['<string>'],
allowedUsers: ['john.doe+member@example.com'],
allowExternal: true,
autoSign: true,
commentForbidden: true,
commentRequired: true,
composeTemplate: ['d_invoice'],
following: '<string>',
groupFilter: '<string>',
important: false,
multipleReceivers: true,
multipleSignFieldUsers: true,
order: 123,
predefinedReceiver: true,
receiver: '<string>',
rights: '<string>',
send: true,
sentiment: 'neutral',
signAction: true,
signFields: true,
transitionAction: '<string>',
userFilter: '<string>'
}
],
cancelStateId: 1,
requests: [
{
id: 1,
name: '<string>',
stateId: 1,
allowedAddressingGroups: true,
allowedAddressingUsers: true,
allowedGroups: ['<string>'],
allowedUsers: ['john.doe+member@example.com'],
allowExternal: true,
autoSign: true,
commentForbidden: true,
commentRequired: true,
composeTemplate: ['<string>'],
groupFilter: '<string>',
important: false,
multipleReceivers: true,
multipleSignFieldUsers: true,
order: 123,
predefinedReceiver: true,
receiver: '<string>',
recipient: true,
resolvedBy: 1,
revertSignatures: true,
rework: false,
rights: '<string>',
sentiment: 'neutral',
signAction: true,
signFields: true,
transitionAction: '<string>',
userFilter: '<string>'
}
],
reworkStateId: 1,
scheduledTransition: {actionId: 3, after: 86400, when: 'dueDate'}
})
};
fetch('https://sandbox.circularo.com/api/v1/definitions/workflows?token=', 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://sandbox.circularo.com/api/v1/definitions/workflows?token=",
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([
'name' => 'wf_archive',
'startStateId' => 1,
'states' => [
[
'isAutomatic' => true,
'stateId' => 1,
'stateName' => '<string>',
'isEditable' => true,
'isReadOnly' => true,
'isSignable' => true,
'reconstructSignatures' => true,
'scheduledTransition' => [
'actionId' => 3,
'after' => 86400,
'when' => 'dueDate'
]
]
],
'actions' => [
[
'archive' => true,
'id' => 1,
'name' => '<string>',
'nextState' => 1,
'recipient' => true,
'stateId' => 1,
'allowedAddressingGroups' => true,
'allowedAddressingUsers' => true,
'allowedGroups' => [
'<string>'
],
'allowedUsers' => [
'john.doe+member@example.com'
],
'allowExternal' => true,
'autoSign' => true,
'commentForbidden' => true,
'commentRequired' => true,
'composeTemplate' => [
'd_invoice'
],
'following' => '<string>',
'groupFilter' => '<string>',
'important' => false,
'multipleReceivers' => true,
'multipleSignFieldUsers' => true,
'order' => 123,
'predefinedReceiver' => true,
'receiver' => '<string>',
'rights' => '<string>',
'send' => true,
'sentiment' => 'neutral',
'signAction' => true,
'signFields' => true,
'transitionAction' => '<string>',
'userFilter' => '<string>'
]
],
'cancelStateId' => 1,
'requests' => [
[
'id' => 1,
'name' => '<string>',
'stateId' => 1,
'allowedAddressingGroups' => true,
'allowedAddressingUsers' => true,
'allowedGroups' => [
'<string>'
],
'allowedUsers' => [
'john.doe+member@example.com'
],
'allowExternal' => true,
'autoSign' => true,
'commentForbidden' => true,
'commentRequired' => true,
'composeTemplate' => [
'<string>'
],
'groupFilter' => '<string>',
'important' => false,
'multipleReceivers' => true,
'multipleSignFieldUsers' => true,
'order' => 123,
'predefinedReceiver' => true,
'receiver' => '<string>',
'recipient' => true,
'resolvedBy' => 1,
'revertSignatures' => true,
'rework' => false,
'rights' => '<string>',
'sentiment' => 'neutral',
'signAction' => true,
'signFields' => true,
'transitionAction' => '<string>',
'userFilter' => '<string>'
]
],
'reworkStateId' => 1,
'scheduledTransition' => [
'actionId' => 3,
'after' => 86400,
'when' => 'dueDate'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/definitions/workflows?token="
payload := strings.NewReader("{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/definitions/workflows?token=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/definitions/workflows?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"wf_archive\",\n \"startStateId\": 1,\n \"states\": [\n {\n \"isAutomatic\": true,\n \"stateId\": 1,\n \"stateName\": \"<string>\",\n \"isEditable\": true,\n \"isReadOnly\": true,\n \"isSignable\": true,\n \"reconstructSignatures\": true,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n }\n ],\n \"actions\": [\n {\n \"archive\": true,\n \"id\": 1,\n \"name\": \"<string>\",\n \"nextState\": 1,\n \"recipient\": true,\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"d_invoice\"\n ],\n \"following\": \"<string>\",\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"rights\": \"<string>\",\n \"send\": true,\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"cancelStateId\": 1,\n \"requests\": [\n {\n \"id\": 1,\n \"name\": \"<string>\",\n \"stateId\": 1,\n \"allowedAddressingGroups\": true,\n \"allowedAddressingUsers\": true,\n \"allowedGroups\": [\n \"<string>\"\n ],\n \"allowedUsers\": [\n \"john.doe+member@example.com\"\n ],\n \"allowExternal\": true,\n \"autoSign\": true,\n \"commentForbidden\": true,\n \"commentRequired\": true,\n \"composeTemplate\": [\n \"<string>\"\n ],\n \"groupFilter\": \"<string>\",\n \"important\": false,\n \"multipleReceivers\": true,\n \"multipleSignFieldUsers\": true,\n \"order\": 123,\n \"predefinedReceiver\": true,\n \"receiver\": \"<string>\",\n \"recipient\": true,\n \"resolvedBy\": 1,\n \"revertSignatures\": true,\n \"rework\": false,\n \"rights\": \"<string>\",\n \"sentiment\": \"neutral\",\n \"signAction\": true,\n \"signFields\": true,\n \"transitionAction\": \"<string>\",\n \"userFilter\": \"<string>\"\n }\n ],\n \"reworkStateId\": 1,\n \"scheduledTransition\": {\n \"actionId\": 3,\n \"after\": 86400,\n \"when\": \"dueDate\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Body
Name the workflow is known by. It identifies the definition, a metadata definition binds its documents to it by this name, and the rights that gate its transitions are named after it - so renaming a workflow leaves both the documents and the rights pointing at something that is no longer there.
1"wf_archive"