API ReferenceAgents
Create agent
Register a new agent in the organization. Admin only.
Request Body
application/json
Request to create a new agent
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/agents" \ -H "Content-Type: application/json" \ -d '{ "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", "role": "AGENT", "commission_rate": 0.05, "base_salary": { "value": 100000, "currency": "KES" } }'{ "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", "user_email": "string", "name": "string", "phone_number": "string", "role": "AGENT", "status": "ACTIVE", "territory": "string", "supervisor_user_id": "eca8c0f1-36b3-4a7b-bca2-2bce49ee6ffd", "supervisor_name": "string", "supervisor_email": "string", "supervisor_phone_number": "string", "commission_rate": 0, "base_salary": { "value": 100000, "currency": "KES" }, "hire_date": "2019-08-24", "termination_date": "2019-08-24", "customer_count": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "resource_id": "string"}{ "code": "BAD_REQUEST", "description": "Bad Request"}{ "code": "UNAUTHORISED", "description": "Unauthorised"}{ "code": "WAITING_LIST", "description": "User is in the waiting list"}{ "code": "TOO_MANY_REQUESTS", "description": "Too Many Requests"}{ "code": "INTERNAL_SERVER_ERROR", "description": "Internal Server Error"}