Every identity keeps its own contact directory — an address book your agent can lean on. Before sending an email or a text, resolve a name like "Alice" to a real email or phone number, then send with confidence. The same directory works over the CLI, the Python SDK, and the TypeScript SDK. Every example below runs against one identity. Grab it once (or set it as the active identity in the CLI) and the rest follow. Need one first? See [Identities](/core-concepts/identities/). CLI: ```bash ravi identity use ``` Python: ```python from ravi import Ravi ravi = Ravi(api_key="ravi_id_...") identity = ravi.identities.get("") ``` TypeScript: ```typescript import { Ravi } from "@ravi-hq/sdk"; const ravi = new Ravi({ apiKey: process.env.RAVI_API_KEY! }); const identity = await ravi.identities.get(""); ``` ## Add a contact Save someone to the directory. A contact carries an `email`, `phone_number`, `display_name`, `nickname`, and an `is_trusted` flag. CLI: ```bash ravi contacts create \ --email user@example.com \ --display-name "Alice Example" ``` Python: ```python contact = identity.contacts.create( email="user@example.com", display_name="Alice Example", ) ``` TypeScript: ```typescript const contact = await identity.contacts.create({ email: "user@example.com", display_name: "Alice Example", }); ``` ## List contacts Browse everyone in the directory. CLI: ```bash ravi contacts list ``` Python: ```python contacts = identity.contacts.list() for c in contacts: print(c.display_name, c.email) ``` TypeScript: ```typescript const contacts = await identity.contacts.list(); for (const c of contacts) { console.log(c.display_name, c.email); } ``` ## Search contacts Fuzzy-match by name, nickname, email, or phone — the move to make right before sending, when you only know "Alice". CLI: ```bash ravi contacts search "alice" ``` Python: ```python matches = identity.contacts.search("alice") ``` TypeScript: ```typescript const matches = await identity.contacts.search("alice"); ``` ## Find a contact Look up an exact match by email or phone number when you already know the identifier. Python: ```python contact = identity.contacts.find(email="user@example.com") ``` TypeScript: ```typescript const contact = await identity.contacts.find({ email: "user@example.com" }); ``` ## Get one contact Fetch a single contact by id to see all its fields. CLI: ```bash ravi contacts get ``` Python: ```python contact = identity.contacts.get("") print(contact.display_name, contact.phone_number) ``` TypeScript: ```typescript const contact = await identity.contacts.get(""); console.log(contact.display_name, contact.phone_number); ``` ## Update a contact Change any field — here, set a friendlier `nickname`. CLI: ```bash ravi contacts update --nickname "Ali" ``` Python: ```python contact = identity.contacts.update("", nickname="Ali") ``` TypeScript: ```typescript const contact = await identity.contacts.update("", { nickname: "Ali" }); ``` ## Delete a contact Remove someone from the directory. CLI: ```bash ravi contacts delete ``` Python: ```python identity.contacts.delete("") ``` TypeScript: ```typescript await identity.contacts.delete(""); ``` --- Looking for exact request and response fields? See the full [API reference](/api/reference/).