# Attach a contact to a company Attaches a contact (customer) to a company. Adds the company to the contact's companyIds array and embedded companies array. This operation is additive - existing company associations are preserved. Also increments the linkedUsers count on the company. ### Path Parameters - id - The Featurebase internal ID of the company (MongoDB ObjectId) ### Request Body | Field | Type | Required | Description | |-------|------|----------|-------------| | contactId | string | Yes | The Featurebase internal ID of the contact to attach (MongoDB ObjectId) | ### Example Request json { "contactId": "507f1f77bcf86cd799439012" } ### Response Returns the updated contact object with the new company association. ### Example Response json { "object": "contact", "id": "507f1f77bcf86cd799439012", "userId": "usr_12345", "email": "john@acme.com", "name": "John Doe", "type": "customer", "companies": [ { "object": "company", "id": "507f1f77bcf86cd799439011", "companyId": "comp_12345", "name": "Acme Inc" } ] } ### Error Responses - 404 Not Found - Company or contact does not exist ### Version Availability This endpoint is only available in API version 2026-01-01.nova and newer. Endpoint: POST /v2/companies/{id}/contacts Version: 2026-01-01.nova Security: bearerAuth ## Header parameters: - `Featurebase-Version` (string) API version for this request. Defaults to your organization's configured API version if not specified. Example: "2026-01-01.nova" ## Path parameters: - `id` (string, required) The Featurebase internal ID of the company (MongoDB ObjectId) Example: "507f1f77bcf86cd799439011" ## Request fields (application/json): - `contactId` (string, required) The Featurebase internal ID of the contact to attach (MongoDB ObjectId) Example: "507f1f77bcf86cd799439012" ## Response 200 fields (application/json): - `object` (string, required) Object type identifier Enum: "contact" - `id` (string, required) Unique identifier Example: "676f0f6765bdaa7d7d760f88" - `userId` (string) External user ID from SSO Example: "676f0f673dbb299c8a4f3057" - `organizationId` (string) Organization ID the contact belongs to Example: "5febde12dc56d60012d47db6" - `companies` (array) Companies the contact belongs to Example: [] - `companies.id` (string, required) Featurebase internal ID Example: "507f1f77bcf86cd799439011" - `companies.companyId` (string, required) External company ID from your system Example: "comp_12345" - `companies.name` (string, required) Company name Example: "Acme Inc" - `companies.monthlySpend` (number,null, required) Monthly spend Example: 5000 - `companies.industry` (string,null, required) Industry Example: "Technology" - `companies.website` (string,null, required) Company website URL Example: "https://acme.com" - `companies.plan` (string,null, required) Plan or tier name Example: "enterprise" - `companies.linkedUsers` (number,null, required) Number of users linked to this company Example: 15 - `companies.companySize` (number,null, required) Company employee headcount Example: 250 - `companies.lastActivity` (string,null, required) ISO date of last activity Example: "2025-01-15T00:00:00.000Z" - `companies.customFields` (object) Custom field values Example: {"location":"Europe","priority":"high"} - `companies.createdAt` (string,null, required) ISO date when company was created Example: "2025-01-01T12:00:00.000Z" - `companies.updatedAt` (string,null, required) ISO date when company was last updated Example: "2025-01-10T15:30:00.000Z" - `email` (string,null) Contact email Example: "john@example.com" - `name` (string, required) Contact display name Example: "John Steezy" - `profilePicture` (string,null) Profile picture URL Example: "https://fb-usercontent.fra1.cdn.digitaloceanspaces.com/anon_23.png" - `commentsCreated` (number) Number of comments created - `postsCreated` (number) Number of posts created - `lastActivity` (string) Last activity ISO timestamp Example: "2025-01-03T21:42:30.181Z" - `subscribedToChangelog` (boolean) Whether subscribed to changelog Example: true - `manuallyOptedOutFromChangelog` (boolean) Whether manually opted out from changelog - `roles` (array) Contact roles Example: [] - `locale` (string) Contact locale Example: "en" - `verified` (boolean) Whether email is verified Example: true - `type` (string, required) Type of contact Enum: "customer", "lead" - `description` (string) Contact description/bio - `customFields` (object) Custom field values on the contact ## Response 400 fields (application/json): - `error` (object, required) - `error.type` (string, required) The type of error returned Enum: "invalid_request_error" - `error.code` (string, required) Machine-readable error code Enum: "invalid_id" - `error.message` (string, required) Human-readable error message Example: "An error occurred" - `error.param` (string) The parameter that caused the error (if applicable) Example: "id" - `error.status` (number, required) HTTP status code Enum: 400 ## Response 404 fields (application/json): - `error` (object, required) - `error.type` (string, required) The type of error returned Enum: "invalid_request_error" - `error.code` (string, required) Machine-readable error code Enum: "company_not_found", "contact_not_found" - `error.message` (string, required) Human-readable error message Example: "An error occurred" - `error.param` (string) The parameter that caused the error (if applicable) Example: "id" - `error.status` (number, required) HTTP status code Enum: 404