You need a Jemero workspace where you can open Settings → Developers. Owners and co-owners can; so can members whose custom role includes developer settings.
The samples use cURL, Node.js 18 or later (save as .mjs and run with node) and Python 3 with the requests package.
1. Create a key#
Open Settings → Developers → API and choose Create API key. Give it a name and an expiration, choose Save, then copy the key. It is shown only once.
2. Set two variables#
Replace acme with your workspace's name, as it appears in its address (acme.jemero.com).
export JEMERO_URL="https://acme.jemero.com/api/v1"
export JEMERO_API_KEY="jemero_your_key"3. Check the connection#
/mecurl --fail-with-body "$JEMERO_URL/me" \
-H "Authorization: Bearer $JEMERO_API_KEY"const response = await fetch(`${process.env.JEMERO_URL}/me`, {
headers: { Authorization: `Bearer ${process.env.JEMERO_API_KEY}` },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());import os
import requests
response = requests.get(
f"{os.environ['JEMERO_URL']}/me",
headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()){
"workspace": { "slug": "acme", "name": "Acme" },
"user": { "email": "[email protected]" },
"role": "owner"
}4. Create a company#
/objects/{objectSlug}/recordsEvery new workspace has a companies object, whichever template it was made from, though some templates show it under another name (Clients in Agency / consulting, Organizations in Nonprofit). Values are keyed by field key.
curl --fail-with-body "$JEMERO_URL/objects/companies/records" \
-H "Authorization: Bearer $JEMERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "values": { "name": "Globex", "website": "globex.example" } }'const response = await fetch(`${process.env.JEMERO_URL}/objects/companies/records`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.JEMERO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ values: { name: 'Globex', website: 'globex.example' } }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const { record } = await response.json();
console.log(record.id);import os
import requests
response = requests.post(
f"{os.environ['JEMERO_URL']}/objects/companies/records",
headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
json={"values": {"name": "Globex", "website": "globex.example"}},
timeout=30,
)
response.raise_for_status()
print(response.json()["record"]["id"])The answer is 201 Created with the whole record. See Create a record.
5. Read companies back#
/objects/{objectSlug}/recordscurl --fail-with-body "$JEMERO_URL/objects/companies/records?search=globex&pageSize=5" \
-H "Authorization: Bearer $JEMERO_API_KEY"Next steps#
- Find your objects and field keys with Metadata.
- Learn how each kind of value is written in Field values.
- Hear about changes with Webhooks.