Relate Teamleader V1 with V2 rows (Teamleader Focus)

This article explains how to relate the numeric IDs of V1 with hexadecimal IDs of V2 tables of Teamleader.


Teamleader Focus has introduced with the V2 API a new concept of referential keys, moving from integers to GUIDs. However, the individual rows in V1 nor in V2 contain the key values of the other version.

For instance, the following query will return numeric IDs:

select id

The following query will present you the GUID of the same deals in the V2 tables:

from del
join   Teamleader.V2.MigrateId('deal', mge

The migrate ID table function is highly inefficient since it needs one extra native API call per row. However, since the mapping is persistent, the outcome is cached in the HTTP disk cache forever to speed up future mapping retrievals.

The sample can be extended to include both V1 and V2 deal data using:

select id_v1
, id_v2
from delv1
join   Teamleader.V2.MigrateId('deal', mge
join   Teamleader.V2.Deals delv2
on =

The results mapping Teamleader V1 deal IDs to V2 deal IDs resemble:


Available Types for Conversion

The following Teamleader Focus object types are available: account, user, product, contact, company, deal, dealPhase, project, milestone, task, meeting, call, ticket, invoice, creditNote, subscription, and quotation.