Sessions
List sessions
Lists every session in the authenticated team or selected project, including disconnected sessions and their latest status reason.
Requires sessions:read. Project tokens only access resources in their own project.
GET
/
platform
/
sessions
List sessions
curl --request GET \
--url https://api.polymorfa.com/platform/sessions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polymorfa.com/platform/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"data": [
{
"_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_creationTime": 123,
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sessionId": "<string>",
"name": "<string>",
"phone": "<string>",
"platform": "<string>",
"isBusiness": true,
"testMode": true,
"tierOverride": "free",
"status": "<string>",
"statusReason": "<string>",
"messageCount": 1,
"lastActiveAt": 123,
"paidUntil": 123,
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isDefault": true
},
"claim": {
"kind": "unclaimed"
}
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}Authorizations
Send your team API key or project token as Authorization: Bearer <token>. The credential must have the required permissions. Project tokens can access only their own project.
Query Parameters
Identifier of the Polymorfa project that owns this resource.
Response
Success
Structured data carried by this object.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
List sessions
curl --request GET \
--url https://api.polymorfa.com/platform/sessions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polymorfa.com/platform/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"data": [
{
"_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_creationTime": 123,
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sessionId": "<string>",
"name": "<string>",
"phone": "<string>",
"platform": "<string>",
"isBusiness": true,
"testMode": true,
"tierOverride": "free",
"status": "<string>",
"statusReason": "<string>",
"messageCount": 1,
"lastActiveAt": 123,
"paidUntil": 123,
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isDefault": true
},
"claim": {
"kind": "unclaimed"
}
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}