Lead Assignments
List lead assignments
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Query Parameters
Only assignments offered to this rep
Only assignments in this state
"" | "offered" | "claimed" | "expired" | "reassigned" | "released" | "completed"Max rows (default 50, max 200)
int64Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/lead-assignments"{
"$schema": "/api/v1/schemas/ListLeadAssignmentsResponse.json",
"assignments": [
{
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Offer a unit of work to a rep
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/lead-assignments/offer" \ -H "Content-Type: application/json" \ -d '{ "candidates": [ "string" ], "lead_ref": "string" }'{
"$schema": "/api/v1/schemas/OfferLeadAssignmentResponse.json",
"assignment": {
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
},
"deduplicated": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Read one lead assignment
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Assignment id
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/lead-assignments/string"{
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Claim an offered lead
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Assignment id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/lead-assignments/string/claim" \ -H "Content-Type: application/json" \ -d '{ "rep_user_id": "string" }'{
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Complete a claimed lead
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Assignment id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/lead-assignments/string/complete" \ -H "Content-Type: application/json" \ -d '{ "rep_user_id": "string" }'{
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Release an active lead back to the pool
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Assignment id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/lead-assignments/string/release" \ -H "Content-Type: application/json" \ -d '{ "rep_user_id": "string" }'{
"$schema": "/api/v1/schemas/LeadAssignmentBody.json",
"assignment_id": "string",
"claimed_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"features": null,
"lead_ref": "string",
"offered_at": "2019-08-24T14:15:22Z",
"policy": "string",
"prior_assignment_id": "string",
"propensity": 0.1,
"rep_user_id": "string",
"sla_expires_at": "2019-08-24T14:15:22Z",
"state": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}