Manage contacts, companies, activities, and CRM data.
Get activity
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/activities/{activityId}Returns a single CRM activity by ID. Each activity is a natural-language description of something that happened, tagged by source app with optional JSON metadata and linked contact/company objects.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: activity } = await gc.crm.getCrmActivity({ organizationId: "org_123", projectId: "proj_123", appId: "app_123", activityId: "act_123"});Get activities
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/activitiesReturns a paginated timeline of CRM activities for the specified app, newest first. Each activity is a natural-language description of something that happened for a contact (or company), tagged by source app and optionally enriched with a JSON `data` payload. Supports free-text search across the description.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: activities } = await gc.crm.getCrmActivitiesList({ organizationId: "org_123", projectId: "proj_123", appId: "app_123"});Log activity
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/activitiesAppends an activity to the CRM timeline. `description` is a natural-language sentence ('Viewed pricing page', 'Unsubscribed from newsletter'). `source` identifies which app wrote it. Optional `data` carries structured metadata for agents to read. Link to a contact and/or company via id.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const orgId = "org_123";const projectId = "proj_123";const appId = "app_123";const activityData = { type: "call", notes: "Follow-up discussion" };
const { data: activity } = await gc.crm.logCrmActivity({ organizationId: orgId, projectId, appId, data: activityData});Get activities for a company
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/companies/{companyId}/activitiesReturns the natural-language activity timeline for a company, newest first. Each row is a description of something that happened, tagged by source app with optional JSON metadata.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: activities } = await gc.crm.getCrmCompanyActivities({ organizationId: "org_123", projectId: "proj_123", appId: "app_123", companyId: "comp_123"});Get contacts for a company
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/companies/{companyId}/contactsReturns all CRM contacts linked to a specific company, ordered by last name then first name. Each contact includes name, email, phone, title, department, status, source, tags, and linked company object.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const organizationId = "org_123";const projectId = "proj_123";const appId = "app_123";const companyId = "comp_123";
const { data: contacts } = await gc.crm.getCrmCompanyContacts({ organizationId, projectId, appId, companyId});Get company
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/companies/{companyId}Returns a single CRM company by ID, including name, website, industry, size, annual revenue, contact info, address, tags, custom properties, and a count of associated contacts.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: company } = await gc.crm.getCrmCompany({ organizationId: "YOUR_ORGANIZATION_ID", projectId: "YOUR_PROJECT_ID", appId: "YOUR_APP_ID", companyId: "YOUR_COMPANY_ID"});Get companies
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/companiesReturns a paginated list of all CRM companies for the specified app. Supports search by company name or industry. Each company includes a count of associated contacts.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const org = "org_123";const project = "proj_123";const app = "app_123";
const { data: companies } = await gc.crm.getCrmCompaniesList({ organizationId: org, projectId: project, appId: app});Get activities for a contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}/activitiesReturns the natural-language activity timeline for a contact, newest first. Each row is a description of something that happened, tagged by source app with optional JSON metadata.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: activities } = await gc.crm.getCrmContactActivities({ organizationId: "YOUR_ORGANIZATION_ID", projectId: "YOUR_PROJECT_ID", appId: "YOUR_APP_ID", contactId: "YOUR_CONTACT_ID"});Set contact field
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}/fieldsSets a single key on a contact's custom `properties`. Merges at the key level — siblings are preserved. Use this instead of PUT /contacts when only one field needs to change, especially from other apps.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const orgId = "org_123";const projectId = "proj_123";const appId = "app_123";const contactId = "contact_123";const fieldData = { role: "admin" };
const { data: result } = await gc.crm.setCrmContactField({ organizationId: orgId, projectId, appId, contactId, data: fieldData});Get contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}Returns a single CRM contact by ID, including linked company details. Fields include name, email, phone, title, department, status, source, tags, email subscription status, and last activity timestamp.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: contact } = await gc.crm.getCrmContact({ organizationId: "org_123", projectId: "proj_123", appId: "app_123", contactId: "contact_123"});Update contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}Updates a CRM contact. All fields are optional — only provided fields are updated. Returns 409 if email or phone conflicts with an existing contact.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: contact } = await gc.crm.updateCrmContact({ organizationId: "org_123", projectId: "proj_123", appId: "app_123", contactId: "contact_123", data: { email: "user@example.com" }});Tag contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}/tagsAdds a tag to a contact. Tags are free-form strings used for segmenting, gating marketing messages, and ad-hoc grouping. Idempotent — adding an existing tag is a no-op.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const organizationId = "org_123";const projectId = "proj_123";const appId = "app_123";const contactId = "contact_123";const data = { tags: ["premium"] };
const { data: taggedContact } = await gc.crm.tagCrmContact({ organizationId, projectId, appId, contactId, data});Untag contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contacts/{contactId}/tagsRemoves a tag from a contact. Idempotent — removing a tag the contact doesn't have is a no-op.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const orgId = "org_123";const projectId = "proj_123";const appId = "app_123";const contactId = "contact_123";const data = { tag: "example-tag" };
const result = await gc.crm.untagCrmContact(orgId, projectId, appId, contactId, data);Get contacts
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contactsReturns a paginated list of all CRM contacts for the specified app. Supports search by first name, last name, or email. Each contact includes associated company info if linked.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: contacts } = await gc.crm.getCrmContactsList({ organizationId: "org_1", projectId: "proj_1", appId: "app_1"});Create contact
/organizations/{organizationId}/projects/{projectId}/apps/crm/{appId}/contactsCreates a new CRM contact. Requires firstName and lastName. Optionally link to a company via companyId. Supports email, phone, title, department, status, source, custom properties, and tags.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const orgId = "org_123";const projectId = "proj_123";const appId = "app_123";const data = { email: "test@example.com", name: "Test User" };
const { data: contact } = await gc.crm.createCrmContact({ organizationId: orgId, projectId, appId, data});