Update an entity
curl --request PATCH \
--url https://api.mentionlab.io/api/entities/{id} \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Acme Corporation",
"type": "brand",
"level": "city",
"isOwned": true,
"isPrimary": false,
"isCompetitor": false,
"isBlacklisted": false,
"groupId": "3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c",
"domains": [
"hubspot.com",
"hubspot.fr"
]
}
'import requests
url = "https://api.mentionlab.io/api/entities/{id}"
payload = {
"name": "Acme Corporation",
"type": "brand",
"level": "city",
"isOwned": True,
"isPrimary": False,
"isCompetitor": False,
"isBlacklisted": False,
"groupId": "3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c",
"domains": ["hubspot.com", "hubspot.fr"]
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corporation',
type: 'brand',
level: 'city',
isOwned: true,
isPrimary: false,
isCompetitor: false,
isBlacklisted: false,
groupId: '3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c',
domains: ['hubspot.com', 'hubspot.fr']
})
};
fetch('https://api.mentionlab.io/api/entities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mentionlab.io/api/entities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corporation',
'type' => 'brand',
'level' => 'city',
'isOwned' => true,
'isPrimary' => false,
'isCompetitor' => false,
'isBlacklisted' => false,
'groupId' => '3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c',
'domains' => [
'hubspot.com',
'hubspot.fr'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/entities/{id}"
payload := strings.NewReader("{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mentionlab.io/api/entities/{id}")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Entities
Update an entity
Partially updates an entity’s name, type, classification flags and group; setting the group to null removes it from its group. Renaming also regenerates the slug and adds the new name as an alias, keeping the old one so past mentions still resolve.
PATCH
/
api
/
entities
/
{id}
Update an entity
curl --request PATCH \
--url https://api.mentionlab.io/api/entities/{id} \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Acme Corporation",
"type": "brand",
"level": "city",
"isOwned": true,
"isPrimary": false,
"isCompetitor": false,
"isBlacklisted": false,
"groupId": "3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c",
"domains": [
"hubspot.com",
"hubspot.fr"
]
}
'import requests
url = "https://api.mentionlab.io/api/entities/{id}"
payload = {
"name": "Acme Corporation",
"type": "brand",
"level": "city",
"isOwned": True,
"isPrimary": False,
"isCompetitor": False,
"isBlacklisted": False,
"groupId": "3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c",
"domains": ["hubspot.com", "hubspot.fr"]
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corporation',
type: 'brand',
level: 'city',
isOwned: true,
isPrimary: false,
isCompetitor: false,
isBlacklisted: false,
groupId: '3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c',
domains: ['hubspot.com', 'hubspot.fr']
})
};
fetch('https://api.mentionlab.io/api/entities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mentionlab.io/api/entities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corporation',
'type' => 'brand',
'level' => 'city',
'isOwned' => true,
'isPrimary' => false,
'isCompetitor' => false,
'isBlacklisted' => false,
'groupId' => '3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c',
'domains' => [
'hubspot.com',
'hubspot.fr'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/entities/{id}"
payload := strings.NewReader("{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mentionlab.io/api/entities/{id}")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corporation\",\n \"type\": \"brand\",\n \"level\": \"city\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c\",\n \"domains\": [\n \"hubspot.com\",\n \"hubspot.fr\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Body
application/json
Complete set of domains associated with this entity (replace/sync). Each URL is normalised to a registrable root domain. Omit to leave domains untouched; pass an empty array to clear all. Used to drive the project-scoped "competitor" source category.
Example:
["hubspot.com", "hubspot.fr"]