> ## Documentation Index
> Fetch the complete documentation index at: https://developers.initdesk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Attach company members

> Attach customers who have no company. Already-membered ids are skipped (not moved). Missing or other-organization ids are `not_found`. The 200 accounts for every requested id exactly once. No customer objects are returned.



## OpenAPI

````yaml https://api.initdesk.com/schema.yaml post /organizations/{organization_id}/companies/{pk}/members/
openapi: 3.0.3
info:
  title: initdesk Customer API
  version: 1.52.0
  description: OpenAPI documentation for the customer-facing API served by the gateway.
servers:
  - url: https://api.initdesk.com
    description: Customer API gateway
security:
  - IntegrationToken: []
tags:
  - name: Organizations
    description: Organization metadata and context for all other resources.
  - name: Customers
    description: >-
      End users (requesters) scoped to the organization. Tickets reference
      customers by ID.
  - name: Tickets
    description: >-
      Tickets, messages, attachments, search, and statuses. A ticket is the
      conversation container; messages are nested under
      `/tickets/{pk}/messages/`.


      **Attachments (two-phase upload):** upload the file first (multipart field
      `file_upload`), then pass the returned `id` values as `attachment_ids`
      when creating a ticket or message.

      - New ticket: `POST
      /organizations/{organization_id}/pending-attachments/`, then `POST
      /organizations/{organization_id}/tickets/` with `attachment_ids`.

      - Reply on an existing ticket: `POST
      /organizations/{organization_id}/tickets/{ticket_id}/attachments/`, then
      `POST .../messages/` with `attachment_ids`.

      Max size is 50 MB. Large or slow uploads may hit the public gateway
      timeout (30s). Unused temporary uploads are deleted automatically (default
      ~24 hours); there is no public delete endpoint. Content types `text/html*`
      and `image/svg+xml` are rejected.
  - name: Custom Preset Filters
    description: >-
      Saved ticket search filters scoped to the organization. Integration tokens
      receive organization-shared filters only.
  - name: Inboxes
    description: >-
      Organization mailboxes for routing tickets. Each inbox has an email prefix
      and optional default-inbox flag (is_default: true). On ticket create,
      inbox_id is optional: omit to use the default inbox, or provide an inbox
      ID to target a specific mailbox.
  - name: Tags
    description: Organization-scoped ticket tags with id, name, and optional color.
  - name: Help Center
    description: >-
      Support portal settings, knowledge base collections, articles, and article
      search.
  - name: Companies
    description: >-
      Organization-scoped groupings of customers. A customer belongs to at most
      one company (nested `customer.company`); companies carry a default
      assignee and optional email domains used for member suggestions.
paths:
  /organizations/{organization_id}/companies/{pk}/members/:
    post:
      tags:
        - Companies
      summary: Attach company members
      description: >-
        Attach customers who have no company. Already-membered ids are skipped
        (not moved). Missing or other-organization ids are `not_found`. The 200
        accounts for every requested id exactly once. No customer objects are
        returned.
      operationId: attach_company_members
      parameters:
        - in: path
          name: pk
          schema:
            type: string
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
            pattern: ^[-a-zA-Z0-9_]+$
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyMemberAttachRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CompanyMemberAttachRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CompanyMemberAttachRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberAttachResult'
          description: ''
      security:
        - IntegrationToken: []
components:
  schemas:
    CompanyMemberAttachRequest:
      type: object
      description: Request body for ``POST .../companies/{pk}/members/``.
      properties:
        customer_ids:
          type: array
          items:
            type: integer
            minimum: 1
      required:
        - customer_ids
    CompanyMemberAttachResult:
      type: object
      description: 'Envelope B: every requested id is accounted for exactly once.'
      properties:
        requested_count:
          type: integer
        attached_count:
          type: integer
        skipped_count:
          type: integer
        skipped_ids:
          type: array
          items:
            type: integer
        not_found_count:
          type: integer
        not_found_ids:
          type: array
          items:
            type: integer
      required:
        - attached_count
        - not_found_count
        - not_found_ids
        - requested_count
        - skipped_count
        - skipped_ids
  securitySchemes:
    IntegrationToken:
      type: apiKey
      in: header
      name: X-Initdesk-Token

````