Create a new entity
curl --request POST \
--url https://api.mentionlab.io/api/entities \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Samsung",
"type": "brand",
"isOwned": true,
"isPrimary": false,
"isCompetitor": false,
"isBlacklisted": false,
"groupId": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://api.mentionlab.io/api/entities"
payload = {
"name": "Samsung",
"type": "brand",
"isOwned": True,
"isPrimary": False,
"isCompetitor": False,
"isBlacklisted": False,
"groupId": "550e8400-e29b-41d4-a716-446655440000"
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Samsung',
type: 'brand',
isOwned: true,
isPrimary: false,
isCompetitor: false,
isBlacklisted: false,
groupId: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://api.mentionlab.io/api/entities', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Samsung',
'type' => 'brand',
'isOwned' => true,
'isPrimary' => false,
'isCompetitor' => false,
'isBlacklisted' => false,
'groupId' => '550e8400-e29b-41d4-a716-446655440000'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.mentionlab.io/api/entities")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"type": "brand",
"isOwned": true,
"isPrimary": true,
"isCompetitor": true,
"isBlacklisted": true,
"domains": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "hubspot.com"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"group": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "group",
"name": "<string>",
"slug": "<string>",
"parent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"canonicalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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
Create a new entity
Creates a new entity (brand, person, company, or other) in the project, automatically generating a default alias from its name.
POST
/
api
/
entities
Create a new entity
curl --request POST \
--url https://api.mentionlab.io/api/entities \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Samsung",
"type": "brand",
"isOwned": true,
"isPrimary": false,
"isCompetitor": false,
"isBlacklisted": false,
"groupId": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://api.mentionlab.io/api/entities"
payload = {
"name": "Samsung",
"type": "brand",
"isOwned": True,
"isPrimary": False,
"isCompetitor": False,
"isBlacklisted": False,
"groupId": "550e8400-e29b-41d4-a716-446655440000"
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Samsung',
type: 'brand',
isOwned: true,
isPrimary: false,
isCompetitor: false,
isBlacklisted: false,
groupId: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://api.mentionlab.io/api/entities', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Samsung',
'type' => 'brand',
'isOwned' => true,
'isPrimary' => false,
'isCompetitor' => false,
'isBlacklisted' => false,
'groupId' => '550e8400-e29b-41d4-a716-446655440000'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.mentionlab.io/api/entities")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Samsung\",\n \"type\": \"brand\",\n \"isOwned\": true,\n \"isPrimary\": false,\n \"isCompetitor\": false,\n \"isBlacklisted\": false,\n \"groupId\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"type": "brand",
"isOwned": true,
"isPrimary": true,
"isCompetitor": true,
"isBlacklisted": true,
"domains": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "hubspot.com"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"group": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "group",
"name": "<string>",
"slug": "<string>",
"parent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"canonicalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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
Body
application/json
Entity name
Example:
"Samsung"
Entity type
Available options:
brand, person, company, other Is this entity owned by the project
Example:
true
Is this the primary entity
Example:
false
Is this a competitor entity
Example:
false
Is this entity blacklisted
Example:
false
Entity group ID
Example:
"550e8400-e29b-41d4-a716-446655440000"
Response
Available options:
brand, person, company, other Domains mapped to this entity (project-scoped).
Show child attributes
Show child attributes
Show child attributes
Show child attributes