GET
/
users
/
{id}
JavaScript
import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: 'My API Key',
});

const user = await client.users.retrieve('usr_01j9dwavghe1ttppewekjjkfrx');

console.log(user.id);
{
  "first_name": "Brian",
  "id": "usr_01j9dwavghe1ttppewekjjkfrx",
  "last_name": "O'Conner",
  "metadata": {
    "email": "boconner@toretti.family",
    "user_id": 1234
  },
  "photo_url": "https://toretti.family/people/brian.jpg"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The ID of the user to retrieve.

Example:

"usr_01j9dwavghe1ttppewekjjkfrx"

Response

User

A user of the app

first_name
string
required

The user's first name.

id
string

Unique identifier for the object.

last_name
string

The user's last name.

metadata
object

Set of key-value pairs that will be stored with the object.

photo_url
string<uri>

URL of a photo to be used as the user's avatar.