# Get a Job results in 400

**URL:** <https://community.auth0.com/t/get-a-job-results-in-400/186453>\
**Category:** Get Help\
**Tags:** user-import-export, user-management\
**Created:** [May 7, 2025, 8:06pm UTC](https://community.auth0.com/t/get-a-job-results-in-400/186453 "2025-05-07T20:06:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ballop](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ballop/32/60368_2.png) [@ballop](https://community.auth0.com/u/ballop)\
**Post date:** [May 7, 2025, 8:06pm UTC](https://community.auth0.com/t/get-a-job-results-in-400/186453/1 "2025-05-07T20:06:03Z")

</div>

I’m running a powershell script that uses the users-import job and then checks that job to see when it’s completed.

The users-import works fine, but when I invoke a rest GET call to ‘get a job’, I get an error:

```auto
statusCode: 400
message: Path validation error: \u0027String does not match pattern ^job_[A-Za-z0-9]{16}$: 7\u0027 on property id (ID of the job).
errorCode: invalid_uri

```

The command I’m using is Invoke-RestMethod -Method Get -Uri $request -Headers $headers

The URI I’m using is https://{tenantDomain}/api/v2/jobs/{#}  
The Headers I’m using include the authorization:bearer token & accept:application/json

I’ve tried explicitly casting the # as an integer, but I get the same results.

I’m using this KB for reference and the URI isn’t overly complicated so I’m guessing I’m missing something else: docs/api/management/v2/jobs/get-jobs-by-id

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [May 8, 2025, 6:37pm UTC](https://community.auth0.com/t/get-a-job-results-in-400/186453/3 "2025-05-08T18:37:08Z")

</div>

Hi @ballop

Welcome to the Auth0 Community!

From the error that you are receiving, it appears that you are passing the wrong `job_id`.  
As mentioned in the documentation, the URL to retrieve a job would be `https://{{auth0_domain}}/api/v2/jobs/{{job_id}}`.

May I ask why are you trying to cast the id as an integer? What is the exact job id that you are passing to the request? A usual job\_id would look something like this:

`job_132rCLeL6ap6Cb87`

Could you also try the cURL command and let me know if it works fine or not?

```auto
curl -L 'https://{{auth0_domain}}/api/v2/jobs/{{job_id}}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{management_api_token}}'

```

Let me know if you have any other questions.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![ballop](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ballop/32/60368_2.png) [@ballop](https://community.auth0.com/u/ballop)\
**Post date:** [May 8, 2025, 7:16pm UTC](https://community.auth0.com/t/get-a-job-results-in-400/186453/4 "2025-05-08T19:16:49Z")

</div>

That helped a ton, Nik thank you!!  
It looks like my problem started with the users-import request. I threw the request into a variable, and the ID it came back with was a single digit, which is also why I attempted to cast it explicitly as an Integer. With the example you provided, I see where that’s in the Body of the response via Auth0 Logs, and so I’ll have to adjust my response variable to make sure I’m getting the full job string instead, and that should fix my issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 22, 2025, 7:16pm UTC](https://community.auth0.com/t/get-a-job-results-in-400/186453/5 "2025-05-22T19:16:58Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
