curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "MacBook ops"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets"
payload = { "label": "MacBook ops" }
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({label: 'MacBook ops'})
};
fetch('https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets', 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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets",
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([
'label' => 'MacBook ops'
]),
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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets"
payload := strings.NewReader("{\n \"label\": \"MacBook ops\"\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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"MacBook ops\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets")
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 \"label\": \"MacBook ops\"\n}"
response = http.request(request)
puts response.read_body{
"id": "rts-3f2b…",
"label": "MacBook ops",
"secret": "wss_J8x…",
"lastFour": "a1B2",
"createdAt": "2023-11-07T05:31:56Z"
}Generate a WebSocket secret
Creates a new per-member WebSocket secret used to authenticate against the organization realtime activity stream. The plaintext secret is returned ONCE in the response and is never retrievable again — store it immediately. The secret belongs to the calling member; any active member manages their own secrets. The realtime feature is gated on the org’s live subscription tier (resolved from the subscription row, not the denormalised cache). Requires a Nevermined API key. Requires active organization membership. Requires the organization to be on the Enterprise tier.
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "MacBook ops"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets"
payload = { "label": "MacBook ops" }
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({label: 'MacBook ops'})
};
fetch('https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets', 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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets",
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([
'label' => 'MacBook ops'
]),
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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets"
payload := strings.NewReader("{\n \"label\": \"MacBook ops\"\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.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"MacBook ops\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/realtime/secrets")
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 \"label\": \"MacBook ops\"\n}"
response = http.request(request)
puts response.read_body{
"id": "rts-3f2b…",
"label": "MacBook ops",
"secret": "wss_J8x…",
"lastFour": "a1B2",
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Organization ID
"org-abc123"
Body
Human-readable label for the secret, e.g. "MacBook ops".
80"MacBook ops"
Response
Secret created. The plaintext secret is included once and never again.
"rts-3f2b…"
"MacBook ops"
Plaintext secret — shown ONCE. Copy it now; it is never retrievable again.
"wss_J8x…"
Last 4 chars (the dashboard masks it as wss_…XXXX).
"a1B2"
Was this page helpful?