curl --request POST \
--url https://core.nextmatter.com/api/instances/{id}/complete_step/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"step_id": 123,
"actions": [
{
"action_id": 123,
"input_object": {}
}
],
"mode": "complete"
}
'import requests
url = "https://core.nextmatter.com/api/instances/{id}/complete_step/"
payload = {
"step_id": 123,
"actions": [
{
"action_id": 123,
"input_object": {}
}
],
"mode": "complete"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_id: 123, actions: [{action_id: 123, input_object: {}}], mode: 'complete'})
};
fetch('https://core.nextmatter.com/api/instances/{id}/complete_step/', 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://core.nextmatter.com/api/instances/{id}/complete_step/",
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([
'step_id' => 123,
'actions' => [
[
'action_id' => 123,
'input_object' => [
]
]
],
'mode' => 'complete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://core.nextmatter.com/api/instances/{id}/complete_step/"
payload := strings.NewReader("{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://core.nextmatter.com/api/instances/{id}/complete_step/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.nextmatter.com/api/instances/{id}/complete_step/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}"
response = http.request(request)
puts response.read_body{
"process": "<string>",
"name": "",
"deadline": "2023-11-07T05:31:56Z",
"priority": "V",
"tags": [
"<string>"
],
"step_assignments": [
{
"step_id": 123,
"user_id": 123
}
],
"url": "<string>",
"id": 123,
"started_time": "2023-11-07T05:31:56Z",
"completed_time": "2023-11-07T05:31:56Z",
"aborted_time": "2023-11-07T05:31:56Z",
"last_updated_time": "2023-11-07T05:31:56Z",
"process_snapshot": "<string>",
"active_step_ids": [
123
],
"step_deadlines": "<string>",
"public_url": "<string>",
"stage": "<string>"
}Complete a step in an instance of a workflow. The step needs to be active and the user that the API-Key is associated with needs to have access to the step (they need to act as assigned step owner, workflow lead, or an administrator).
curl --request POST \
--url https://core.nextmatter.com/api/instances/{id}/complete_step/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"step_id": 123,
"actions": [
{
"action_id": 123,
"input_object": {}
}
],
"mode": "complete"
}
'import requests
url = "https://core.nextmatter.com/api/instances/{id}/complete_step/"
payload = {
"step_id": 123,
"actions": [
{
"action_id": 123,
"input_object": {}
}
],
"mode": "complete"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_id: 123, actions: [{action_id: 123, input_object: {}}], mode: 'complete'})
};
fetch('https://core.nextmatter.com/api/instances/{id}/complete_step/', 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://core.nextmatter.com/api/instances/{id}/complete_step/",
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([
'step_id' => 123,
'actions' => [
[
'action_id' => 123,
'input_object' => [
]
]
],
'mode' => 'complete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://core.nextmatter.com/api/instances/{id}/complete_step/"
payload := strings.NewReader("{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://core.nextmatter.com/api/instances/{id}/complete_step/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.nextmatter.com/api/instances/{id}/complete_step/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step_id\": 123,\n \"actions\": [\n {\n \"action_id\": 123,\n \"input_object\": {}\n }\n ],\n \"mode\": \"complete\"\n}"
response = http.request(request)
puts response.read_body{
"process": "<string>",
"name": "",
"deadline": "2023-11-07T05:31:56Z",
"priority": "V",
"tags": [
"<string>"
],
"step_assignments": [
{
"step_id": 123,
"user_id": 123
}
],
"url": "<string>",
"id": 123,
"started_time": "2023-11-07T05:31:56Z",
"completed_time": "2023-11-07T05:31:56Z",
"aborted_time": "2023-11-07T05:31:56Z",
"last_updated_time": "2023-11-07T05:31:56Z",
"process_snapshot": "<string>",
"active_step_ids": [
123
],
"step_deadlines": "<string>",
"public_url": "<string>",
"stage": "<string>"
}Authorizations
Authentication is API key based. As an admin, you can generate an API key in Next Matter by going to Company > Next Matter API keys.
When sending requests to the API, authenticate by passing the API key in the "Authorization" HTTP header, prepended with the string "Api-Key ".
For example:
Authorization: Api-Key xyzabc.12fsfe242ubdgakew
Path Parameters
A unique integer value identifying this workflow instance.
Body
You can find the form field ID in the workflow editor.
Show child attributes
Show child attributes
Modes available to complete the step. If not specified, the default is "complete".
complete— complete the stepsave— save data in the step
save, complete Response
Returns the updated instance
The related workflow resource URI. For example https://core.nextmatter.com/api/processes/[IDoftheworkflowinNM]/. To find the workflow ID, navigate to the respective workflow at app.nextmatter.com, and copy the number at the very end of the URL.
The name of the instance. If automatic naming has been enabled, the name parameter needs to be an empty string, null, or completely left out.
255Time by which the instance should be completed
The priority of the instance. If you don't send this parameter, the priority will be "Regular". Other options are V - "Very High" and H - "High".
V, H A list of string tags separated by a comma
A list of user assignments per step. This is only required for workflows that have at least one step assignee set to "Select user at workflow start".
Show child attributes
Show child attributes
The instance resource URI. For example https://core.nextmatter.com/api/instances/[instance_id]/.
A snapshot of the workflow structure. If you set "inject_values" query parameter to "true", this will return the input values of the form fields., If you set "steps_time_frame" query parameter to "true", this will return the completion values of the form fields.
List of active step IDs of the instance
List of instance step deadlines
The public URL of the instance (for status tracking), if enabled in the workflow settings
11Was this page helpful?

