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

# Assign Customer CSMs

> Assign Customer Success Manager contacts to customers by Stripe customer ID.

Monk resolves each Stripe customer ID within the authenticated organization.
For each matched customer, existing imported CSM contacts are demoted to
`Unreachable` except the incoming CSM email, then the incoming CSM is
created or updated. Manually-created CSM contacts are preserved.


Send up to 100 assignments per request. Unmapped Stripe customer IDs
are returned as `not_found` results instead of failing the whole request.

**Scope:** `customers:write`


## OpenAPI

````yaml /openapi/customers.yaml post /v1/customers/csm-assignments
openapi: 3.1.0
info:
  title: Customers API
  version: '1.0'
servers:
  - url: https://api.monk.com
    description: Production
  - url: https://api-sandbox.monk.com
    description: Sandbox
security:
  - bearerAuth: []
paths:
  /v1/customers/csm-assignments:
    post:
      summary: Assign Customer CSMs
      description: >
        Assign Customer Success Manager contacts to customers by Stripe customer
        ID.


        Monk resolves each Stripe customer ID within the authenticated
        organization.

        For each matched customer, existing imported CSM contacts are demoted to

        `Unreachable` except the incoming CSM email, then the incoming CSM is

        created or updated. Manually-created CSM contacts are preserved.
      operationId: assignCustomerCsms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - assignments
              properties:
                assignments:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: CSM assignments keyed by Stripe customer ID.
                  items:
                    type: object
                    required:
                      - stripeCustomerId
                      - csm
                    properties:
                      stripeCustomerId:
                        type: string
                        description: >-
                          Stripe customer ID linked to a Monk customer in this
                          organization.
                        example: cus_123
                      csm:
                        type: object
                        required:
                          - name
                          - email
                        properties:
                          name:
                            type: string
                            description: CSM full name.
                            example: Nurah Example
                          email:
                            type: string
                            format: email
                            description: CSM email address.
                            example: nurah@example.com
            example:
              assignments:
                - stripeCustomerId: cus_123
                  csm:
                    name: Nurah Example
                    email: nurah@example.com
      responses:
        '200':
          description: CSM assignment results
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      updated:
                        type: integer
                        description: Number of assignments that updated a customer.
                      notFound:
                        type: integer
                        description: >-
                          Number of Stripe customer IDs not mapped in this
                          organization.
                      results:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              required:
                                - stripeCustomerId
                                - status
                                - customerId
                                - csmContactId
                                - demotedCount
                              properties:
                                stripeCustomerId:
                                  type: string
                                status:
                                  type: string
                                  enum:
                                    - updated
                                customerId:
                                  type: string
                                csmContactId:
                                  type: string
                                demotedCount:
                                  type: integer
                                  description: >-
                                    Number of imported CSM contacts demoted to
                                    Unreachable.
                            - type: object
                              required:
                                - stripeCustomerId
                                - status
                              properties:
                                stripeCustomerId:
                                  type: string
                                status:
                                  type: string
                                  enum:
                                    - not_found
              example:
                data:
                  updated: 1
                  notFound: 1
                  results:
                    - stripeCustomerId: cus_123
                      status: updated
                      customerId: 8d081545-cc04-4e0b-88a2-4f71f2d2a351
                      csmContactId: 5dd9fa1a-6e18-4bbf-8095-c36c1b6b97dc
                      demotedCount: 1
                    - stripeCustomerId: cus_missing
                      status: not_found
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````