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

# Log Interaction to CRM

> Write one critical interaction onto the matched CRM company as a note

Write one critical competitor interaction onto the matched CRM company as a note, so the signal lands where the deal is worked rather than only in Clustr.

It works the same way for HubSpot, Salesforce and Attio, so you do not choose a provider. **Clustr composes the note body from the interaction's stored verdict.** Your request picks the interaction, and Clustr writes the text that lands in your system of record.

Requires the account to resolve to a CRM company and your CRM connection to permit note creation; both fail as `403`.

Idempotent: an already-logged interaction returns `200` with `already_logged: true` rather than writing a second note, because your CRM would otherwise store a duplicate.

```bash cURL theme={null}
curl -X POST https://api.clustr-ai.com/api/public/competitor-interactions/log-to-crm \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actor_linkedin_id": "per_bs9t25pnx8ax5p80ckexz9r35s",
    "target_linkedin_id": "per_pfc2a7z0j6r9sbtedxy7gayf39",
    "post_key": "urn:li:activity:7212345678901234567"
  }'
```

```python Python theme={null}
import requests

requests.post(
    "https://api.clustr-ai.com/api/public/competitor-interactions/log-to-crm",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "actor_linkedin_id": "per_bs9t25pnx8ax5p80ckexz9r35s",
        "target_linkedin_id": "per_pfc2a7z0j6r9sbtedxy7gayf39",
        "post_key": "urn:li:activity:7212345678901234567",
    },
)
```

```javascript JavaScript theme={null}
await fetch("https://api.clustr-ai.com/api/public/competitor-interactions/log-to-crm", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    actor_linkedin_id: "per_bs9t25pnx8ax5p80ckexz9r35s",
    target_linkedin_id: "per_pfc2a7z0j6r9sbtedxy7gayf39",
    post_key: "urn:li:activity:7212345678901234567",
  }),
});
```

```json 200 theme={null}
{
  "success": true,
  "data": { "ok": true, "already_logged": false, "result_id": "note_90210" }
}
```

```json 403 theme={null}
{
  "success": false,
  "error": {
    "message": "CRM connection does not permit note creation",
    "code": "FORBIDDEN"
  }
}
```

```json 404 theme={null}
{
  "success": false,
  "error": {
    "message": "This account does not resolve to a CRM company",
    "code": "NOT_FOUND"
  }
}
```


## OpenAPI

````yaml POST /competitor-interactions/log-to-crm
openapi: 3.1.0
info:
  title: Clustr Public API
  description: >
    Programmatic access to your Clustr network: import connectors, search warm
    intros (opportunities), and manage target accounts.


    ## Authentication

    All endpoints require a Bearer token (API key) in the `Authorization`
    header.


    ```

    Authorization: Bearer <your_api_key>

    ```


    API keys can be created and managed from the [API settings
    page](https://app.clustr-ai.com/api).
  version: '1.0'
  contact:
    name: Clustr Support
    url: https://clustr-ai.com
servers:
  - url: https://api.clustr-ai.com/api/public
    description: Production
security:
  - BearerAuth: []
paths:
  /competitor-interactions/log-to-crm:
    post:
      tags:
        - Competitor Monitoring
      summary: Log Interaction to CRM
      description: >-
        Writes one critical interaction as a note on the matching company in
        your CRM (HubSpot, Salesforce or Attio). Clustr writes the note text
        from its own verdict on the interaction; the request only identifies the
        interaction. Logging an interaction that is already logged returns
        `already_logged: true`.
      operationId: logCompetitorInteractionToCrm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - actor_linkedin_id
                - target_linkedin_id
                - post_key
              properties:
                actor_linkedin_id:
                  type: string
                  description: >-
                    The Clustr ID (`per_…`) of the competitor's salesperson.
                    Their LinkedIn id (`rep_linkedin_id` on

                    the feed entry) also works.
                target_linkedin_id:
                  type: string
                  description: >-
                    The engaged person's Clustr ID (`per_…`). Their LinkedIn id
                    also works.
                post_key:
                  type: string
                  description: The interaction's `post_key`.
      responses:
        '200':
          description: Note written, or already present
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    additionalProperties: true
        '401':
          description: Invalid or missing API key
        '403':
          description: Competitor monitoring is not enabled for this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request body
            code:
              type: string
              example: BAD_REQUEST
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: The API key you created on the API settings page of the Clustr app.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.