Create a stream trigger
curl --request POST \
--url https://api.quiva.ai/trigger/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"trigger_type": "stream",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
}
}
'import requests
url = "https://api.quiva.ai/trigger/stream"
payload = {
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"trigger_type": "stream",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-stream-trigger',
collection: 'my-collection',
description: 'Stream data processing trigger',
trigger_type: 'stream',
source: {subject: 'ms.data.source', type: 'stream', response_type: 'Stream'},
target: {subject: 'ms.data.target', account: 'account_identifier', type: 'stream'}
})
};
fetch('https://api.quiva.ai/trigger/stream', 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://api.quiva.ai/trigger/stream",
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' => 'my-stream-trigger',
'collection' => 'my-collection',
'description' => 'Stream data processing trigger',
'trigger_type' => 'stream',
'source' => [
'subject' => 'ms.data.source',
'type' => 'stream',
'response_type' => 'Stream'
],
'target' => [
'subject' => 'ms.data.target',
'account' => 'account_identifier',
'type' => 'stream'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.quiva.ai/trigger/stream"
payload := strings.NewReader("{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.quiva.ai/trigger/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/trigger/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}"
response = http.request(request)
puts response.read_body{
"body": {
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
},
"stream": "quiva-trigger-config",
"subject": "ms.trigger.stream.my-stream-trigger",
"trigger_type": "stream",
"type": "created"
},
"status_code": 201
}{
"error": "Invalid request: Missing required field 'name' in trigger definition",
"status_code": 400
}{
"error": "Unauthorized: Invalid or missing authentication token",
"status_code": 401
}{
"error": "Internal server error: Unable to process request at this time",
"status_code": 500
}Stream Triggers
Create a stream trigger
Creates a new stream trigger for data processing and routing. A stream trigger connects a data source to a target, enabling real-time data flow between components.
Usage Notes:
- The system automatically creates necessary import/export pairs
- Stream triggers define both source and target configurations
- The source configuration specifies where data originates
- The target configuration specifies where data should be delivered
- Response types can be Singleton (single response), Stream (continuous), or Chunked (paginated)
- Source and target types determine how data flows through the system
- The trigger is active immediately after creation
- Both synchronous and asynchronous data processing patterns are supported
POST
/
trigger
/
stream
Create a stream trigger
curl --request POST \
--url https://api.quiva.ai/trigger/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"trigger_type": "stream",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
}
}
'import requests
url = "https://api.quiva.ai/trigger/stream"
payload = {
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"trigger_type": "stream",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-stream-trigger',
collection: 'my-collection',
description: 'Stream data processing trigger',
trigger_type: 'stream',
source: {subject: 'ms.data.source', type: 'stream', response_type: 'Stream'},
target: {subject: 'ms.data.target', account: 'account_identifier', type: 'stream'}
})
};
fetch('https://api.quiva.ai/trigger/stream', 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://api.quiva.ai/trigger/stream",
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' => 'my-stream-trigger',
'collection' => 'my-collection',
'description' => 'Stream data processing trigger',
'trigger_type' => 'stream',
'source' => [
'subject' => 'ms.data.source',
'type' => 'stream',
'response_type' => 'Stream'
],
'target' => [
'subject' => 'ms.data.target',
'account' => 'account_identifier',
'type' => 'stream'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.quiva.ai/trigger/stream"
payload := strings.NewReader("{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.quiva.ai/trigger/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/trigger/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-stream-trigger\",\n \"collection\": \"my-collection\",\n \"description\": \"Stream data processing trigger\",\n \"trigger_type\": \"stream\",\n \"source\": {\n \"subject\": \"ms.data.source\",\n \"type\": \"stream\",\n \"response_type\": \"Stream\"\n },\n \"target\": {\n \"subject\": \"ms.data.target\",\n \"account\": \"account_identifier\",\n \"type\": \"stream\"\n }\n}"
response = http.request(request)
puts response.read_body{
"body": {
"name": "my-stream-trigger",
"collection": "my-collection",
"description": "Stream data processing trigger",
"source": {
"subject": "ms.data.source",
"type": "stream",
"response_type": "Stream"
},
"target": {
"subject": "ms.data.target",
"account": "account_identifier",
"type": "stream"
},
"stream": "quiva-trigger-config",
"subject": "ms.trigger.stream.my-stream-trigger",
"trigger_type": "stream",
"type": "created"
},
"status_code": 201
}{
"error": "Invalid request: Missing required field 'name' in trigger definition",
"status_code": 400
}{
"error": "Unauthorized: Invalid or missing authentication token",
"status_code": 401
}{
"error": "Internal server error: Unable to process request at this time",
"status_code": 500
}Authorizations
JWT token for authentication. Required for all API operations to verify identity and access permissions.
Body
application/json
Unique name identifier for the trigger. Used to construct the trigger's topic and subject.
Example:
"my-stream-trigger"
Must be 'stream' for this endpoint. Determines the trigger's behavior and available properties.
Available options:
stream Example:
"stream"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Logical grouping the trigger belongs to. Used for organizing and filtering triggers.
Example:
"my-collection"
Human-readable description explaining the trigger's purpose and function.
Example:
"Stream data processing trigger"
⌘I