API reference
Custom fields
Workspaces add their own fields to leads, contacts, companies, products and objects. Their values live in each record's custom object, keyed by the field's key.
The field object
{
"id": "fd_01j8z6a0b2c4d6e8f0g2h4j6k8",
"entity": "lead",
"key": "delivery_date",
"label": { "uz-Latn": "Yetkazish sanasi", "ru": "Дата доставки", "en": "Delivery date" },
"type": "date",
"options": [],
"position": 2,
"required": false,
"group": ""
}List fields
/v1/fieldsNo scope neededEvery field definition of the workspace: {"data": [ … ]}. Add ?entity=lead (or contact, company, product, or object:<key> for an object type) for one record type. No scope is needed.
Creating, changing and deleting fields is reserved for owners and admins in Kweko (Settings → Fields); these endpoints do not accept API keys yet:
/v1/fieldsKweko app only/v1/fields/{id}Kweko app only/v1/fields/{id}Kweko app onlyValues by type
Send custom values in custom when you create or update a record. Only the keys you send change; null clears a value (a required field cannot be cleared). An unknown key or a bad value answers validation_failed with the problem under custom.<key> in fields.
| Type | JSON value | Example |
|---|---|---|
text, long_text | string | "Blue, size M" |
number | number | 12.5 |
money | object with an integer amount in the smallest unit and currency (UZS by default) | {"amount": 5000000, "currency": "UZS"} |
date | YYYY-MM-DD | "2026-10-02" |
datetime | RFC 3339, stored in UTC | "2026-10-02T15:00:00+05:00" |
select | the id of one of the field's options | an id from options |
multiselect | a list of option ids, up to 100 | ids from options |
checkbox | true or false | true |
phone | a phone number, normalized like contact phones | "+998901234567" |
email | an email address, lowercased | "[email protected]" |
url | a URL | "https://example.uz" |
member | a member id | "mb_01j8…" |
rating | an integer from 1 to 5 | 4 |
link | a list of record ids, up to 50 (one when the field links one record), see record link fields | ["ct_01j8…"] |
curl -X PATCH https://your-workspace.kweko.uz/api/v1/leads/ld_01j8z7c2d4f6g8h0j2k4m6n8p0 \
-H "Authorization: Bearer $KWEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"custom": {"delivery_date": "2026-10-02", "gift_wrap": true}}'Record link fields
A field of type link points at other records. Its definition carries link:
{ "key": "holder", "type": "link", "link": { "target": "contact", "many": false } }target is contact, company, lead or object:<key>, and is fixed once the field exists. many says whether the field holds several records. The value is always a list of ids, even for one record. Every newly linked record must exist, be of the target type and be visible to the caller; otherwise the write answers validation_failed under custom.<key>. Turning many off with PATCH /v1/fields/{id} and "link": {"target": …, "many": false} is refused (link.many) while any record holds more than one.
Stored ids are never trusted on read. To show linked records, name them:
/v1/records/lookupids is a comma-separated list of up to 200 contact, company, lead and object ids. The answer {"data": [{"id", "type", "object_type", "title", "number", "url"}]} leaves out records the caller may not see, deleted ones and unknown ones.
/v1/records/{id}/backlinksThe records whose link fields point at this contact, company, lead or object, each with the field that holds the link (entity, key, label). The record itself must be visible to the caller (else 404), and so must every record listed.