Skip to content
Get started

Get a user by ID

client.Users.Get(ctx, id) (*User, error)
get/users/{id}

Retrieve detailed information about a specific user

ParametersExpand Collapse
id string
ReturnsExpand Collapse
type User struct{…}
ID string

Unique identifier with user_ prefix

CreatedAt Time

Timestamp when the user was created

formatdate-time
Email string

Email address of the user

formatemail
FirstName string

First name of the user

LastName string

Last name of the user

UpdatedAt Time

Timestamp when the user was last updated

formatdate-time
Get a user by ID
package main

import (
  "context"
  "fmt"

  "github.com/withluminary/go-sdk"
  "github.com/withluminary/go-sdk/option"
)

func main() {
  client := withluminary.NewClient(
    option.WithClientID("My Client ID"),
    option.WithClientSecret("My Client Secret"),
  )
  user, err := client.Users.Get(context.TODO(), "id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", user.ID)
}
{
  "id": "user_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "created_at": "2024-01-15T09:30:00Z",
  "email": "jane.doe@example.com",
  "first_name": "Jane",
  "last_name": "Doe",
  "updated_at": "2024-01-20T14:45:00Z"
}
Returns Examples
{
  "id": "user_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "created_at": "2024-01-15T09:30:00Z",
  "email": "jane.doe@example.com",
  "first_name": "Jane",
  "last_name": "Doe",
  "updated_at": "2024-01-20T14:45:00Z"
}