Contact
Customer contact management
Display a listing of contacts
GET /api/v1/contacts
Requires authentication (Bearer token) and the X-Organization-Id header.
API token scope: contacts.view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
customer_id |
query | integer | no | |
search |
query | string | no | |
sort |
query | string | no | |
page |
query | integer | no | |
per_page |
query | integer | no |
Responses
| Status | Description |
|---|---|
| 200 | For non-paginated data, return as before |
| 422 |
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.
API token scope: contacts.create
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.
API token scope: contacts.view
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.
API token scope: contacts.update
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.
API token scope: contacts.delete
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"