# Payroll API Endpoint error

**URL:** <https://api-discuss.freeagent.com/t/payroll-api-endpoint-error/3173>\
**Category:** Uncategorized\
**Created:** [7 February 2023 12:45 UTC](https://api-discuss.freeagent.com/t/payroll-api-endpoint-error/3173 "2023-02-07T12:45:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xhan](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/x/50afbb/32.png) [@xhan](https://api-discuss.freeagent.com/u/xhan)\
**Post date:** [7 February 2023 12:45 UTC](https://api-discuss.freeagent.com/t/payroll-api-endpoint-error/3173/1 "2023-02-07T12:45:43Z")

</div>

Hi everyone,

I’m trying to access the payroll api endpoint:

[https://api.freeagent.com/v2/payroll\:year](https://api.freeagent.com/v2/payroll%5C:year)

which I get an empty JSON response.

If I try: [https://api.freeagent.com/v2/payroll/:year/:period](https://api.freeagent.com/v2/payroll/:year/:period), I get a “Resource not found” error message.

My user access is Level 8 and when I download the backup from within FreeAgent, the large spreadsheet has the “Payslips” sheet with all the data.

Please can you help.

Thanks!

---

<div class="post-metadata">

**Author:** ![Katie\_FA](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/katie_fa/32/399_2.png) [@Katie\_FA](https://api-discuss.freeagent.com/u/Katie_FA)\
**Post date:** [14 February 2023 15:12 UTC](https://api-discuss.freeagent.com/t/payroll-api-endpoint-error/3173/2 "2023-02-14T15:12:09Z")

</div>

Hi xhan,

Thank you for your post! Hopefully I can help you out here.

For this URL, you need to replace `:year` with the year you would like to query, e.g. [https://api.freeagent.com/v2/payroll/2022](https://api.freeagent.com/v2/payroll%5C:year), and for the second query, you need to replace both `:year` and `:period`, for example if you want details of the first payroll period in the year 2022, you would use the URL [https://api.freeagent.com/v2/payroll/2022/0](https://api.freeagent.com/v2/payroll/2022/0)

I hope this helps!

Kind regards,  
Katie
