> ## Documentation Index
> Fetch the complete documentation index at: https://productlane.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a contact to a company

> Add a company to the contact's memberships. Idempotent, and becomes the primary when the contact has none. Requires the contacts:write scope.



## OpenAPI

````yaml openapi-v2.json post /contacts/{id}/companies
openapi: 3.0.3
info:
  title: Productlane API
  description: Productlane API v2.
  version: 2.0.0
servers:
  - url: https://productlane.com/api/v2
security: []
paths:
  /contacts/{id}/companies:
    post:
      tags:
        - contacts
      summary: Add a contact to a company
      description: >-
        Add a company to the contact's memberships. Idempotent, and becomes the
        primary when the contact has none. Requires the contacts:write scope.
      operationId: contacts-attachCompany
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                company_id:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Productlane company id. Mutually exclusive with
                    `company_name` and `company_external_id`.
                company_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Resolves a company by exact name. Errors if multiple
                    companies share the name.
                company_external_id:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Resolves a company by an entry in its `external_ids` array.
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  contact:
                    type: object
                    properties:
                      id:
                        type: string
                      email:
                        type: string
                      name:
                        type: string
                        nullable: true
                      image_url:
                        type: string
                        nullable: true
                      company_id:
                        type: string
                        nullable: true
                      is_subscribed:
                        type: boolean
                      external_ids:
                        type: array
                        items:
                          type: string
                        description: >-
                          Caller-owned cross-system identifiers (CRM ids, etc.).
                          Replaced wholesale on create/update.
                      integration_ids:
                        type: object
                        properties:
                          intercom:
                            type: string
                          front:
                            type: string
                          zendesk:
                            type: string
                          hubspot:
                            type: string
                          plain:
                            type: string
                          productboard:
                            type: string
                          slack_channel:
                            type: string
                        additionalProperties: false
                      created_at:
                        type: string
                      updated_at:
                        type: string
                    required:
                      - id
                      - email
                      - name
                      - image_url
                      - company_id
                      - is_subscribed
                      - external_ids
                      - integration_ids
                      - created_at
                      - updated_at
                    additionalProperties: false
                  companies:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        logo_url:
                          type: string
                          nullable: true
                        domains:
                          type: array
                          items:
                            type: string
                        size:
                          type: number
                          nullable: true
                        revenue:
                          type: number
                          nullable: true
                        status_id:
                          type: string
                          nullable: true
                        status_name:
                          type: string
                          nullable: true
                        tier_id:
                          type: string
                          nullable: true
                        tier_name:
                          type: string
                          nullable: true
                        owner:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                              nullable: true
                            avatar_url:
                              type: string
                              nullable: true
                          required:
                            - id
                            - name
                            - avatar_url
                          additionalProperties: false
                          nullable: true
                        external_ids:
                          type: array
                          items:
                            type: string
                          description: >-
                            Caller-owned cross-system identifiers (CRM ids,
                            etc.). Replaced wholesale on create/update.
                        integration_ids:
                          type: object
                          properties:
                            intercom:
                              type: string
                            front:
                              type: string
                            zendesk:
                              type: string
                            hubspot:
                              type: string
                            plain:
                              type: string
                            productboard:
                              type: string
                            slack_channel:
                              type: string
                          additionalProperties: false
                        created_at:
                          type: string
                        updated_at:
                          type: string
                      required:
                        - id
                        - name
                        - logo_url
                        - domains
                        - size
                        - revenue
                        - status_id
                        - status_name
                        - tier_id
                        - tier_name
                        - owner
                        - external_ids
                        - integration_ids
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - contact
                  - companies
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````