Skip to content
Join our SlackContact usGet started

Get Subject

client.Subjects.Get(ctx, subjectID) (*SubjectResource, error)
get/subjects/{subject_id}

Get Subject

ParametersExpand Collapse
subjectID string
ReturnsExpand Collapse
type SubjectResource struct{…}
ID string

The ID of the subject.

CreatedAt Time

The date and time the subject was created.

formatdate-time
Email string

The email of the subject.

formatemail
ExternalID string

The ID of the subject in your system. You may pass it to the API in place of the subject ID.

Metadata map[string, string]

Additional metadata about the subject. You may use this to store any custom data about the subject.

Name string

The name of the subject. Used for display in the dashboard.

Get Subject
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := lark.NewClient(
    option.WithAPIKey("My API Key"),
  )
  subjectResource, err := client.Subjects.Get(context.TODO(), "subject_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subjectResource.ID)
}
{
  "id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
  "created_at": "2025-11-01T00:00:00Z",
  "email": "john.doe@example.com",
  "external_id": "user_1234567890",
  "metadata": {},
  "name": "John Doe"
}
Returns Examples
{
  "id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
  "created_at": "2025-11-01T00:00:00Z",
  "email": "john.doe@example.com",
  "external_id": "user_1234567890",
  "metadata": {},
  "name": "John Doe"
}