curl --request POST \
--url https://{instance}.omniapp.co/api/v1/embed/sso/generate-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalId": "user-123",
"name": "Blob Ross",
"groups": [
"engineering",
"sales"
],
"userAttributes": {
"account_id": "9007199254740993",
"region": "us-east",
"tier": 2
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/embed/sso/generate-session"
payload = {
"externalId": "user-123",
"name": "Blob Ross",
"groups": ["engineering", "sales"],
"userAttributes": {
"account_id": "9007199254740993",
"region": "us-east",
"tier": 2
}
}
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({
externalId: 'user-123',
name: 'Blob Ross',
groups: ['engineering', 'sales'],
userAttributes: {account_id: '9007199254740993', region: 'us-east', tier: 2}
})
};
fetch('https://{instance}.omniapp.co/api/v1/embed/sso/generate-session', 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://{instance}.omniapp.co/api/v1/embed/sso/generate-session",
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([
'externalId' => 'user-123',
'name' => 'Blob Ross',
'groups' => [
'engineering',
'sales'
],
'userAttributes' => [
'account_id' => '9007199254740993',
'region' => 'us-east',
'tier' => 2
]
]),
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://{instance}.omniapp.co/api/v1/embed/sso/generate-session"
payload := strings.NewReader("{\n \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\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://{instance}.omniapp.co/api/v1/embed/sso/generate-session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/embed/sso/generate-session")
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 \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"sessionId": "<string>"
}{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}Generate embedded SSO session
The Embed feature must be enabled in your Omni organization to use this endpoint.
Generate an embedded SSO session.
curl --request POST \
--url https://{instance}.omniapp.co/api/v1/embed/sso/generate-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalId": "user-123",
"name": "Blob Ross",
"groups": [
"engineering",
"sales"
],
"userAttributes": {
"account_id": "9007199254740993",
"region": "us-east",
"tier": 2
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/embed/sso/generate-session"
payload = {
"externalId": "user-123",
"name": "Blob Ross",
"groups": ["engineering", "sales"],
"userAttributes": {
"account_id": "9007199254740993",
"region": "us-east",
"tier": 2
}
}
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({
externalId: 'user-123',
name: 'Blob Ross',
groups: ['engineering', 'sales'],
userAttributes: {account_id: '9007199254740993', region: 'us-east', tier: 2}
})
};
fetch('https://{instance}.omniapp.co/api/v1/embed/sso/generate-session', 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://{instance}.omniapp.co/api/v1/embed/sso/generate-session",
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([
'externalId' => 'user-123',
'name' => 'Blob Ross',
'groups' => [
'engineering',
'sales'
],
'userAttributes' => [
'account_id' => '9007199254740993',
'region' => 'us-east',
'tier' => 2
]
]),
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://{instance}.omniapp.co/api/v1/embed/sso/generate-session"
payload := strings.NewReader("{\n \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\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://{instance}.omniapp.co/api/v1/embed/sso/generate-session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/embed/sso/generate-session")
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 \"externalId\": \"user-123\",\n \"name\": \"Blob Ross\",\n \"groups\": [\n \"engineering\",\n \"sales\"\n ],\n \"userAttributes\": {\n \"account_id\": \"9007199254740993\",\n \"region\": \"us-east\",\n \"tier\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"sessionId": "<string>"
}{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Body
External identifier for the user, from your system.
"user-123"
Display name for the user
"Blob Ross"
Optional list of non-entity group names to assign to the user. Entity-group membership is managed by the entity URL parameter.
["engineering", "sales"]
Optional user attributes for row-level security. Values are a string, a number, or an array of strings/numbers. Numbers are converted to strings on receipt, so send anything beyond the JSON safe integer range (2^53 - 1) as a string or it loses precision before Omni sees it.
Show child attributes
Show child attributes
{
"account_id": "9007199254740993",
"region": "us-east",
"tier": 2
}
Response
Session token generated
Session ID to use for embedding Omni content
Was this page helpful?

