---
title: Connecting AFAS for leave
description: "Connect AFAS Profit to Teamlead: fetch employees, leave types and leave balances, and send approved leave to AFAS."
---

[Skip to content](https://kennisbank.teamlead.io/en/connecting-afas-for-leave#main-content)

- [English](https://kennisbank.teamlead.io/en/connecting-afas-for-leave)
- [Nederlands](https://kennisbank.teamlead.io/nl/afas-koppelen-voor-verlof)

English

Show submenu for translations

![Teamlead](https://kennisbank.teamlead.io/hs-fs/hubfs/main-logo-horizontal-png-dark.png?width=176&height=32&name=main-logo-horizontal-png-dark.png)

Open main navigation

Close main navigation

- - [English](https://kennisbank.teamlead.io/en/connecting-afas-for-leave)
    - [Nederlands](https://kennisbank.teamlead.io/nl/afas-koppelen-voor-verlof)

  English
  
  Show submenu for translations
- [Tickets](https://servicedesk.teamlead.nl/tickets)

[Tickets](https://servicedesk.teamlead.nl/tickets?hsLang=en)

 Hi. How can we help you?

- There are no suggestions because the search field is empty.

1. [Teamlead Knowledge Base](https://kennisbank.teamlead.io/en?hsLang=en)
2. [Connections](https://kennisbank.teamlead.io/en/connections?hsLang=en)

# Connecting AFAS for leave

## Connect AFAS Profit to Teamlead: fetch employees, leave types and leave balances, and send approved leave to AFAS.

With the AFAS connection, planners see the current leave balance from AFAS. Approved leave goes from Teamlead to AFAS, so nobody has to enter it twice.

### What does the connection do?

| Data | Direction |
| --- | --- |
| Employees and employments | From AFAS to Teamlead, linked by email address |
| Leave types | From AFAS to Teamlead |
| Leave balances | Read live from AFAS, visible on the employee's profile |
| Approved leave | From Teamlead to AFAS, via flow A or B |

### Flow A or flow B?

For each AFAS connection, you choose under **Leave flow** how leave goes to AFAS.

|  | Flow A: **Book directly** | Flow B: **Via approval workflow** |
| --- | --- | --- |
| What Teamlead does | Books the leave directly as an absence in AFAS | Creates a dossier item in AFAS that goes through the AFAS workflow |
| Who reviews | The planner in Teamlead | The planner in Teamlead, then the manager in AFAS (InSite or Pocket) |
| Status in Teamlead | **Synced with AFAS** | **Awaiting approval in AFAS** |
| Withdrawing leave from Teamlead | Yes, Teamlead removes the booking from AFAS | No, you reject or withdraw it in AFAS |
| UpdateConnectors in AFAS | HrAbsence (booking) and HrAbsenceID (deleting) | KnSubject (dossier item) |
| Work in AFAS | About half an hour | An extra half day for the dossier item and workflow |

### What does the AFAS administrator do?

1. In the **Authorisation tool**, create a system user for Teamlead and a user group. Add the system user and the administrator to that group. Check the read permissions on employees and leave data.
2. Create an **App connector** (for example with the description Teamlead) and link the user group.
3. Link the GetConnectors from the table below.
4. Link the UpdateConnectors of the chosen flow.
5. Untick **Blocked** when everything is ready.
6. Create an API token via **User tokens** \> **New**. AFAS shows the token only once.
7. Flow B only: create a dossier item type (for example "Teamlead leave request") with the destination Employee and four free fields: start date, end date, hours and leave type. Give the user group the right to add dossier items of this type. Set up a workflow in which the manager reviews the request and HR administration books the leave.

| GetConnector | Key fields |
| --- | --- |
| Employees in service | Employee ID, name, employment, work email, optionally the start and end date of employment |
| Leave types | Type, code, base leave type, optionally valid until |
| Leave balance | Among others financial year, period entitlement, opening balance, taken, balance and corrections |

The full steps with screenshots are in the AFAS implementation guide. Request it via support@teamlead.io.

### What do you supply to Teamlead?

If Teamlead sets up the connection together with you, supply:

- the API token, always through a secure channel and never in a regular email or ticket;
- the environment number (the number in your AFAS address) and the type of environment: production, test or acceptance;
- confirmation that the GetConnectors are linked and published and that the App connector is no longer blocked;
- the chosen flow and the matching UpdateConnectors;
- for flow B, also the number of the dossier item type and the field codes of the free fields.

### Setting it up yourself in Teamlead

An administrator can also set up the connection themselves. Teamlead helps you with this.

1. Go to **Settings** \> **Connections** and click **AFAS**.
2. Under **Connection**, enter the **AFAS member number**. This is the environment number from your AFAS address. Then choose the **Environment** and enter the **AFAS token**.
3. Under **Usage**, set the connection to **Active**. Tick the **Locations** and choose the **Leave flow** and the **Leave balance unit**.
4. Fill in the connectors and field names as they are named in AFAS, in the **Employee sync**, **Leave types** and **Leave balances** blocks. For flow A, also fill in **Leave booking** and **Leave deletion**. For flow B, fill in the **Dossier item type** and the field codes of the free fields under **Leave request**.
5. Click **Create**.
6. Test each part in the **Test the connection** block with the **Run test** button. You see **That worked** or **That did not work**.
7. After the first synchronisation, check the **Linked employees** and **AFAS leave types** tables.

![The AFAS connection page with the Connection and Usage blocks](https://kennisbank.teamlead.io/hubfs/kennisbank/afas-en.png?v=20261020f)

### Good to know

- AFAS does not create employees in Teamlead. Add new employees to Teamlead first. The email address in AFAS must be exactly the same as the one in Teamlead.
- Employees and leave types are synchronised regularly, not immediately after saving.
- AFAS gives time in minutes by default (2400 is 40 hours). If the balance shows strange numbers, check the **Leave balance unit**.
- Too many leave types in the drop-down list? In **AFAS leave types**, set them to **Hide** under **Visibility**.
- When handling a leave request, you choose the AFAS leave type in the **Configure AFAS** step.
- With flow A, AFAS calculates the duration based on the period and the work pattern. The balance in AFAS can take up to about 15 minutes to update.
- The **Booking** test deliberately sends an empty booking that AFAS rejects. You then see a failed call in AFAS. This is normal; nothing is booked.
- First test with a separate connection on an AFAS test environment. Use a separate token for production.
- An AFAS token can have an end date. Has your token expired, or do you no longer trust it? Create a new token in AFAS and enter it under **AFAS token**, or supply it to Teamlead through a secure channel.
- With flow B, AFAS does not report back whether the manager approves or rejects the leave. The status stays **Awaiting approval in AFAS**. The leave does appear in the schedule straight away. The balance only changes once the leave has been booked in AFAS.
- Does the manager reject the request in flow B? Then delete the request in Teamlead, so the schedule is correct. The dossier item is listed under **Will stay in AFAS**. Switch on **I will remove these records from AFAS myself** and click **Delete**.
- Only change the **AFAS handling status** manually if you are sure the leave is in AFAS.
- Leave that has already started can no longer be deleted.
- Does your AFAS use an IP restriction on the App connector? Request the IP addresses from support@teamlead.io.

### Not working?

| Problem | Cause and solution |
| --- | --- |
| A request does not reach AFAS (**AFAS synchronisation failed**) | The cause is usually in AFAS: not enough leave balance (for example "the number of hours in the leave booking exceeds the leave balance"), the leave budget for next year has not been created yet, the employee appears twice in AFAS, or the employee is not in the right group. Check the message under **AFAS synchronisations** on the request. Support can look up the error message from AFAS for you. |
| No AFAS data or no balance for an employee | Check that the employee is in the right group in AFAS, does not appear twice and has the same email address in both systems. Look in **Linked employees**. |
| **AFAS does not allow this action. Contact your AFAS administrator.** | The connector has not been published or authorised. The AFAS administrator links the UpdateConnector (for example HrAbsenceID for deleting) to the App connector and gives the user group permissions. |
| **The period falls outside the employment** (followed by the start or end date) | The leave falls (partly) outside the employment in AFAS. Check the leave period and the start and end date of the employment in AFAS. |
| **This booking was made before AFAS booking numbers were recorded, so it can only be removed in AFAS itself.** | Delete the booking in AFAS. |
| **AFAS could not be reached. Try again later.** | Try again later. |

### See also

- [Overview: which connections are available?](https://kennisbank.teamlead.io/en/overview-which-connections-are-available?hsLang=en)
- [Reviewing and processing leave requests](https://kennisbank.teamlead.io/en/reviewing-and-processing-leave-requests?hsLang=en)
- [Viewing and adjusting leave balances](https://kennisbank.teamlead.io/en/viewing-and-adjusting-leave-balances?hsLang=en)
- [A leave request does not reach AFAS](https://kennisbank.teamlead.io/en/a-leave-request-does-not-reach-afas?hsLang=en)

- [Get started](https://kennisbank.teamlead.io/en/get-started?hsLang=en)
- [For employees](https://kennisbank.teamlead.io/en/for-employees?hsLang=en)
- [For planners and team leads](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#main-content)

    - [Schedule](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#schedule)
    - [Shift templates and automatic scheduling](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#shift-templates-and-automatic-scheduling)
    - [Leave](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#leave)
    - [Staffing and forecast](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#staffing-and-forecast)
    - [Adherence and statistics](https://kennisbank.teamlead.io/en/for-planners-and-team-leads?hsLang=en#adherence-and-statistics)
- [For administrators](https://kennisbank.teamlead.io/en/for-administrators?hsLang=en)
- [Connections](https://kennisbank.teamlead.io/en/connections?hsLang=en)
- [Frequently asked questions](https://kennisbank.teamlead.io/en/frequently-asked-questions?hsLang=en)

[![](https://kennisbank.teamlead.io/hs-fs/hubfs/Teamlead-logo.png?width=500&height=105&name=Teamlead-logo.png)](http://teamlead.io)

[Website](https://teamlead.io)[Create a ticket](https://servicedesk.teamlead.nl/tickets?hsLang=en)© 2026 Teamlead