Overview
The Client Management API (sgivu-client) manages client information for both individual persons and companies. It provides CRUD operations, multi-criteria search, and status management for clients involved in vehicle purchase and sales transactions.
Base URL
https://your-domain.com/v1
Persons
Create Person
Registers a new individual person as a client.
Authentication: Required
Authorization: person:create permission
Request Body
National identification number
Whether the client is enabled
{
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"phoneNumber": 3001234567,
"address": {
"street": "Calle 123 #45-67",
"city": "Bogotá",
"state": "Cundinamarca",
"postalCode": "110111"
},
"enabled": true
}
Response
{
"id": 25,
"clientId": 50,
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"phoneNumber": 3001234567,
"address": {
"id": 30,
"street": "Calle 123 #45-67",
"city": "Bogotá",
"state": "Cundinamarca",
"postalCode": "110111"
},
"enabled": true,
"createdAt": "2026-03-06T10:30:00",
"updatedAt": "2026-03-06T10:30:00"
}
Status Codes
201 Created - Person created successfully
400 Bad Request - Invalid input data
401 Unauthorized - Not authenticated
403 Forbidden - Missing person:create permission
Example
curl -X POST https://your-domain.com/v1/persons \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"phoneNumber": 3001234567,
"address": {
"street": "Calle 123 #45-67",
"city": "Bogotá"
}
}'
Get Person by ID
Retrieves detailed information about a specific person.
Authentication: Required
Authorization: person:read permission
Path Parameters
Response
{
"id": 25,
"clientId": 50,
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"phoneNumber": 3001234567,
"address": {
"street": "Calle 123 #45-67",
"city": "Bogotá"
},
"enabled": true,
"createdAt": "2026-03-06T10:30:00"
}
Example
curl -X GET https://your-domain.com/v1/persons/25 \
-H "Authorization: Bearer YOUR_TOKEN"
List Persons (Paginated)
GET /v1/persons/page/{page}
Retrieves a paginated list of persons.
Authentication: Required
Authorization: person:read permission
Path Parameters
Response
{
"content": [
{
"id": 25,
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"phoneNumber": 3001234567,
"enabled": true
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10
},
"totalElements": 150,
"totalPages": 15
}
Example
curl -X GET https://your-domain.com/v1/persons/page/0 \
-H "Authorization: Bearer YOUR_TOKEN"
Update Person
Updates an existing person record.
Authentication: Required
Authorization: person:update permission
Path Parameters
Request Body
Same structure as Create Person.
{
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia.updated@example.com",
"phoneNumber": 3009876543
}
Status Codes
200 OK - Person updated successfully
400 Bad Request - Invalid input
401 Unauthorized - Not authenticated
403 Forbidden - Missing person:update permission
404 Not Found - Person does not exist
Example
curl -X PUT https://your-domain.com/v1/persons/25 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "maria.garcia.updated@example.com",
"phoneNumber": 3009876543
}'
Delete Person
Permanently deletes a person from the system.
Authentication: Required
Authorization: person:delete permission
Path Parameters
Status Codes
204 No Content - Person deleted successfully
401 Unauthorized - Not authenticated
403 Forbidden - Missing person:delete permission
404 Not Found - Person does not exist
Example
curl -X DELETE https://your-domain.com/v1/persons/25 \
-H "Authorization: Bearer YOUR_TOKEN"
Change Person Status
PATCH /v1/persons/{id}/status
Enables or disables a person client.
Authentication: Required
Authorization: person:update permission
Path Parameters
Request Body
New status (true=enabled, false=disabled)
Response
Example
curl -X PATCH https://your-domain.com/v1/persons/25/status \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d 'true'
Get Person Counts
Retrieves statistics: total persons, active, and inactive.
Authentication: Required
Authorization: person:read permission
Response
{
"total": 150,
"active": 145,
"inactive": 5
}
Example
curl -X GET https://your-domain.com/v1/persons/count \
-H "Authorization: Bearer YOUR_TOKEN"
Search Persons
Multi-criteria search for persons.
Authentication: Required
Authorization: person:read permission
Query Parameters
Filter by first or last name (partial match)
Response
[
{
"id": 25,
"firstName": "María",
"lastName": "García López",
"nationalId": 1234567890,
"email": "maria.garcia@example.com",
"enabled": true
}
]
Example
curl -X GET "https://your-domain.com/v1/persons/search?city=Bogot%C3%A1&enabled=true" \
-H "Authorization: Bearer YOUR_TOKEN"
Search Persons (Paginated)
GET /v1/persons/search/page/{page}
Paginated variant of person search.
Authentication: Required
Authorization: person:read permission
Path Parameters
Query Parameters
All search parameters from the non-paginated endpoint are available.
Example
curl -X GET "https://your-domain.com/v1/persons/search/page/0?size=20&city=Bogot%C3%A1" \
-H "Authorization: Bearer YOUR_TOKEN"
Companies
Company endpoints follow the same pattern as person endpoints but use /v1/companies as the base path.
Company-Specific Fields
Tax identification number (NIT)
Name of legal representative
Example: Create Company
curl -X POST https://your-domain.com/v1/companies \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyName": "AutoFleet Colombia S.A.S.",
"taxId": "900123456-7",
"legalRepresentative": "Carlos Mendoza",
"email": "contacto@autofleet.com",
"phoneNumber": 6012345678,
"industry": "Transportation",
"address": {
"street": "Av. Eldorado #99-50",
"city": "Bogotá"
}
}'
All company endpoints (GET, PUT, DELETE, PATCH, search) work identically to person endpoints but operate on the /v1/companies path.
Client Model
Both persons and companies are considered “clients” in SGIVU. Each person or company record has an associated clientId which is used in purchase/sale contracts.
Client Hierarchy
Client (base)
├── Person
└── Company
Error Responses
400 Bad Request
{
"error": "validation_error",
"message": "Invalid input data",
"details": [
{
"field": "email",
"message": "Email address is invalid"
}
]
}
404 Not Found
{
"error": "not_found",
"message": "Person with ID 999 not found"
}