Check call
Required scope: sessions:read
Runs the checks a call placement runs, without calling: the number’s calling switch, the team’s do-not-call list and blocked country codes, and on Cloud API numbers the person’s call permission and WhatsApp’s call limits. If WhatsApp’s permission status is unavailable and no other refusal is known, returns 503 service_unavailable. Server credentials only.
curl --request POST \
--url https://api.polymorfa.com/messaging/voip/calls/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": "<string>",
"to": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({session: '<string>', to: '<string>'})
};
fetch('https://api.polymorfa.com/messaging/voip/calls/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/messaging/voip/calls/check"
payload = {
"session": "<string>",
"to": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/messaging/voip/calls/check"
payload := strings.NewReader("{\n \"session\": \"<string>\",\n \"to\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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": {
"allowed": true,
"refusal": "calls_disabled",
"permission": {
"status": "none",
"expiresAt": "2023-11-07T05:31:56Z",
"source": "user_action",
"updatedAt": "2023-11-07T05:31:56Z",
"checkedAt": "2023-11-07T05:31:56Z",
"fresh": true,
"actions": {
"requestPermission": {
"allowed": true,
"limits": [
{
"period": "<string>",
"maxAllowed": 1,
"used": 1,
"resetsAt": "2023-11-07T05:31:56Z"
}
]
},
"startCall": {
"allowed": true,
"limits": [
{
"period": "<string>",
"maxAllowed": 1,
"used": 1,
"resetsAt": "2023-11-07T05:31:56Z"
}
]
}
}
}
}
}{
"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": "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
Polymorfa organization key (pmfa_ prefix), project token (pmfa_pt_ prefix) where supported, or short-lived client token (pmfa_ct_ prefix). Organization and project keys may be personal or service-account owned and enforce selected action scopes. Organization keys cover the team and its projects; project tokens stay inside one project. Client tokens stay inside their live project and session and enforce their client rules.
Body
The session (number) that would place the call.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | 1 through 128 characters |
1 - 128User ID or phone number in E.164 format.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | 1 through 64 characters |
1 - 64Was this page helpful?
curl --request POST \
--url https://api.polymorfa.com/messaging/voip/calls/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": "<string>",
"to": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({session: '<string>', to: '<string>'})
};
fetch('https://api.polymorfa.com/messaging/voip/calls/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/messaging/voip/calls/check"
payload = {
"session": "<string>",
"to": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/messaging/voip/calls/check"
payload := strings.NewReader("{\n \"session\": \"<string>\",\n \"to\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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": {
"allowed": true,
"refusal": "calls_disabled",
"permission": {
"status": "none",
"expiresAt": "2023-11-07T05:31:56Z",
"source": "user_action",
"updatedAt": "2023-11-07T05:31:56Z",
"checkedAt": "2023-11-07T05:31:56Z",
"fresh": true,
"actions": {
"requestPermission": {
"allowed": true,
"limits": [
{
"period": "<string>",
"maxAllowed": 1,
"used": 1,
"resetsAt": "2023-11-07T05:31:56Z"
}
]
},
"startCall": {
"allowed": true,
"limits": [
{
"period": "<string>",
"maxAllowed": 1,
"used": 1,
"resetsAt": "2023-11-07T05:31:56Z"
}
]
}
}
}
}
}{
"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": "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"
}