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

json
{
  "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

GET/v1/fieldsNo scope needed

Every 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:

POST/v1/fieldsKweko app only
PATCH/v1/fields/{id}Kweko app only
DELETE/v1/fields/{id}Kweko app only

Values 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.

TypeJSON valueExample
text, long_textstring"Blue, size M"
numbernumber12.5
moneyobject with an integer amount in the smallest unit and currency (UZS by default){"amount": 5000000, "currency": "UZS"}
dateYYYY-MM-DD"2026-10-02"
datetimeRFC 3339, stored in UTC"2026-10-02T15:00:00+05:00"
selectthe id of one of the field's optionsan id from options
multiselecta list of option ids, up to 100ids from options
checkboxtrue or falsetrue
phonea phone number, normalized like contact phones"+998901234567"
emailan email address, lowercased"[email protected]"
urla URL"https://example.uz"
membera member id"mb_01j8…"
ratingan integer from 1 to 54
linka list of record ids, up to 50 (one when the field links one record), see record link fields["ct_01j8…"]
Request
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}}'

A field of type link points at other records. Its definition carries link:

json
{ "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:

GET/v1/records/lookup

ids 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.

The 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.