GET/ tags/ :id/ companies/
Get companies by tag
You can return all companies including a specific tag.
Attributes
Optional unless marked required
- id
- A unique identifier for the tag which is given by User automatically.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/tags/:id/companies/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/tags/:id/companies/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/tags/:id/companies/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/tags/:id/companies/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"count": 1,"next": null,"previous": null,"results": [{"id": 777,"name": "Northwind Traders","description": null,"email": null,"country": null,"region": null,"city": null,"address": null,"postal_code": null,"approx_employees": null,"created_at": "2026-11-10T13:19:54.251479Z","updated_at": "2026-11-10T13:19:54.251504Z","attributes": [],"tags": ,1 item"employees": [],"phone_numbers": null,"company_id": "northwind","assigned_to": null}]}{
"detail": "No Tag matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - A unique identifier for the tag which is given by User automatically.
- results[].
name - A tag name.
- results[].
description - A description of a company.
- results[].
email - A company’s email address.
- results[].
country - A company country of residence.
- results[].
region - A company region of residence.
- results[].
city - A company city of residence.
- results[].
address - A company’s address.
- results[].
postal_code - A postal code according to the address of your company..
- results[].
approx_employees - An approximate size of your company. Called
sizein API v2 responses elsewhere. - results[].
created_at - A creation date of a company.
- results[].
updated_at - A date of last company update.
- results[].
attributes - Custom company attributes that have a value, each with
name,name_std,value,descriptionandvalue_type. - results[].
tags - A list of tags associated with a company
- results[].
tags[]. id - A unique identifier for the tag which is given by User automatically.
- results[].
tags[]. name - A tag name.
- results[].
- results[].
employees - IDs of the contacts who belong to the company.
- results[].
phone_numbers - A list of phone numbers.
- results[].
company_id - A unique identifier for the company which is given by User automatically.
- results[].
assigned_to - ID of the agent group the company is assigned to.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.