Create a portal session
Signs the application's user in to the portal, where they add endpoints, pick event types, see deliveries and retry them, without you building any UI. Create one each time the user opens it (from your backend: never expose the API key) and open or embed the returned url; embedding needs the site's origin in the environment's portal settings.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
application*stringThe application's id (happ_…) or your uid for it.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"application/json- body
- body
- …
expires_in?integerSeconds until it expires: default 3600, at most 86400.
60 <= value <= 86400read_only?booleanThe user can look but not change anything.
The session, with its URL.
application/json- response
- response
- …
object*"hook_portal_session""hook_portal_session"id*stringapplication_id*stringurl*stringOpen it or embed it in an iframe (from an allowed origin). The token is in the URL fragment, so it never reaches a server log: hand the URL only to that application's user.
token*stringThe secret part of url, shown only here.
read_only*booleanexpires_at*stringdate-timeimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.hooks.portal.createSession({ application: "customer_8812", expires_in: 3600,});{ "object": "hook_portal_session", "id": "hps_01k7c8m4q2f3e9v6t5r1n0p8yz", "application_id": "happ_01k7c8m4q2f3e9v6t5r1n0p8yz", "url": "https://portal.example/s/hps_01k7c8m4q2f3e9v6t5r1n0p8yz#cossp_…", "token": "cossp_…", "read_only": false, "expires_at": "2026-01-15T10:30:00.000Z"}