Send guest invitations
This sample shows how little code it takes to issue a time-bound access invite with the OpenApp SDKs. The same program structure is repeated in every shipped language so you can copy the version that fits your stack.
Canonical sources live in packages/sdk/samples/guest-invitation/ in the SDK mirror repository.
What it does
Section titled “What it does”- Configure your API key, organization, integration, and portal.
- Create a one-hour access invite (example: a year-end celebration from
2025-12-31T20:00:00Zto2025-12-31T21:00:00Z). - Share the public invite URL with your guests.
The API returns an invite_token; build the guest link as https://<your-app>/invite/<token> (same shape the dashboard uses). Guests then follow Public Access to claim and open the door.
Sample program
Section titled “Sample program”"""Create a time-bound access invite for guests."""
# SDK docs: https://openapp.house/docs/sdk/python/
from openapp_sdk import Client
# Replace the placeholder values below with your org's values from the dashboard.# OPENAPP_API_KEY: generate at https://openapp.house/dashboard/resources/api-keysOPENAPP_API_KEY = ( "https://openapp.house_openapp_9kHWAeFWbMqPg0hMKshNGba7scA6mfmISG7mgI7Eok8")ORG_ID = "01KSYAX0BS1K7Y6R997XE1EWHY"INTEGRATION_NAME = "Virtual Access Demo" # name shown in the dashboardPORTAL_NAME = "Lobby Portal" # name shown in the dashboardEXPIRES_IN = "1w" # One week; you can also set exact dates with valid_from / valid_to.
def main() -> None: client = Client.connect(api_key=OPENAPP_API_KEY, org_id=ORG_ID) integration = client.integrations.get_by_name(INTEGRATION_NAME) portal = client.integrations.get_access_portal_by_name( integration["id"], PORTAL_NAME ) invite = client.integrations.create_access_invite( integration["id"], portal_ids=[portal["id"]], name="Year-end celebration", expires_in=EXPIRES_IN, max_uses=50, invitee_message={"en": "Welcome — use this link during the party hour."}, ) # Share this URL with your guests. print(invite["invite_url"])
if __name__ == "__main__": main()/** * Create a time-bound access invite for guests. * * SDK docs: https://openapp.house/docs/sdk/typescript/ */import { AsyncClient } from "@tomers/openapp-sdk";
// Replace the placeholder values below with your org's values from the dashboard.// OPENAPP_API_KEY: generate at https://openapp.house/dashboard/resources/api-keysconst OPENAPP_API_KEY = "https://openapp.house_openapp_9kHWAeFWbMqPg0hMKshNGba7scA6mfmISG7mgI7Eok8";const ORG_ID = "01KSYAX0BS1K7Y6R997XE1EWHY";const INTEGRATION_NAME = "Virtual Access Demo"; // name shown in the dashboardconst PORTAL_NAME = "Lobby Portal"; // name shown in the dashboardconst EXPIRES_IN = "1w"; // One week; you can also set exact dates with valid_from / valid_to.
async function main(): Promise<void> { const client = new AsyncClient(OPENAPP_API_KEY, { org: ORG_ID }); try { const integration = await client.integrations.getByName(INTEGRATION_NAME); const portal = await client.integrations.getAccessPortalByName( String(integration.id), PORTAL_NAME, ); const invite = await client.integrations.createAccessInvite(String(integration.id), { portal_ids: [String(portal.id)], name: "Year-end celebration", expires_in: EXPIRES_IN, max_uses: 50, invitee_message: { en: "Welcome — use this link during the party hour." }, });
// Share this URL with your guests. console.log(invite.invite_url); } finally { client.close(); }}
main().catch(console.error);//! Create a time-bound access invite for guests.//!//! SDK docs: https://openapp.house/docs/sdk/rust/
use openapp_sdk::{Client, NameMatch};use serde_json::json;
// Replace the placeholder values below with your org's values from the dashboard.// OPENAPP_API_KEY: generate at https://openapp.house/dashboard/resources/api-keysconst OPENAPP_API_KEY: &str = "https://openapp.house_openapp_9kHWAeFWbMqPg0hMKshNGba7scA6mfmISG7mgI7Eok8";const ORG_ID: &str = "01KSYAX0BS1K7Y6R997XE1EWHY";const INTEGRATION_NAME: &str = "Virtual Access Demo"; // name shown in the dashboardconst PORTAL_NAME: &str = "Lobby Portal"; // name shown in the dashboardconst EXPIRES_IN: &str = "1w"; // One week; you can also set exact dates with valid_from / valid_to.
#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Client::builder() .api_key(OPENAPP_API_KEY) .org(ORG_ID) .build()?;
let integration = client .integrations() .get_by_name(INTEGRATION_NAME, NameMatch::Exact, None) .await?; let integration_id = integration["id"] .as_str() .ok_or("integration missing id")?; let portal = client .integrations() .get_access_portal_by_name(integration_id, PORTAL_NAME, NameMatch::Exact) .await?; let portal_id = portal["id"].as_str().ok_or("portal missing id")?;
let body = json!({ "portal_ids": [portal_id], "name": "Year-end celebration", "expires_in": EXPIRES_IN, "max_uses": 50, "invitee_message": { "en": "Welcome — use this link during the party hour." }, }); let invite = client .integrations() .create_access_invite(integration_id, &body) .await?;
// Share this URL with your guests. println!("{}", invite["invite_url"].as_str().expect("invite_url")); Ok(())}// Create a time-bound access invite for guests.//// SDK docs: https://openapp.house/docs/sdk/go/package main
import ( "context" "encoding/json" "fmt" "os"
openapiclient "github.com/tomers/openapp-sdk/go" "github.com/tomers/openapp-sdk/go/bridge")
// Replace the placeholder values below with your org's values from the dashboard.// OPENAPP_API_KEY: generate at https://openapp.house/dashboard/resources/api-keysconst ( openappAPIKey = "https://openapp.house_openapp_9kHWAeFWbMqPg0hMKshNGba7scA6mfmISG7mgI7Eok8" orgID = "01KSYAX0BS1K7Y6R997XE1EWHY" integrationName = "Virtual Access Demo" // name shown in the dashboard portalName = "Lobby Portal" // name shown in the dashboard expiresIn = "1w" // One week; you can also set exact dates with valid_from / valid_to.)
func main() { ctx := context.Background()
rt, err := bridge.NewRuntime() if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } defer rt.Close()
bc, err := bridge.NewClient(rt, openappAPIKey) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } defer bc.Close()
scoped, err := bc.WithOrg(orgID) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } defer scoped.Close()
_, _, integrationJSON, err := scoped.IntegrationsGetByName(integrationName, bridge.NameMatchExact) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } var integration struct { ID string `json:"id"` } if err := json.Unmarshal([]byte(integrationJSON), &integration); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) }
_, _, portalJSON, err := scoped.IntegrationsGetAccessPortalByName( integration.ID, portalName, bridge.NameMatchExact, ) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } var portal struct { ID string `json:"id"` } if err := json.Unmarshal([]byte(portalJSON), &portal); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) }
client, err := openapiclient.NewAPIClient(openappAPIKey) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } defer client.Close()
req := openapiclient.NewCreateAccessInviteRequest([]string{portal.ID}) req.SetName("Year-end celebration") req.SetExpiresIn(expiresIn) req.SetMaxUses(50) req.SetInviteeMessage(map[string]string{"en": "Welcome — use this link during the party hour."})
invite, _, err := client.IntegrationsAPI.CreateIntegrationAccessInvite(ctx, integration.ID). XOrg(orgID). CreateAccessInviteRequest(*req). Execute() if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) }
// Share this URL with your guests. fmt.Println(invite.GetInviteUrl())}Prerequisites
Section titled “Prerequisites”| Value | Where to find it |
|---|---|
| API key | Create an API key |
| Organization id | Dashboard or GET /orgs |
| Integration id | Dashboard → Integrations (Virtual Access) |
| Portal id | Integration → access portals |
For the underlying HTTP contract see Create a time-bound guest invitation and Integrations — access invites.
Related
Section titled “Related”- SDK overview — install commands and cross-language guides.
- Public Access — guest claim and execute flows.