Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

List users

client.Admin.Organization.Users.List(ctx, query) (*ConversationCursorPage[OrganizationUser], error)
GET
/organization/users

Lists all of the users in the organization.

List users

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAdminAPIKey("My Admin API Key"),
  )
  page, err := client.Admin.Organization.Users.List(context.TODO(), openai.AdminOrganizationUserListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
Response example
{
    "object": "list",
    "data": [
        {
            "object": "organization.user",
            "id": "user_abc",
            "name": "First Last",
            "email": "user@example.com",
            "role": "owner",
            "added_at": 1711471533
        }
    ],
    "first_id": "user-abc",
    "last_id": "user-xyz",
    "has_more": false
}
Parameters
query AdminOrganizationUserListParams
After param.Field[string]
Optional

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Emails param.Field[[]string]
Optional

Filter by the email address of users.

Limit param.Field[int64]
Optional

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Returns
type OrganizationUser struct{…}

Represents an individual user within an organization.

ID string

The identifier, which can be referenced in API endpoints

AddedAt int64

The Unix timestamp (in seconds) of when the user was added.

formatunixtime
Object OrganizationUser

The object type, which is always organization.user

APIKeyLastUsedAt int64
Optional

The Unix timestamp (in seconds) of the user’s last API key usage.

formatunixtime
Created int64
Optional

The Unix timestamp (in seconds) of when the user was created.

formatunixtime
DeveloperPersona string
Optional

The developer persona metadata for the user.

Email string
Optional

The email address of the user

IsDefault bool
Optional

Whether this is the organization’s default user.

IsScaleTierAuthorizedPurchaser bool
Optional

Whether the user is an authorized purchaser for Scale Tier.

IsScimManaged bool
Optional

Whether the user is managed through SCIM.

IsServiceAccount bool
Optional

Whether the user is a service account.

Name string
Optional

The name of the user

Projects OrganizationUserProjects
Optional

Projects associated with the user, if included.

Role string
Optional

owner or reader

TechnicalLevel string
Optional

The technical level metadata for the user.

User OrganizationUserUser
Optional

Nested user details.

Returns Examples
Response example
{
    "object": "list",
    "data": [
        {
            "object": "organization.user",
            "id": "user_abc",
            "name": "First Last",
            "email": "user@example.com",
            "role": "owner",
            "added_at": 1711471533
        }
    ],
    "first_id": "user-abc",
    "last_id": "user-xyz",
    "has_more": false
}