Company tags: introducing filtering
· 2 min read
The List companies endpoint now supports querying by tags, streamlining company management in Codat. This feature lets you retrieve companies based on specific criteria.
What's new?
You can now use the tags
query parameter on the List companies endpoint to filter by one or more tags assigned to your companies. The tags
query parameter supports the following operators, using Codat’s query language:
- Equals (
=
) - Not equals (
!=
) - Contains (
~
)
Here is a query example that returns a specific company by a customer ID:
- TypeScript
- Python
- C#
- Go
- Java
const result = await platformClient.companies.list({
tags:`uid=${customerId}`,
});
res = platform_client.companies.list(operations.ListCompaniesRequest(
tags=f'uid={customerId}'
))
var res = await platformClient.Companies.ListAsync(new() {
Tags = $"uid={customerId}",
});
ctx := context.Background()
res, err := platformClient.Companies.List(ctx, operations.ListCompaniesRequest{
Tags: platform.String(fmt.Sprintf("uid=%d", customerId)),
})
ListCompaniesRequest req = ListCompaniesRequest.builder()
.tags(String.format("uid=%d", customerId))
.build();
ListCompaniesResponse res = platformClient.companies().list()
.request(req)
.call();
Who is this relevant for?
This feature is ideal for anyone looking to find companies based on their customer ID or to access a group of companies categorized by the products or services you provide.
How to get started?
- Enrich company records with tags using the Create company or Update company endpoints. See Add metadata to a company.
- Filter companies using the
tags
query parameter on the List companies endpoint. See Filter companies by metadata.