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",
"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",
"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',
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',
'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 \"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 \"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 \"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"
}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.
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",
"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",
"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',
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',
'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 \"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 \"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 \"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"
}Headers
Project ID to specify the project context
Path Parameters
The UUID of the entity to update.
Body
Display name of the entity
"Acme Corporation"
Type/category of the entity
brand, person, company, other "brand"
Whether this entity belongs to (is owned by) the current project
true
Whether this entity is the project's primary entity
false
Whether this entity is tracked as a competitor
false
Whether this entity is blacklisted and should be excluded from tracking
false
UUID of the entity group to assign this entity to. Pass null to remove the entity from its current group.
"3f9a8b2c-1d4e-4f6a-9b8c-7d6e5f4a3b2c"
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.
["hubspot.com", "hubspot.fr"]