Contacts
Manage contact people. A contact can be attached to clients, to vendors, or to both.
Use cases: Use the Contacts API to keep the people you deal with in sync, and to attach the right recipient to a client before issuing documents.
GET
/contactsList contacts with optional filtering and pagination.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across relevant fields. | |
firstName | string | Filter by first name. | |
lastName | string | Filter by last name. | |
email | string | Filter by email. | |
phoneNumber | string | Filter by phone number. | |
hasClients | boolean | Only contacts attached to at least one client. | |
hasVendors | boolean | Only contacts attached to at least one vendor. | |
clientId | number | Only contacts attached to this client (internal id). | |
vendorId | number | Only contacts attached to this vendor (internal id). | |
sortBy | string | Column to sort by. | |
sortOrder | string | "asc" or "desc". | |
limit | number | Items per page. Default 50, clamped to 1-200. | |
offset | number | Row offset to start from (default 0). | |
page | number | 1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it. | |
pageSize | number | Alias of `limit`. Wins over `limit` when both are sent. |
Request
curl -X GET "https://api.glance.co.il/contacts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"id": 71,
"visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73",
"firstName": "Efi",
"lastName": "Levi",
"email": "efi@acme.com",
"phoneNumber": "050-5550000",
"clients": [
{
"id": 5531,
"name": "Acme Corp"
}
],
"vendors": []
}
],
"pagination": {
"total": 12,
"limit": 50,
"offset": 0,
"hasMore": false,
"page": 1,
"pageSize": 50,
"totalPages": 1
}
}GET
/contacts/id/:visibleIdGet a single contact with the clients and vendors it is attached to.
Returned flat, not wrapped in `data`. A visibleId that matches nothing returns `null` with status 200.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | string | required | The contact's visibleId. |
Request
curl -X GET "https://api.glance.co.il/contacts/id/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"id": 71,
"visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73",
"firstName": "Efi",
"lastName": "Levi",
"email": "efi@acme.com",
"phoneNumber": "050-5550000",
"address": {
"id": 88,
"city": "תל אביב"
},
"clients": [
{
"id": 5531,
"name": "Acme Corp"
}
],
"vendors": []
}POST
/contacts/createCreate a contact, optionally attached to a client or vendor.
The internal id of a client is the `id` field on GET /clients — the same value `GET /clients/entity/:entityId` takes. `visibleId` is not accepted here.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
firstName | string | required | Contact first name. |
lastName | string | Contact last name. | |
phoneNumber | string | Phone number. | |
email | string | Email address. | |
addressId | number | Id of an existing address to attach. | |
clientId | number | Attach the contact to this client. The client's **internal numeric id** — not its visibleId. | |
vendorId | number | Attach the contact to this vendor. Internal numeric id, as above. |
Request
curl -X POST "https://api.glance.co.il/contacts/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"firstName": "example_firstName",
"lastName": "example_lastName",
"phoneNumber": "example_phoneNumber",
"email": "example_email",
"addressId": 0,
"clientId": 0,
"vendorId": 0
}'Response
Response
{
"success": true,
"contactId": 71,
"visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73"
}PUT
/contacts/edit/:visibleIdUpdate a contact's own details. All fields are optional.
Attachments cannot be changed here: `clientId` and `vendorId` are accepted only on creation.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | string | required | The contact's visibleId. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
firstName | string | Contact first name. | |
lastName | string | Contact last name. | |
phoneNumber | string | Phone number. | |
email | string | Email address. | |
addressId | number | Id of an existing address to attach. |
Request
curl -X PUT "https://api.glance.co.il/contacts/edit/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"firstName": "example_firstName",
"lastName": "example_lastName",
"phoneNumber": "example_phoneNumber",
"email": "example_email",
"addressId": 0
}'Response
Response
{
"success": true,
"visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73"
}DELETE
/contacts/delete/:visibleIdDelete a contact.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | string | required | The contact's visibleId. |
Request
curl -X DELETE "https://api.glance.co.il/contacts/delete/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true
}