# What is the options(client\_id,secret) to send to make an api call, in action after post login (onExecutePostLogin)?

**URL:** <https://community.auth0.com/t/what-is-the-options-client-id-secret-to-send-to-make-an-api-call-in-action-after-post-login-onexecutepostlogin/99794>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [February 6, 2023, 1:26pm UTC](https://community.auth0.com/t/what-is-the-options-client-id-secret-to-send-to-make-an-api-call-in-action-after-post-login-onexecutepostlogin/99794 "2023-02-06T13:26:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Neos](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/neos/32/34386_2.png) [@Neos](https://community.auth0.com/u/Neos)\
**Post date:** [February 6, 2023, 11:07pm UTC](https://community.auth0.com/t/what-is-the-options-client-id-secret-to-send-to-make-an-api-call-in-action-after-post-login-onexecutepostlogin/99794/4 "2023-02-06T23:07:30Z")

</div>

Thanks for your answer and the explanation for the event.secrets.  
I will try to be more clear of what i am trying to achieve.

I am using already machine to machine api for backend in nestJs and spa application for frontend. I am able to call from my frontend a protected url of the backend (nestJs).

My goal now is when the user sign up first time. In the action in postLogin, i want to send the userId generated from auth0 to to my api in backend which will add this user in my own database.  
So my objective, is to call an api from auth0 to my nest js backend which is for example the following one.  
This is the api that i expose in my backend, my frontend is able to call this api, but i need to call it from auth0 during the sing up, to send him the userId.  
@UseGuards(AuthGuard(‘jwt’))  
@Post(‘addiuser’)  
async insertUserId(  
@Body(‘userId’) userId: string,  
) {  
// code which add here this id to my database  
}  
1)I read the example [https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) but it is to use ManagementClient to assign the roles right. Can i use the managementClient to call my external api (/adduser)?

2)I was thinking that this tutorial is what i am trying to do but on this tutorial i don’t see where you are adding the client\_id, client\_secret or the domain to generate a token access which i should attach to the api (/adduser) that i am going to call right ?  
[https://community.auth0.com/t/how-do-i-make-an-axios-api-call-and-store-it-as-a-custom-claim-using-actions/84491](https://community.auth0.com/t/how-do-i-make-an-axios-api-call-and-store-it-as-a-custom-claim-using-actions/84491)

3)Or should i proceed from the example which is here ?

> [@How do I call my API from an Action?](https://community.auth0.com/t/how-do-i-call-my-api-from-an-action/69041):
>
> Hey, So I’m in the process of trying to add a user to my database using an API call from a “Post User Registration” Action. I have followed this blog post here: and seem to have everything looking good. On top of that when I run the test it says the action was successful. The only problem is that my API is not being called at all even though I have triple checked that the URL is correct. Here is the code I’m working with: import axios from "axios"; exports.onExecutePostUserRegistration = …

I was trying the third, please let me know if i am on the wrong way ?  
So i want to call from auth0 during the sing up, in post login, a endpoint that i created in my backend. To be able to call this endpoint i would need to attach the baerer token right ?

---

_[View the full topic](https://community.auth0.com/t/what-is-the-options-client-id-secret-to-send-to-make-an-api-call-in-action-after-post-login-onexecutepostlogin/99794)._
