- Retrieve Dimension Values from the AS for each selected Dimension
- Retrieve all Tags (active and archived) from Pleo for each Tag Group
- Create, unarchive, update, or archive Tags as needed
- Resolve duplicate Tags when multiple Tags share the same code
Prerequisites
Before you begin:- You’re familiar with the Tags Sync Overview and the Integration Design for Syncing Tags
- Your integration is authenticated using one of the supported authentication methods
- Your integration can call Pleo’s Tags API endpoints
- Tag Groups have been synchronised with Dimensions
Scenario
This how-to continues from How to Sync Tag Groups with Accounting Dimensions. The four active Tag Groups from that step (Department, Project, Finance, and Cost Centre) are the input for this sync. This how-to uses the Department Tag Group to illustrate each step. The table below shows the starting state for the Department Tag Group before this sync runs.| Tag (Pleo) | Pleo Status | Dimension Value (AS) | AS Status |
|---|---|---|---|
| Engineering | Active | Engineering (ENG) | Active |
| Marketing | Archived | Marketing (MKT) | Active |
| Sales | Active | — | Does not exist |
| — | — | Operations (OPS) | Active |
Steps
1. Iterate Over Each Selected Tag Group
For each active Tag Group in Pleo (corresponding to a selected Dimension), perform the following steps. Example Pseudo:Example Result
| Tag Group | Pleo Status | Process Tags? |
|---|---|---|
| Department | Active | ✓ Yes |
| Project | Active | ✓ Yes |
| Finance | Active | ✓ Yes |
| Cost Centre | Active | ✓ Yes |
2. Retrieve Dimension Values from the Accounting System
For the current Tag Group, fetch the Dimension Values from the AS for the matching Dimension. Include all values: active, archived, blocked, expired, or deactivated. The sync logic determines what to do with each. Example Pseudo:Example Response
The response format depends on your Accounting System. The following is a representative example for the Department Dimension:Example Result
| Dimension Value | AS Status | Include in Sync? |
|---|---|---|
| Engineering (ENG) | Active | ✓ Yes |
| Marketing (MKT) | Active | ✓ Yes |
| Operations (OPS) | Active | ✓ Yes |
3. Retrieve All Tags from Pleo for the Tag Group
API Endpoint: GET/v0/tag-groups/{groupId}/tags
Example parameters: groupId: 768fb809-b282-4411-875a-406f8e4c5bdb, includeArchived: true
Fetch both active and archived Tags for the current Tag Group. Including archived Tags allows unarchiving rather than creating duplicates.
Example Pseudo:
Example Request
- OAuth 2.0
- API Key
Example Response
Example Result
| Tag | Pleo Status |
|---|---|
| Engineering (ENG) | Active |
| Marketing (MKT) | Archived |
| Sales (Sales) | Active |
What it looks like in Pleo Web App


4. Resolve Duplicate Tags
Before matching, detect and resolve any Tags in Pleo that share the same code. If multiple Tags share the same code:- Retain the Tag whose name matches the current AS Dimension Value name (case-insensitive)
- If no name match, retain one Tag chosen at random (using the most recently created Tag as a tiebreaker is a reasonable approach)
- Archive all other duplicates
Example Result
No duplicate Tags detected for the Department Tag Group. No action required.5. Match Dimension Values to Tags by Code
For each active Dimension Value from the AS, attempt to find a matching Tag in Pleo using code (case-insensitive). Example Pseudo:Example Result
| Dimension Value (AS) | Tag (Pleo) | Pleo Status | Action |
|---|---|---|---|
| Engineering (ENG) | Engineering (ENG) | Active | No action |
| Marketing (MKT) | Marketing (MKT) | Archived | → Step 7: Unarchive |
| Operations (OPS) | — | Does not exist | → Step 6: Create |
| — | Sales (Sales) | Active | → Step 8: Archive |
6. Create Tags for New Dimension Values
API Endpoint: POST/v0/tag-groups/{groupId}/tags
Example parameters: groupId: 768fb809-b282-4411-875a-406f8e4c5bdb
If an AS Dimension Value is active but no matching Pleo Tag exists, create a new Tag within the Tag Group.
Example Pseudo:
Example Request
- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App

7. Unarchive or Update Existing Tags
API Endpoint: PUT/v0/tags/{tagId}
Example parameters: tagId: 8fef04fe-0fe5-44ef-b863-a6fa93fdcfc4
If a matching Tag is found:
- AS Dimension Value is active, Pleo Tag is archived → Unarchive the Tag by setting
archived: falseand update the name if changed - AS Dimension Value is active, Pleo Tag name differs → Update the Tag name to match the AS
- AS Dimension Value is active, Pleo Tag name matches → No action required
Example Request
- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App


8. Archive Tags with No Matching Active Dimension Value
API Endpoint: PUT/v0/tags/{tagId}
For any active Tag that does not match an active Dimension Value (because the Dimension Value is absent, deleted, blocked, expired, or deactivated in the AS), archive it.
Do not delete Tags. Archiving is non-destructive and reversible.
Example Pseudo:
Example Request
- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App


Result
The table below recaps what happened to each Tag across all steps for the Department Tag Group.| Tag | Step 2 (AS Dimension Value) | Step 3 (Pleo State) | Step 5 (Match) | Action |
|---|---|---|---|---|
| Engineering | Active (ENG) | Active | Matched (active) | No action |
| Marketing | Active (MKT) | Archived | Matched (archived) | Unarchived (Step 7) |
| Operations | Active (OPS) | Does not exist | No match | Created (Step 6) |
| Sales | — | Active | No match | Archived (Step 8) |
| Tag | Final State in Pleo | AS Dimension Value | Aligned with AS? |
|---|---|---|---|
| Engineering | Active | Active | ✓ Yes |
| Marketing | Active | Active | ✓ Yes |
| Operations | Active | Active | ✓ Yes |
| Sales | Archived | — | ✓ Yes |
What Comes Next?
this how-to is part of:
Related Reading
- Sync Tags with Dimension Values
- Data Mapping
- Sync Periodicity and Scheduling
- Platform Capabilities — Tags Sync