Batches
Create and start a call batch
POST
/
v2
/
batches
/
create
Create and start a call batch
curl --request POST \
--url https://api.sempera.org/v2/batches/create \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.sempera.org/v2/batches/create"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sempera.org/v2/batches/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"batch_id": "<string>",
"batch": {
"id": "<string>",
"kind": "<string>",
"name": "<string>",
"state": "<string>",
"summary": {},
"recipients": [
{
"number": "<string>",
"timezone": "<string>",
"state": "<string>",
"precall_dtmf": "<string>",
"attempts": 1,
"reason": "<string>",
"last": {
"at": 123,
"n": 1,
"ok": true,
"status": "<string>",
"dialed": true,
"agent_version_id": "<string>"
}
}
],
"consent_basis": "<string>",
"timezone": "<string>",
"window": {
"start": "<string>",
"end": "<string>"
},
"concurrency": 1,
"max_attempts": 1,
"retry_after_s": 1,
"created_at": 123,
"stopped_reason": "<string>",
"paused_reason": "<string>",
"held_reason": "<string>",
"precall_dtmf": "<string>",
"from_number": "<string>",
"operator_approved": true,
"start_at": 123,
"starts_later": true,
"last_pass": {
"at": 123,
"road": "<string>",
"placed": 1
},
"single_call": true,
"call_settings": {}
},
"scheduler": {
"automatic": true,
"every_s": 1
}
},
"errors": null
}{
"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:
255⌘I
Create and start a call batch
curl --request POST \
--url https://api.sempera.org/v2/batches/create \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.sempera.org/v2/batches/create"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sempera.org/v2/batches/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"batch_id": "<string>",
"batch": {
"id": "<string>",
"kind": "<string>",
"name": "<string>",
"state": "<string>",
"summary": {},
"recipients": [
{
"number": "<string>",
"timezone": "<string>",
"state": "<string>",
"precall_dtmf": "<string>",
"attempts": 1,
"reason": "<string>",
"last": {
"at": 123,
"n": 1,
"ok": true,
"status": "<string>",
"dialed": true,
"agent_version_id": "<string>"
}
}
],
"consent_basis": "<string>",
"timezone": "<string>",
"window": {
"start": "<string>",
"end": "<string>"
},
"concurrency": 1,
"max_attempts": 1,
"retry_after_s": 1,
"created_at": 123,
"stopped_reason": "<string>",
"paused_reason": "<string>",
"held_reason": "<string>",
"precall_dtmf": "<string>",
"from_number": "<string>",
"operator_approved": true,
"start_at": 123,
"starts_later": true,
"last_pass": {
"at": 123,
"road": "<string>",
"placed": 1
},
"single_call": true,
"call_settings": {}
},
"scheduler": {
"automatic": true,
"every_s": 1
}
},
"errors": null
}{
"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>"
}
}