Call management API from Flows

Hi,
I have a scenario where i need to render a form from a custom action.

I could not find anything on the “Custom API Request” " flow action".

within this form i have a step that asks the user for an email.
my goal is to use this email to call the management API to find the user by email and return the provided userid to the onContinuePostLogin method on the new action.

My issue here is:
when i Try to use “Custom API Request” action on the flow I’m getting a bad request response.
on my flow I:
add another step and select “Custom API request”
on the custom API request configrations i set:

  1. the vault connection do my connection ( this one works bc i can use it in other specific flow actions such as GetUser).
  2. path to /api/v2/users-by-email
  3. Method: GET
  4. URL Params:
    • email - the field variable

Here is the input from the executions :

{
  "connectionId": "ac_********Wbp",
  "pathname": "/api/v2/users-by-email",
  "method": "GET",
  "headers": {},
  "params": {
    "email": "*****@****"
  },
  "payload": null
}

and this is the response i get:

{
  "headers": {
    "date": "Fri, 17 Jan 2025 12:26:06 GMT",
    "content-type": "application/json; charset=utf-8",
    "content-length": "***",
    "connection": "keep-alive",
    "cf-ray": "******",
    "cf-cache-status": "DYNAMIC",
    "cache-control": "no-cache",
    "strict-transport-security": "max-age=31536000; includeSubDomains",
    "vary": "origin",
    "access-control-expose-headers": "WWW-Authenticate,Server-Authorization",
    "x-auth0-l": "******",
    "x-content-type-options": "nosniff",
    "server": "cloudflare",
    "alt-svc": "h3=\":443\"; ma=86400"
  },
  "status": 400,
  "body": {
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Query validation error: 'Missing required property: email'.",
    "errorCode": "invalid_query_string"
  },
  "success": false
}

Am i missing something here?
Thanks in advance

Hi @lafayette.duarte,

Welcome to the Auth0 Community!

Can you kindly show how your custom api flow is configured?

Bad request error messages on this endpoint suggest that the request is malformed somehow. Seeing your custom api flow will be helpful in troubleshooting!

Thanks,

Mary Beth

1 Like

Hi Mary Beth
currently i am unable to upload images OR links on the original post or on this reply.

Is there any other way to get the link to you?

Thank you