Skip to content

Get contact by ID with GET /api/v1/contacts/{id}

To get a contact by ID, call GET /api/v1/contacts/{id}, where {id} is the customer’s id from the contacts list or from a booking. It returns the customer with the same fields as the list, and it needs a key with the contacts.read scope.

Use it when you hold a customer’s id and want their current details, without reading the whole list.

  • From a booking: every booking carries customer.contactId, which reads the customer’s name, phone number and current stage.
  • To refresh your own record: if you store customers in your system, read one by id to see their stage and tags as they are now.

One parameter, in the path:

ParameterWhereMeaning
idpathThe customer’s id, as in the list’s id or a booking’s customer.contactId

A malformed id returns a 404, exactly like an id that does not exist.

نافذة طرفيّة
curl https://api.mujib.ai/api/v1/contacts/5d8f2a61-0c4e-4b7a-9f13-6e2b8c0d4a57 \
-H "Authorization: Bearer $MUJIB_API_KEY"
const id = '5d8f2a61-0c4e-4b7a-9f13-6e2b8c0d4a57';
const res = await fetch(`https://api.mujib.ai/api/v1/contacts/${encodeURIComponent(id)}`, {
headers: { Authorization: `Bearer ${process.env.MUJIB_API_KEY}` },
});
const body = await res.json();
if (res.status === 404) console.log('not in this business');
else if (!res.ok) throw new Error(`${res.status} ${body.error.code}: ${body.error.message}`);
else console.log(body.data.name, body.data.stage);
import os
import requests
contact_id = "5d8f2a61-0c4e-4b7a-9f13-6e2b8c0d4a57"
res = requests.get(
f"https://api.mujib.ai/api/v1/contacts/{contact_id}",
headers={"Authorization": f"Bearer {os.environ['MUJIB_API_KEY']}"},
timeout=30,
)
body = res.json()
if res.status_code == 404:
print("not in this business")
elif not res.ok:
raise RuntimeError(f"{res.status_code} {body['error']['code']}: {body['error']['message']}")
else:
print(body["data"]["name"], body["data"]["stage"])

A 200, with the customer in data. The data is made up:

{
"data": {
"id": "5d8f2a61-0c4e-4b7a-9f13-6e2b8c0d4a57",
"name": "سارة",
"phone": "962790000000",
"channel": "whatsapp",
"stage": "qualified",
"tags": ["استشارة"],
"createdAt": "2026-11-02T09:14:37.205Z",
"lastActiveAt": "2026-11-03T16:40:02.918Z"
}
}

Each field and its possible values are described in list contacts.

It means your business has no customer with that id, whatever the reason:

{ "error": { "code": "NOT_FOUND", "message": "Contact not found" } }

The same error comes back for an id that does not exist, an id that belongs to another business and a malformed id, so the response reveals nothing about anyone else’s data. The other errors:

HTTPcodeWhy
401UNAUTHORIZEDNo key, or a key that is not valid
403FORBIDDENThe key lacks contacts.read
429RATE_LIMITEDYou went over a rate limit
500INTERNALAn unexpected server error

Frequently asked questions

Where do I get a contact's id?

From the id field in the contacts list, or from customer.contactId in a booking.

Why do I get a 404 for an id I know exists?

Usually because the key belongs to a different business than the one the id came from, or because a character was lost in copying. Both return the same 404.

Does this request return more fields than the list?

No. It returns the same fields every customer carries in the list.