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"
]
}'
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": []
}'
{
"success": true,
"data": {
"agent_id": "cmn4agt0001xk92hf6d0abcd",
"lookalikes": [
"https://example.net/best-newsletter-tools",
"https://example.org/blog/email-marketing-guide"
]
}
}
Agents
Update lookalikes
Replace the lookalike page URLs of a Discovery Agent
PUT
/
v1
/
discovery
/
agents
/
{id}
/
lookalikes
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"
]
}'
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": []
}'
{
"success": true,
"data": {
"agent_id": "cmn4agt0001xk92hf6d0abcd",
"lookalikes": [
"https://example.net/best-newsletter-tools",
"https://example.org/blog/email-marketing-guide"
]
}
}
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
Body Parameters
Lookalike page URLs, up to 5. Each must be a public
http or https URL of at most 255 characters. Duplicates are removed.Response
Errors
- 400
VALIDATION_ERROR: the body is not valid JSON or fails validation. The message isInvalid requestanddetailslists 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 isDiscovery agent not found. - 403
FORBIDDEN: the agent belongs to another team. The message isDiscovery agent does not belong to your team. - 403
INSUFFICIENT_PERMISSIONS: the API key does not have thewrite:discoverypermission.
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"
]
}'
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": []
}'
{
"success": true,
"data": {
"agent_id": "cmn4agt0001xk92hf6d0abcd",
"lookalikes": [
"https://example.net/best-newsletter-tools",
"https://example.org/blog/email-marketing-guide"
]
}
}
Was this page helpful?
