Contact
Customer contact management
Display a listing of contacts
GET /api/v1/contacts
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters
| Name |
In |
Type |
Required |
Description |
customer_id |
query |
string |
no |
|
search |
query |
string |
no |
|
per_page |
query |
string |
no |
|
Responses
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request
curl -X GET "https://kworia.com/api/v1/contacts" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Store a newly created contact
POST /api/v1/contacts
Requires authentication (Bearer token) and the X-Organization-Id header.
Request body
| Field |
Type |
Required |
Description |
customer_id |
integer |
yes |
|
name |
string |
yes |
|
email |
string |
no |
|
phone |
string |
no |
|
position |
string |
no |
|
is_primary |
boolean |
no |
|
notes |
string |
no |
|
Responses
| Status |
Description |
| 201 |
For non-paginated data, return as before |
| 422 |
|
| 403 |
|
Example request
curl -X POST "https://kworia.com/api/v1/contacts" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"customer_id": 1,
"name": "string",
"email": "string",
"phone": "string",
"position": "string",
"is_primary": true,
"notes": "string"
}'
Display the specified contact
GET /api/v1/contacts/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request
curl -X GET "https://kworia.com/api/v1/contacts/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Update the specified contact
PUT /api/v1/contacts/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Request body
| Field |
Type |
Required |
Description |
customer_id |
integer |
no |
|
name |
string |
no |
|
email |
string |
no |
|
phone |
string |
no |
|
position |
string |
no |
|
is_primary |
boolean |
no |
|
notes |
string |
no |
|
Responses
| Status |
Description |
| 200 |
For non-paginated data, return as before |
| 422 |
|
| 403 |
|
Example request
curl -X PUT "https://kworia.com/api/v1/contacts/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"customer_id": 1,
"name": "string",
"email": "string",
"phone": "string",
"position": "string",
"is_primary": true,
"notes": "string"
}'
Remove the specified contact
DELETE /api/v1/contacts/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request
curl -X DELETE "https://kworia.com/api/v1/contacts/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"