Get SDK origins
curl --request GET \
--url https://api.omni.z-api.io/instances/{channelId}/sdk-info \
--header 'Authorization: <api-key>'import requests
url = "https://api.omni.z-api.io/instances/{channelId}/sdk-info"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.omni.z-api.io/instances/{channelId}/sdk-info', 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.omni.z-api.io/instances/{channelId}/sdk-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/instances/{channelId}/sdk-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/instances/{channelId}/sdk-info")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/instances/{channelId}/sdk-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"allowOrigins": [
"https://app.yourcompany.com",
"http://localhost:3000"
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Channels
SDK origins
Allow the domains that can call the connection SDK and diagnose silent failures
GET
/
instances
/
{channelId}
/
sdk-info
Get SDK origins
curl --request GET \
--url https://api.omni.z-api.io/instances/{channelId}/sdk-info \
--header 'Authorization: <api-key>'import requests
url = "https://api.omni.z-api.io/instances/{channelId}/sdk-info"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.omni.z-api.io/instances/{channelId}/sdk-info', 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.omni.z-api.io/instances/{channelId}/sdk-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/instances/{channelId}/sdk-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/instances/{channelId}/sdk-info")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/instances/{channelId}/sdk-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"allowOrigins": [
"https://app.yourcompany.com",
"http://localhost:3000"
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Concepts
The connection SDK resolves{ success: false } without saying why. In practice it fails through two very different paths, and this endpoint solves the first one.
Failure 1 — origin not allowed
The SDK only works from domains registered inallowOrigins. If the browser origin is not on the list, it aborts with:
[Omni Z-API SDK] Origin "https://app.yourcompany.com" is not in the allowed origins list.
const info = await fetch(
`https://api.omni.z-api.io/instances/${channelId}/sdk-info`,
{ headers: { Authorization: YOUR_PUBLIC_KEY } },
).then((r) => r.json());
const allowed = info.allowOrigins.includes(window.location.origin);
The Omni Z-API dashboard domain is always accepted, even when it is not in
allowOrigins. You only need to register your domains — including http://localhost:3000 for development.Registering origins is done in the dashboard, under Security. There is no public endpoint for it.
Failure 2 — popup blocked
The SDK opens a window withwindow.open. If you call client.connect() after an await, the user gesture is already lost and the browser blocks the popup — the SDK also returns { success: false }.
// Wrong: the await consumes the click gesture
async function onClick() {
const data = await loadSomething();
await client.connect({ channelId }); // popup blocked
}
// Right: connect() is the first thing after the click
async function onClick() {
const promise = client.connect({ channelId });
const data = await loadSomething();
await promise;
}
Authentication
This is the only endpoint that accepts the Public Key, and it goes raw in the header — noBearer:
curl https://api.omni.z-api.io/instances/CHANNEL_ID/sdk-info \
-H "Authorization: YOUR_PUBLIC_KEY"