Skip to main content
Companies

Attach a contact to a company

Attaches a contact (customer) to a company.

POST
/v2/companies/{id}/contacts

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

FieldTypeRequiredDescription
contactIdstringYesThe Featurebase internal ID of the contact to attach (MongoDB ObjectId)

Example Request

{
  "contactId": "507f1f77bcf86cd799439012"
}

Response

Returns the updated contact object with the new company association.

Example Response

{
  "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.

Authorizationstringheaderrequired

API key as Bearer token. Use: Authorization: Bearer sk_...

idstringrequired

The Featurebase internal ID of the company (MongoDB ObjectId)

Example: 507f1f77bcf86cd799439011
Featurebase-Versionenum<string>header

API version for this request. Defaults to your organization's configured API version if not specified.

Available options: 2026-08-19.orbit, 2026-01-01.nova, 2025-12-12.clover
Example: 2026-08-19.orbit

Body

application/json
contactIdstringrequired

The Featurebase internal ID of the contact to attach (MongoDB ObjectId)

Example: 507f1f77bcf86cd799439012

Response

application/json

Success

commentsCreatednumber

Number of comments created

Example: 0
companiesobject[]

Companies the contact belongs to

customFieldsobject

Custom field values on the contact

descriptionstring

Contact description/bio

Example:
emailstring | null

Contact email

Example: john@example.com
idstringrequired

Unique identifier

Example: 676f0f6765bdaa7d7d760f88
lastActivitystring

Last activity ISO timestamp

Example: 2025-01-03T21:42:30.181Z
localestring

Contact locale

Example: en
manuallyOptedOutFromChangelogboolean

Whether manually opted out from changelog

Example: false
namestringrequired

Contact display name

Example: John Steezy
objectenum<string>required

Object type identifier

Available options: contact
Example: contact
organizationIdstring

Organization ID the contact belongs to

Example: 5febde12dc56d60012d47db6
postsCreatednumber

Number of posts created

Example: 0
profilePicturestring | null

Profile picture URL

Example: https://fb-usercontent.fra1.cdn.digitaloceanspaces.com/anon_23.png
rolesstring[]

Contact roles

subscribedToChangelogboolean

Whether subscribed to changelog

Example: true
typeenum<string>required

Type of contact

Available options: customer, lead
Example: customer
userIdstring

External user ID from SSO

Example: 676f0f673dbb299c8a4f3057
verifiedboolean

Whether email is verified

Example: true