# API Service Accounts vs API User accounts

**URL:** <https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641>\
**Category:** Development\
**Created:** [November 16, 2021, 8:52pm UTC](https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641 "2021-11-16T20:52:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IMACS-Iain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imacs-iain/32/6223_2.png) [@IMACS-Iain](https://forum.mautic.org/u/IMACS-Iain)\
**Post date:** [November 16, 2021, 8:52pm UTC](https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641/1 "2021-11-16T20:52:48Z")

</div>

We have connection via OAuth2 to the mautic API, but interactions often require a user login … in other words we are using a user account to make our API calls.

Other APIs that we use (Zoom, mailgun and rackspace for example) provide service accounts that allow server-to-server API calls without having to login as a user.

Are these service-level accounts available with the mautic API? We have been unable to find any reference to such things.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 17, 2021, 5:53am UTC](https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641/2 "2021-11-17T05:53:33Z")

</div>

Hi,  
In Mautic you can create a user with login and password, which can be used for ‘basic authentication’ while using API calls.  
Docs:  
[https://developer.mautic.org/#basic-authentication](https://developer.mautic.org/#basic-authentication)

After enabling API access in your config make sure you clear the cache.

Joey

---

<div class="post-metadata">

**Author:** ![IMACS-Iain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imacs-iain/32/6223_2.png) [@IMACS-Iain](https://forum.mautic.org/u/IMACS-Iain)\
**Post date:** [November 18, 2021, 2:01pm UTC](https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641/3 "2021-11-18T14:01:12Z")

</div>

Thanks Joey. We have a API user account using OAuth2 which we have been using for several weeks and which allows up to periodically update the mautic contacts database with external data. However, each time this occurs it is necessary for operator to log in to mautic.

What we need is a real time API connections so the mautic data can be synchronized with out external data. This is typically referred to as a “system API account” as opposed to a “user API account”.

Given that forum and google searches reveal no references to service accounts, I think we have to assume they do not currently exist. Should we may a request on the development section of the forum?

Your suggestions much appreciated, thank you, Iain.

---

<div class="post-metadata">

**Author:** ![IMACS-Iain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imacs-iain/32/6223_2.png) [@IMACS-Iain](https://forum.mautic.org/u/IMACS-Iain)\
**Post date:** [November 24, 2021, 4:23pm UTC](https://forum.mautic.org/t/api-service-accounts-vs-api-user-accounts/21641/4 "2021-11-24T16:23:46Z")

</div>

My misread… use Basic Authentication, thank you. It appears that the OAuth2 token expiration period can be extended significantly in the API configuration page, so we will experiment with that first. Thank you.
