Every workspace has its own data model. Every workspace starts with the objects companies, people, opportunities, tasks and notes, whichever template it was created from, though a template may show some under other names (for example Clients, Organizations, Supporters, Deals, Applications or Proposals). Real estate, Recruiting, Agency / consulting and Nonprofit also add one object each (properties, jobs, projects and gifts); General and B2B SaaS add none. Members can change fields and add objects, and workspaces created earlier keep the objects they have. Don't hard-code IDs: they differ between workspaces.
You need metadata for three things:
| To | Use |
|---|---|
| Choose an object in a path | the object's slug |
| Read and write values | each field's key |
| Filter, sort and calculate | each field's id |
List objects#
/objectscurl --fail-with-body "$JEMERO_URL/objects" \
-H "Authorization: Bearer $JEMERO_API_KEY"const response = await fetch(`${process.env.JEMERO_URL}/objects`, {
headers: { Authorization: `Bearer ${process.env.JEMERO_API_KEY}` },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const { objects } = await response.json();
console.log(objects.map((object) => object.slug));import os
import requests
response = requests.get(
f"{os.environ['JEMERO_URL']}/objects",
headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print([item["slug"] for item in response.json()["objects"]]){
"objects": [
{
"id": "67c8fb7e-065d-4071-bf26-f23e1ea2cb14",
"slug": "companies",
"singularName": "Company",
"pluralName": "Companies",
"description": "Organisations you work with.",
"kind": "custom",
"primaryFieldId": "215069ce-4b14-4b0d-b0f9-3d64efeee50e",
"isVisible": true,
"fieldCount": 13
}
]
}Objects also carry display settings, such as icon and position. The response above is shortened.
Get one object and its fields#
/objects/{objectSlug}curl --fail-with-body "$JEMERO_URL/objects/companies" \
-H "Authorization: Bearer $JEMERO_API_KEY"const response = await fetch(`${process.env.JEMERO_URL}/objects/companies`, {
headers: { Authorization: `Bearer ${process.env.JEMERO_API_KEY}` },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const { fields } = await response.json();
const fieldByKey = Object.fromEntries(fields.map((field) => [field.key, field]));
console.log(fieldByKey.name.id);
console.log(fieldByKey.industry.config.options);import os
import requests
response = requests.get(
f"{os.environ['JEMERO_URL']}/objects/companies",
headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
field_by_key = {field["key"]: field for field in response.json()["fields"]}
print(field_by_key["name"]["id"])
print(field_by_key["industry"]["config"]["options"]){
"object": { "id": "67c8fb7e-065d-4071-bf26-f23e1ea2cb14", "slug": "companies" },
"fields": [
{
"id": "3825a193-b3bd-464b-bd45-c8e5396356dd",
"key": "industry",
"label": "Industry",
"type": "select",
"isRequired": false,
"isUnique": false,
"systemSource": null,
"config": {
"options": [
{ "id": "dae82246-2e36-455a-8a9b-a406ca34f04e", "label": "Technology", "position": 0 }
]
}
}
]
}The real answer also includes views, the saved table and board views. They belong to the Jemero app and you can ignore them.
| Field property | Meaning |
|---|---|
key | The name used in a record's values. |
id | Used by filters, sorts, aggregates and groupByFieldId. |
type | One of the types in Field values. |
isRequired, isUnique | Rules checked when you write. |
systemSource | Set on fields Jemero fills in, such as created_at. You can't write them. |
config | Settings for the type: select options, relation target and cardinality, default currency and so on. |
Labels can be renamed by members at any time. Match on key, not on label.
Errors#
| Status | Cause |
|---|---|
404 Object not found | No object with that slug, or it was archived. |