Update a Stream

PUT /streams/:id

Updates an existing stream.

🚧

Changing Resource Filters

Once a stream is filtered to a specific set of resources, it cannot be changed. You must delete and recreate the stream.

Request Parameters

NameRequired FieldTypeDescription
namerequiredstringA unique name for the stream.

HTTP Response Status

Response CodeDescription
200 (Ok)Indicates the request was received and the object was updated successfully.
422 (Unprocessable Entity)An error occurred and an error response has been sent with details.

Code Samples

curl --request PUT \
  --url 'https://streams.v2.validic.com/streams/5978dc880b11e700010ae88b?token=6f46db36dd6543d2b82d91698fcd0896' \
  --header 'content-type: application/json' \
  --data '{
  "name": "WilcoMemorial"
}
'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://streams.v2.validic.com/streams/5978dc880b11e700010ae88b?token=6f46db36dd6543d2b82d91698fcd0896"

	payload := strings.NewReader("{\n  \"name\": \"WilcoMemorial\"\n}\n")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://streams.v2.validic.com/streams/5978dc880b11e700010ae88b?token=6f46db36dd6543d2b82d91698fcd0896")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n  \"name\": \"WilcoMemorial\"\n}\n"

response = http.request(request)
puts response.read_body
import requests

url = "https://streams.v2.validic.com/streams/5978dc880b11e700010ae88b"

querystring = {"token":"6f46db36dd6543d2b82d91698fcd0896"}

payload = "{\n  \"name\": \"WilcoMemorial\"\n}\n"
headers = {'content-type': 'application/json'}

response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://streams.v2.validic.com/streams/5978dc880b11e700010ae88b?token=6f46db36dd6543d2b82d91698fcd0896",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\n  \"name\": \"WilcoMemorial\"\n}\n",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
{
    "id": "5978dc880b11e700010ae88b",
    "name": "WilcoMemorial",
    "resource_filter": [],
    "start_date": null,
    "group": "stream_5978dc880b11e700010ae88b",
    "members": 0,
    "created_at": "2017-07-26T18:16:40Z",
    "updated_at": "2017-08-04T16:38:22Z"
}

Response Field Descriptions

NameTypeDescription
idstringUnique identifier for the stream.
namestringThe name of the stream provided by the customer.
groupstringValidic name for the stream.
membersintegerThe number of clients currently connected.
start_datestringOnly events with start times on or after this field are sent.
resource_filterarrayOnly events with resource types included in this list are sent.
created_atstringThe date and time the resource was created.
updated_atstringThe date and time the resource was updated.

What’s Next