Phone
Send an approved text
POST
/
v1
/
phone-messages
Send an approved text
curl --request POST \
--url https://api.sempera.org/v1/phone-messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"body": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spend_bound_cents": 1
}
'import requests
url = "https://api.sempera.org/v1/phone-messages"
payload = {
"to": "<string>",
"body": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spend_bound_cents": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
body: JSON.stringify('<string>'),
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
spend_bound_cents: 1
})
};
fetch('https://api.sempera.org/v1/phone-messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "phone_message",
"state": "<string>",
"segments": 123,
"direction": "<string>",
"segments_settled": true,
"encoding": "<string>",
"thread_id": "<string>",
"provider_message_id": "<string>",
"spend_bound_cents": 123,
"error": "<string>",
"approval": {
"standing": true,
"url": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}Authorizations
A workspace API key, sent as Authorization: Bearer sempera_sk_... Each operation names the one scope it needs. Scopes, key kinds and roles are in the Authentication guide.
Headers
Replays the stored answer for a retry of the same request; 409 for a different request under the same key.
Maximum string length:
255Body
application/json
Response
Recorded send outcome
⌘I
Send an approved text
curl --request POST \
--url https://api.sempera.org/v1/phone-messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"body": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spend_bound_cents": 1
}
'import requests
url = "https://api.sempera.org/v1/phone-messages"
payload = {
"to": "<string>",
"body": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spend_bound_cents": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
body: JSON.stringify('<string>'),
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
spend_bound_cents: 1
})
};
fetch('https://api.sempera.org/v1/phone-messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "phone_message",
"state": "<string>",
"segments": 123,
"direction": "<string>",
"segments_settled": true,
"encoding": "<string>",
"thread_id": "<string>",
"provider_message_id": "<string>",
"spend_bound_cents": 123,
"error": "<string>",
"approval": {
"standing": true,
"url": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}