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

# Update lookalikes

> Replace the lookalike page URLs of a Discovery Agent

Replaces the lookalike page URLs on a Discovery Agent. The list you send replaces the saved list. An empty list clears it. Lookalikes are separate from competitor URLs and do not count as a search source. Requires the `write:discovery` permission.

The body is strict. Unknown fields are rejected.

## Path Parameters

**id** `string` *required*

Agent ID.

## Body Parameters

**lookalikes** `string[]` *required*

Lookalike page URLs, up to 5. Each must be a public `http` or `https` URL of at most 255 characters. Duplicates are removed.

## Response

**success** `boolean`

`true` when the request succeeds.

**data** `object`

Lookalike URLs.

**Data fields**

**agent\_id** `string`

Agent ID.

**lookalikes** `string[]`

Saved lookalike page URLs, oldest first.

## Errors

* **400** `VALIDATION_ERROR`: the body is not valid JSON or fails validation. The message is `Invalid request` and `details` lists the invalid fields. This includes more than 5 URLs.
* **400** `UNSAFE_URL`: a URL is not a public http or https address. This covers URLs with credentials, local or private hosts, hosts that do not resolve, and hosts that resolve to a non-public address.
* **404** `NOT_FOUND`: no agent with this ID exists, or the agent was deleted. The message is `Discovery agent not found`.
* **403** `FORBIDDEN`: the agent belongs to another team. The message is `Discovery agent does not belong to your team`.
* **403** `INSUFFICIENT_PERMISSIONS`: the API key does not have the `write:discovery` permission.

```bash cURL theme={null}
curl -X PUT "https://api.affonso.io/v1/discovery/agents/cmn4agt0001xk92hf6d0abcd/lookalikes" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "lookalikes": [
      "https://example.net/best-newsletter-tools",
      "https://example.org/blog/email-marketing-guide"
    ]
  }'
```

```bash cURL Clear theme={null}
curl -X PUT "https://api.affonso.io/v1/discovery/agents/cmn4agt0001xk92hf6d0abcd/lookalikes" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "lookalikes": []
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "agent_id": "cmn4agt0001xk92hf6d0abcd",
    "lookalikes": [
      "https://example.net/best-newsletter-tools",
      "https://example.org/blog/email-marketing-guide"
    ]
  }
}
```


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