جهات الاتصال (Contacts)
أدر جهات اتصال CRM: أنشئ وحدّث السجلات، واقرأ خطوط النشاط، وأضف ملاحظات، واستورد جماعيًا.


On this page
مثال سريع
مُدقّق الأنواع مقابل @medalsocial/sdk v1.3.0 (2026-07-20). أي إصدار يغيّر توقيعًا يوقف بناء هذه الصفحة.
ts
import { Medal } from '@medalsocial/sdk';
const medal = new Medal(process.env.MEDAL_API_KEY as string);
// Create a contact
const { data: created } = await medal.contacts.create({
email: 'nora@solsticecoffee.no',
first_name: 'Nora',
company: 'Solstice Coffee',
status: 'lead',
});
// Read it back, add a note
const { data: contact } = await medal.contacts.get(created.id);
await medal.contacts.addNote(contact.id, { content: 'Met at the Bergen roastery tour.' });
// Bulk import
await medal.contacts.import([
{ email: 'kai@example.com', first_name: 'Kai' },
{ email: 'ida@example.com', first_name: 'Ida', status: 'prospect' },
]);medal.contacts.list()
List contacts with cursor-based pagination and optional filters.
ts
list(options?: ListContactsOptions): Promise<PaginatedResponse<Contact>>أُضيف في v1.0.0
medal.contacts.create()
Create a new contact. Email must be unique in the workspace.
ts
create(input: CreateContactInput): Promise<ApiResponse<ContactCreateResult>>أُضيف في v1.0.0
medal.contacts.get()
Get a contact by ID.
ts
get(id: string): Promise<ApiResponse<Contact>>أُضيف في v1.0.0
medal.contacts.update()
Update one or more fields on a contact.
ts
update(id: string, input: UpdateContactInput): Promise<ApiResponse<ContactUpdateResult>>أُضيف في v1.0.0
medal.contacts.remove()
Permanently delete a contact.
ts
remove(id: string): Promise<ApiResponse<ContactRemoveResult>>أُضيف في v1.0.0
medal.contacts.activities()
Get the activity timeline for a contact.
ts
activities(id: string, options?: PaginationOptions): Promise<PaginatedResponse<Activity>>أُضيف في v1.0.0
medal.contacts.addNote()
Add a note to a contact's timeline.
ts
addNote(id: string, input: AddNoteInput): Promise<ApiResponse<ContactNoteResult>>أُضيف في v1.0.0
medal.contacts.import()
Bulk import contacts (max 500). Duplicates are skipped.
ts
import(contacts: ImportContactInput[]): Promise<ApiResponse<ImportContactsResult>>أُضيف في v1.0.0