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

# Update ICP

> Updates an existing ICP (Ideal Customer Profile) with partial data

Updates an existing ICP (Ideal Customer Profile) with the provided fields. This endpoint supports partial updates - only include the fields you want to change. Fields not included in the request body will remain unchanged.

## Authentication

This endpoint requires authentication. The user must be signed in.

<Note>
  Users can only update ICPs where they are listed in the `userIds` array, or if
  they are an admin user. Attempting to update an ICP without proper
  authorization will result in a 403 Forbidden error.
</Note>

## Request

<ParamField path="id" type="string" required>
  The unique identifier (UUID) of the ICP to update.
</ParamField>

### Request Body

All fields are optional. Only include the fields you want to update.

<ParamField body="name" type="string">
  The display name of the ICP.
</ParamField>

<ParamField body="description" type="string | null">
  A description of the ICP's target profile. Set to `null` to clear.
</ParamField>

<ParamField body="userIds" type="array">
  Array of Clerk user IDs that should have access to this ICP.

  <Expandable title="Array items">
    <ParamField body="userIds[]" type="string">
      A Clerk user ID.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="leadsPerList" type="number">
  The default number of leads to include when generating lead lists from this
  ICP.
</ParamField>

<ParamField body="activeUntil" type="string | null">
  ISO 8601 timestamp indicating when the ICP expires. Set to `null` for
  indefinite.
</ParamField>

<ParamField body="leadProviderCriteria" type="array">
  Array of search criteria configurations for lead providers.

  <Expandable title="Lead provider criteria object">
    <ParamField body="leadProviderCriteria[].provider" type="string" required>
      The lead provider identifier (e.g., `"baseProvider"`).
    </ParamField>

    <ParamField body="leadProviderCriteria[].type" type="string">
      The search type: `"person"` or `"company"`.
    </ParamField>

    <ParamField body="leadProviderCriteria[].filters" type="object" required>
      Provider-specific filter configuration.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="customFilterCriteria" type="array">
  Array of custom filtering rules applied to leads after retrieval.

  <Expandable title="Custom filter types">
    <ParamField body="customFilterCriteria[].type" type="string" required>
      The filter type. One of: `"website"`, `"webscraping"`, `"ai"`, `"maxPeoplePerCompany"`, `"maxPercentFromCRM"`, `"minDaysUntilReuse"`, `"matchFieldWithRegex"`.
    </ParamField>

    Additional fields depend on the filter type:

    **For `maxPeoplePerCompany`, `maxPercentFromCRM`, `minDaysUntilReuse`:**

    * `value` (number): The numeric threshold value.

    **For `website`:**

    * `provider` (string): The provider (default: `"browserUse"`).
    * `prompt` (string): The evaluation prompt.

    **For `webscraping`:**

    * `provider` (string): The provider (default: `"firecrawl"`).
    * `extractionPrompt` (string | null): Extraction prompt.
    * `pageFindingPrompt` (string | null): Page finding prompt.
    * `includeSearchStrings` (array | null): Strings to include.
    * `excludeSearchStrings` (array | null): Strings to exclude.

    **For `ai`:**

    * `entityType` (string): `"person"` or `"company"`.
    * `prompt` (string): The AI evaluation prompt.

    **For `matchFieldWithRegex`:**

    * `field` (string): Field path (e.g., `"firstName"`, `"company.headcount"`).
    * `regex` (string): Regex pattern.
  </Expandable>
</ParamField>

<ParamField body="crmFilters" type="object | null | undefined">
  CRM filter configuration. Set to `null` to remove. This field is both optional and nullable.

  <Expandable title="CRM filters properties">
    <ParamField body="crmFilters.provider" type="string" required>
      The CRM provider (currently only `"bullhorn"`).
    </ParamField>

    <ParamField body="crmFilters.textSearch" type="string | null | undefined">
      Free-text search for occupation/title field (e.g., `"Head OR Leit* OR Direktor"`). This field is both optional and nullable.
    </ParamField>

    <ParamField body="crmFilters.query" type="string | null | undefined">
      Legacy query field. Optional and nullable. Retained for backward compatibility.
    </ParamField>

    <ParamField body="crmFilters.filters" type="array">
      Array of structured filter conditions.

      <Expandable title="Filter condition properties">
        <ParamField body="crmFilters.filters[].path" type="string" required>
          Field path using dot notation (e.g., `"address.zip"`, `"status"`).
        </ParamField>

        <ParamField body="crmFilters.filters[].mode" type="string" required>
          Match mode: `"equals"`, `"in"`, or `"startsWith"`.
        </ParamField>

        <ParamField body="crmFilters.filters[].value" type="string | array" required>
          Value(s) to match. String for `equals`/`startsWith`, array for `in` mode.
        </ParamField>

        <ParamField body="crmFilters.filters[].exclude" type="boolean">
          If `true`, exclude contacts matching this condition. Defaults to `false`.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Response

Returns the complete updated ICP object.

<ResponseField name="id" type="string" required>
  Unique identifier (UUID) for the ICP.
</ResponseField>

<ResponseField name="name" type="string" required>
  The display name of the ICP.
</ResponseField>

<ResponseField name="description" type="string | null" required>
  A description of the ICP's target profile.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp of when the ICP was created.
</ResponseField>

<ResponseField name="updatedAt" type="string" required>
  ISO 8601 timestamp of when the ICP was last updated (will reflect the update
  time).
</ResponseField>

<ResponseField name="userIds" type="array" required>
  Array of Clerk user IDs that have access to this ICP.
</ResponseField>

<ResponseField name="leadsPerList" type="number" required>
  The default number of leads per list.
</ResponseField>

<ResponseField name="activeUntil" type="string | null" required>
  ISO 8601 timestamp indicating when the ICP expires.
</ResponseField>

<ResponseField name="leadProviderCriteria" type="array" required>
  Array of search criteria configurations for lead providers.
</ResponseField>

<ResponseField name="customFilterCriteria" type="array" required>
  Array of custom filtering rules.
</ResponseField>

<ResponseField name="crmFilters" type="object | null | undefined">
  CRM filter configuration. This field is both optional and nullable.
</ResponseField>

## Response Examples

<ResponseExample>
  ```json Request theme={null}
  {
    "name": "Updated ICP Name",
    "leadsPerList": 50,
    "customFilterCriteria": [
      {
        "type": "maxPeoplePerCompany",
        "value": 5
      }
    ]
  }
  ```

  ```json 200 theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Updated ICP Name",
    "description": "C-level and VP-level technology leaders at enterprise companies",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-25T09:15:00.000Z",
    "userIds": ["user_abc123", "user_def456"],
    "leadsPerList": 50,
    "activeUntil": "2024-12-31T23:59:59.000Z",
    "leadProviderCriteria": [
      {
        "provider": "baseProvider",
        "type": "person",
        "filters": {
          "job_titles": ["CTO", "VP Engineering"],
          "company_size": ["501-1000", "1001-5000"]
        }
      }
    ],
    "customFilterCriteria": [
      {
        "type": "maxPeoplePerCompany",
        "value": 5
      }
    ],
    "crmFilters": null
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "BAD_REQUEST",
      "message": "Invalid request body",
      "details": [
        {
          "path": ["leadsPerList"],
          "message": "Expected number, received string"
        }
      ]
    }
  }
  ```

  ```json 403 theme={null}
  {
    "error": {
      "code": "FORBIDDEN",
      "message": "You do not have access to this ICP"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "NOT_FOUND",
      "message": "ICP not found: 550e8400-e29b-41d4-a716-446655440000"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Status Code | Error Code       | Description                                                                     |
| ----------- | ---------------- | ------------------------------------------------------------------------------- |
| 400         | `BAD_REQUEST`    | Invalid request body. Check the `details` field for specific validation errors. |
| 401         | `UNAUTHORIZED`   | User is not authenticated. Ensure a valid session exists.                       |
| 403         | `FORBIDDEN`      | User does not have access to this ICP.                                          |
| 404         | `NOT_FOUND`      | No ICP exists with the specified ID.                                            |
| 500         | `INTERNAL_ERROR` | An unexpected server error occurred.                                            |
