# How to get User ID of perticular user though API

**URL:** <https://devforum.okta.com/t/how-to-get-user-id-of-perticular-user-though-api/5746>\
**Category:** Questions\
**Created:** [July 23, 2019, 9:56am UTC](https://devforum.okta.com/t/how-to-get-user-id-of-perticular-user-though-api/5746 "2019-07-23T09:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pooja1](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pooja1](https://devforum.okta.com/u/pooja1)\
**Post date:** [July 23, 2019, 9:56am UTC](https://devforum.okta.com/t/how-to-get-user-id-of-perticular-user-though-api/5746/1 "2019-07-23T09:56:37Z")

</div>

How to get User ID of perticular user though API, when I don’t know the ID of particular user.

I tried below code and it is working:

curl -v -X GET   
-H “Accept: application/json”   
-H “Content-Type: application/json”   
-H “Authorization: SSWS ${api\_token}”   
“[https://org.okta.com/api/v1/users/00ub0oNGTSWTBKOLGLNR](https://org.okta.com/api/v1/users/00ub0oNGTSWTBKOLGLNR)”

But what if I don’t know the user\_id (i.e “00ub0oNGTSWTBKOLGLNR”) while hitting the End point

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [July 23, 2019, 11:46pm UTC](https://devforum.okta.com/t/how-to-get-user-id-of-perticular-user-though-api/5746/2 "2019-07-23T23:46:07Z")

</div>

Hi @pooja1

You can do a request to /api/v1/users with either [filter](https://developer.okta.com/docs/reference/api/users/#find-users) or [search](https://developer.okta.com/docs/reference/api/users/#list-users-with-search) in order to list all the users that match a particular query (for example username/login, email, first name, last name).

Here’s a cURL example to search based on username

```auto
curl -X GET \
  'https://org.okta.com/api/v1/users?filter=profile.login%20eq%20%22user@domain.com%22' \
  -H 'Accept: application/json' \
  -H 'Authorization: SSWS <API_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 23, 2024, 7:17pm UTC](https://devforum.okta.com/t/how-to-get-user-id-of-perticular-user-though-api/5746/3 "2024-01-23T19:17:33Z")

</div>

Closed on January 23, 2024, 7:17pm UTC

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