# Mautic API \> Scheduled processes

**URL:** https://forum.mautic.org/t/mautic-api-scheduled-processes/6057
**Category:** Development
**Created:** [April 4, 2016, 3:15pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057 "2016-04-04T15:15:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Melyou](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Melyou](https://forum.mautic.org/u/Melyou)
#### Post date: [April 4, 2016, 3:15pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/1 "2016-04-04T15:15:20Z")

</div>

Dear all,  
  
  
  
We’re using Mautic (for now, for some tests) and we’ve noticed that the API authentication must be done manually (by introducing user credentials in Mautic form) and then the user is redirected to the rollback URL. All this is great when the user is in front of it’s screen but by using this I think we cannot automatically manage leads based on other lead information sources by using a scheduled process.  
  
  
  
Is there any other way to use the API (or any other Mautic feature) to create/update/add to lists leads automatically with a scheduled process and using ‘third-party’ lead information?  
  
  
  
Thank you  
  
  
  
Best Regards,

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [April 6, 2016, 7:23am UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/2 "2016-04-06T07:23:23Z")

</div>

If you authenticate the app, Mautic will return the access token. You can use this token to access API without authentication.

Or there are easier ways to add a new lead to Mautic. Check [https://medium.com/@jan\_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005](https://medium.com/@jan_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005) and [https://www.mautic.org/docs/leads/lead\_monitoring.html](https://www.mautic.org/docs/leads/lead_monitoring.html)

---

<div class="post-metadata">

### Author: ![Melyou](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Melyou](https://forum.mautic.org/u/Melyou)
#### Post date: [April 6, 2016, 12:12pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/3 "2016-04-06T12:12:13Z")

</div>

> [@9344:@escopecz](#):
>
> escopecz

Thank you for your response 🙂

If I didn’t misundertand, we need to save the access token and every time it expires, request a new one by using the refresh token, right? (we’re using OAuth2)

There is any way to make “Refresh token lifetime” unlimited (like zero value “0”) or should we just put a high value in days?

Thank you and keep up the great job!

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [April 6, 2016, 12:15pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/4 "2016-04-06T12:15:53Z")

</div>

I’ve never tested the unlimited option. Please try it and let us know.

---

<div class="post-metadata">

### Author: ![Melyou](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Melyou](https://forum.mautic.org/u/Melyou)
#### Post date: [April 6, 2016, 12:53pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/5 "2016-04-06T12:53:01Z")

</div>

> [@9355:@escopecz](#):
>
> I’ve never tested the unlimited option. Please try it and let us know.

Ok, with value zero “0” on “Refresh token lifetime” settings option, the refresh\_token has no lifetime, it saves the current timestamp epoch (in this case 1459950493) as expires\_at value of Refresh token, so we’ll have to put a high value of days to keep the scheduled process up and running without the need of Reauthotization

Thank you!

---

<div class="post-metadata">

### Author: ![Melyou](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Melyou](https://forum.mautic.org/u/Melyou)
#### Post date: [April 4, 2016, 3:15pm UTC](https://forum.mautic.org/t/mautic-api-scheduled-processes/6057/6 "2016-04-04T15:15:20Z")

</div>

Dear all,

We’re using Mautic (for now, for some tests) and we’ve noticed that the API authentication must be done manually (by introducing user credentials in Mautic form) and then the user is redirected to the rollback URL. All this is great when the user is in front of it’s screen but by using this I think we cannot automatically manage leads based on other lead information sources by using a scheduled process.

Is there any other way to use the API (or any other Mautic feature) to create/update/add to lists leads automatically with a scheduled process and using ‘third-party’ lead information?

Thank you

Best Regards,
