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

# LinkedIn API Best Practices

> The importance of using LinkedIn Profile IDs over mutable handles for reliable data access and integration.

## Understanding Profile Access and Optimizing Data Handling

When working with LinkedIn, the **“Profile is Not Accessible”** error often occurs when profile handles (the part of the LinkedIn URL after `/in/`) change. Since handles can be updated by users, workflows referencing outdated URLs may break.

<Info>
  To avoid this issue, it's essential to focus on **immutable and unique
  identifiers**, like the **LinkedIn Profile ID**, rather than relying on
  mutable handles.
</Info>

By using Profile IDs, you can ensure stable, efficient, and reliable data access across your systems.

## Why Immutable Profile IDs Matter

* **Handles Can Change**: Users may update their LinkedIn handles, which can break automation workflows or CRM integrations.
* **Profile IDs Are Permanent**: Unlike handles, Profile IDs are immutable, offering a consistent way to reference profiles without disruption.
* **Versatile Use**: Profile IDs are essential for a variety of actions, such as creating outreach sequences or tracking user activities or updates

Traditional identifiers like emails, phone numbers, and handles can be problematic:

* **Not Immutable**: Emails and LinkedIn handles can change.
* **Not Always Unique**: Some domain names and company URLs overlap.
* **Region-Specific**: Phone numbers can be region-specific, limiting global reach.

By relying on Profile IDs and other immutable identifiers, you ensure:

* **Consistency**: Prevent errors caused by changing handles, emails, or phone numbers.
* **Scalability**: Profile IDs support global operations.
* **Advanced Insights**: Track job changes, new hires, and company growth without missing key data points.

## How to Effectively Use Profile Handles and IDs

1️⃣ **Retrieve the LinkedIn Profile Handle**

To find the LinkedIn profile handle, simply look at the URL, e.g. `https://www.linkedin.com/in/guillaume12345/` corresponds to the handle `guillaume12345`.
However, since handles are mutable and can change, **LinkedIn Profile IDs** offer a more stable solution to store IDs.

2️⃣ **Integrate Handles into Workflows**

Use handles in your workflows for actions like:

* Sending LinkedIn follow-ups using [Message LinkedIn Profile](/v1/api/actions/linkedin-message-profile)
* Filtering specific connections or job changes
* Tracking updates to companies or individuals

3️⃣ **Focus on Immutable Identifiers**

Relying solely on mutable identifiers, like emails or phone numbers, in your database, can lead to system errors.
For long-term reliability, stick with **Profile IDs**.

## Optimizing Operations with Unique Identifiers

To streamline your operations, use unique, immutable identifiers for both individuals and companies:

**For People**:

* **LinkedIn Profile ID** `linkedin_profile_id`: The most reliable way to track individuals.
* **Sales Navigator Profile ID** `sales_navigator_profile_id`: Useful for many workflows, though not unique, you can have up to 2 IDs.

**For Companies**:

* **LinkedIn Company ID** `linkedin_company_id`: An immutable identifier for companies on LinkedIn, e.g., Edges’s is `27193685`.
* **Sales Navigator Company ID** `sales_navigator_company_id`: Ideal for more advanced workflows.

**For Conversations**:

* **`linkedin_thread_id`**: Key for retrieving messages in a specific LinkedIn conversation, essential for communication tracking.

By focusing on these immutable identifiers, you can ensure smoother integrations and avoid common issues with changing handles.

## Recovering LinkedIn Profile URLs When Handles Change

When a LinkedIn profile handle changes, the old URL may continue working temporarily but will eventually return a 404 error. Here are two effective solutions to recover the new profile URL:

A "profile handle" is the final part of the URL, for example:

> [https://www.linkedin.com/in/amaury-riviere/](https://www.linkedin.com/in/amaury-riviere/) → here, the handle is `amaury-riviere`

When this handle is changed, the **old URL keeps working for a while**, but eventually it will **return a 404 error**.

### 💡 Solution 1 — Using the Sales Navigator Profile ID (Recommended)

If you've previously enriched profiles using **Edges**, you might have saved the **sales\_navigator\_profile\_id**.

<Warning>
  Note: There can be two different IDs for the same user, so it's not strictly unique.
</Warning>

However, this ID is **very powerful**, as it allows you to **rebuild the LinkedIn profile URL**, even if the handle has changed.

### 💡 Solution 2 — Using the Extract People Profile

1. **Enrich your list** using the *Extract People Profile* action.

2. If you get a **404 error**, it means the handle is no longer valid.

3. **Keep track** of all profiles with inactive handles.

4. Then, use a **LinkedIn People Search** with this syntax:

   ```
   "FULL NAME" AND "COMPANY NAME"
   ```

   Example:

   [https://www.linkedin.com/search/results/people/?keywords=%22John%20Doe%22%20AND%20%22Company%20Name%22](https://www.linkedin.com/search/results/people/?keywords=%22John%20Doe%22%20AND%20%22Company%20Name%22)

   → with the parameter `extract only unique profile`.

5. If you find the profile, you can **re-enrich it** to retrieve the **new handle**.

   The **LinkedIn Profile ID** itself normally remains **the same**.

## Best Practices for Long-term Reliability

In summary, it's important to **keep both identifiers** — the **LinkedIn Profile ID** and the **Sales Navigator Profile ID** — for every profile you enrich.

* The **Sales Navigator ID** is especially useful because it allows you to **rebuild or regenerate a LinkedIn profile URL** later, even if the profile handle has changed.
* The **LinkedIn ID** serves as a **stable, unique identifier** that never changes, making it ideal for long-term storage and data consistency.

<Warning>
  Keep in mind that in some cases, **a profile may have two different Sales Navigator IDs**, so always verify which one is currently active before using it.
</Warning>

By keeping both IDs, you ensure better reliability, traceability, and flexibility for any future LinkedIn data operations.
