API

ComSiteAccessSession

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/com_site_access/sessions create Viewer session for the site

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

created, err := client.ComSiteAccessSession(nil).Create(map[string]any{"host": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local created, err = client:ComSiteAccessSession():create({ host = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$created = $client->ComSiteAccessSession()->create(["host" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

created = client.ComSiteAccessSession().create({ "host": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

created = client.ComSiteAccessSession.create({ "host" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const created = await client.ComSiteAccessSession().create({ host: "example" })

Fields

Field Type Required Description
cookie_name string Yes Cookie Name
host string Yes Site hostname, for example docs.acme.composal.page
max_age integer Yes Max Age
session_token string Yes Session Token

create

POST /api/v1/com_site_access/sessions

Operation ID: api_v1_com_site_access_sessions.

Authentication: bearer token (bearerAuth).

Request body

application/json

Property Type Required Description
host string Yes Site hostname, for example docs.acme.composal.page

Responses

200: Viewer session for the site

application/json

Property Type Required Description
cookie_name string Yes
max_age integer Yes
session_token string Yes
401: Not signed in
403: The signed-in user cannot view the site, or the caller is an agent
404: Unknown site
422: The site is public and needs no sign-in