Skip to content
  • Auto
  • Light
  • Dark
Get Started

Retrieve

Retrieve
client.users.retrieve(stringuserId, RequestOptionsoptions?): idstringbiounionlinksLinksprofileImageUrlunionurlstringusernameunionUser
get/v1/users/{user_id}

Get basic information about a user

Parameters
userIdstring
formatuuid
Returns
idstringbiounionlinksLinksprofileImageUrlunionurlstringusernameunionUser
import ValTown from '@valtown/sdk';

const client = new ValTown();

const user = await client.users.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(user.id);
200 Example
{
  "id": "00000000-0000-0000-0000-000000000000",
  "bio": "Hello world",
  "links": {
    "self": "https://example.com"
  },
  "profileImageUrl": null,
  "url": "https://val.town/u/tmcw",
  "username": "tmcw"
}