---
title: "Link a CRM record to a partner"
method: POST
path: "/partners/{identifier}/external_ids"
tags: ["Partners"]
---

# Link a CRM record to a partner

`POST /partners/{identifier}/external_ids`

## Request

- Base URL: `https://api.lassotech.com/api/v1/rest`
- URL: `https://api.lassotech.com/api/v1/rest/partners/{identifier}/external_ids`
- Auth: API key in header `x-lasso-access-token`

Tell Lasso which record on your side represents a partner.

Use this to send us the ID of the record on your side that represents the partner, when we
don't otherwise know about it. Use it for a CRM object the flat `hubspot_company_id`-style fields on
`POST /partners` don't cover, most often a **custom object**, and for any partner that already
exists in Lasso (those fields only apply at creation).

For a partner represented by a custom CRM object, use `object_type: custom_partner_object`.

Once linked, the partner is addressable by your own ID via
`?by=external&external_system_type=…&external_object_type=…`, so you do not have to store a
Lasso identifier on your side if you would rather not.

### Semantics
A partner holds at most one record per `(system_type, object_type)`. Sending a different
identifier for a pair the partner already has **replaces** it; sending the same one again is a
no-op and returns `200`. If a *different* partner in your account already claims that record,
the request is rejected with `409` rather than creating an ambiguous second claim.

The identifier is stored as supplied and is **not** verified against your CRM, so a wrong ID
will be accepted and simply never match anything.

## Path parameters

- `identifier` string, required

## Query parameters

- `by` 'slug' | 'id' | 'lasso_key' | 'name' | 'external'
- `external_system_type` string
- `external_object_type` string

## Request body

- object: Send the record's ID as `identifier_value` (or its alias `external_identifier`); one of the two is required.
  - `system_type` 'HUBSPOT' | 'SALESFORCE' | 'PIPEDRIVE' | 'STRIPE' | 'CHARGEBEE' | 'SHOPIFY_APP', required: The system this record lives in. Sent in any case and stored upper-case.
  - `object_type` string, required: The kind of CRM object. Use `custom_partner_object` for a partner represented by a custom object. Must be one of Lasso's known object types; an unrecognised value is rejected rather than stored, since a typo would otherwise persist a link nothing reads.
  - `identifier_value` string: The CRM record's ID. Named `identifier_value` so it does not collide with the partner identifier in the path; `external_identifier` is accepted as an alias.
  - `external_identifier` string: Alias for `identifier_value`

## Response `200`

The partner already pointed at this record; nothing changed

- PartnerExternalIdResponse
  - `external_id` object
    - `system_type` string
    - `object_type` string
    - `identifier` string
    - `partner_slug` string

## Other responses

- `201`: Record linked to the partner
- `400`: `system_type`, `object_type` or the identifier was missing
- `401`: Missing or invalid API key
- `403`: API key lacks required permission
- `404`: Resource not found
- `409`: The CRM record is already linked to a different record in your account
- `422`: `object_type` is not a known type, or the `?by=name` lookup matched more than one partner
- `429`: Rate limit exceeded. Wait the number of seconds in `Retry-After`, then retry.

---

[API](https://skmtc.dev/onelasso/apis/lasso-rest-api.md) · [All operations](https://skmtc.dev/onelasso/apis/lasso-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onelasso/apis/lasso-rest-api/revisions/bbc328f5e2d1?raw)
