Sessions
Update session
Required scope: sessions:manage
PUT
/
platform
/
sessions
/
{sessionId}
Update session
curl --request PUT \
--url https://api.polymorfa.com/platform/sessions/{sessionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"set": {
"historySync": {
"requestFull": true
},
"hms": {
"enabled": false
},
"observation": {}
},
"reset": []
},
"revision": 1
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
set: {historySync: {requestFull: true}, hms: {enabled: false}, observation: {}},
reset: []
},
revision: 1
})
};
fetch('https://api.polymorfa.com/platform/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/sessions/{sessionId}"
payload = {
"configuration": {
"set": {
"historySync": { "requestFull": True },
"hms": { "enabled": False },
"observation": {}
},
"reset": []
},
"revision": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/sessions/{sessionId}"
payload := strings.NewReader("{\n \"configuration\": {\n \"set\": {\n \"historySync\": {\n \"requestFull\": true\n },\n \"hms\": {\n \"enabled\": false\n },\n \"observation\": {}\n },\n \"reset\": []\n },\n \"revision\": 1\n}")
req, _ := http.NewRequest("PUT", 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))
}false{
"success": true,
"data": {
"sessionId": "<string>",
"name": "<string>",
"tenantId": "<string>",
"type": "linked_device",
"testMode": true,
"status": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"externalId": "<string>",
"statusReason": "<string>",
"configuration": {
"requestedHistory": {
"mode": "metadata_only",
"requestFull": true
},
"effective": {
"observation": {
"presenceMode": "off",
"typingMode": "off",
"labelMode": "off",
"quickReplyMode": "off"
},
"historySync": {
"mode": "metadata_only",
"requestFull": true
},
"hms": {
"enabled": false
}
},
"overrides": {
"historySync": {
"mode": "metadata_only",
"requestFull": true
},
"hms": {
"enabled": false
},
"observation": {
"presenceMode": "off",
"typingMode": "off",
"labelMode": "off",
"quickReplyMode": "off"
}
},
"sources": {
"observation.presenceMode": "platform",
"observation.typingMode": "platform",
"observation.labelMode": "platform",
"observation.quickReplyMode": "platform",
"historySync.mode": "platform",
"historySync.requestFull": "platform",
"hms": "platform"
},
"revisions": {
"team": 1,
"project": 1,
"session": 1
},
"historyConsent": "pending",
"application": {
"desiredGeneration": 1,
"appliedGeneration": 1,
"status": "pending"
}
},
"newChatCapping": {
"enabled": true,
"pacing": true,
"status": "first_warning",
"capped": true,
"limit": 50,
"used": 26,
"remaining": 24,
"cycleStartsAt": "<string>",
"resetsAt": "<string>",
"observedAt": "<string>"
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credential",
"message": "Supply a valid credential.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}{
"error": {
"type": "conflict_error",
"code": "state_conflict",
"message": "The request conflicts with the resource state.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected service failure occurred. Keep the request ID for support.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#internal-error"
}{
"error": {
"type": "api_error",
"code": "service_unavailable",
"message": "A required service is unavailable. Check completion before repeating a write.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}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.
Path Parameters
Identifier of the connected Polymorfa session.
Body
application/json
Structured configuration values for this management platform access update session request.
Show child attributes
Show child attributes
Specifies revision for this management platform access update session request.
Value constraints
| Constraint | Accepted input |
|---|---|
| Numeric value | 0 or greater |
Required range:
x >= 0Was this page helpful?
⌘I
Update session
curl --request PUT \
--url https://api.polymorfa.com/platform/sessions/{sessionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"set": {
"historySync": {
"requestFull": true
},
"hms": {
"enabled": false
},
"observation": {}
},
"reset": []
},
"revision": 1
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
set: {historySync: {requestFull: true}, hms: {enabled: false}, observation: {}},
reset: []
},
revision: 1
})
};
fetch('https://api.polymorfa.com/platform/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/sessions/{sessionId}"
payload = {
"configuration": {
"set": {
"historySync": { "requestFull": True },
"hms": { "enabled": False },
"observation": {}
},
"reset": []
},
"revision": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/sessions/{sessionId}"
payload := strings.NewReader("{\n \"configuration\": {\n \"set\": {\n \"historySync\": {\n \"requestFull\": true\n },\n \"hms\": {\n \"enabled\": false\n },\n \"observation\": {}\n },\n \"reset\": []\n },\n \"revision\": 1\n}")
req, _ := http.NewRequest("PUT", 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))
}false{
"success": true,
"data": {
"sessionId": "<string>",
"name": "<string>",
"tenantId": "<string>",
"type": "linked_device",
"testMode": true,
"status": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"externalId": "<string>",
"statusReason": "<string>",
"configuration": {
"requestedHistory": {
"mode": "metadata_only",
"requestFull": true
},
"effective": {
"observation": {
"presenceMode": "off",
"typingMode": "off",
"labelMode": "off",
"quickReplyMode": "off"
},
"historySync": {
"mode": "metadata_only",
"requestFull": true
},
"hms": {
"enabled": false
}
},
"overrides": {
"historySync": {
"mode": "metadata_only",
"requestFull": true
},
"hms": {
"enabled": false
},
"observation": {
"presenceMode": "off",
"typingMode": "off",
"labelMode": "off",
"quickReplyMode": "off"
}
},
"sources": {
"observation.presenceMode": "platform",
"observation.typingMode": "platform",
"observation.labelMode": "platform",
"observation.quickReplyMode": "platform",
"historySync.mode": "platform",
"historySync.requestFull": "platform",
"hms": "platform"
},
"revisions": {
"team": 1,
"project": 1,
"session": 1
},
"historyConsent": "pending",
"application": {
"desiredGeneration": 1,
"appliedGeneration": 1,
"status": "pending"
}
},
"newChatCapping": {
"enabled": true,
"pacing": true,
"status": "first_warning",
"capped": true,
"limit": 50,
"used": 26,
"remaining": 24,
"cycleStartsAt": "<string>",
"resetsAt": "<string>",
"observedAt": "<string>"
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credential",
"message": "Supply a valid credential.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}{
"error": {
"type": "conflict_error",
"code": "state_conflict",
"message": "The request conflicts with the resource state.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected service failure occurred. Keep the request ID for support.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#internal-error"
}{
"error": {
"type": "api_error",
"code": "service_unavailable",
"message": "A required service is unavailable. Check completion before repeating a write.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}