Skip to main content
The users client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
A user is a member of an Arize account. The Get method accepts either a user ID or an email address — emails are resolved via the users list endpoint (case-insensitive exact match). All other methods (Update, Delete, ResendInvitation, ResetPassword) take strict user IDs. Build role assignments for Create with AssignPredefinedRole (one of the UserRole* values) or AssignCustomRole (an existing custom role ID — see Roles).

List Users

List returns a paginated list of account users. Defaults to a page size of 50. Email, when non-empty, applies a case-insensitive substring filter. Status, when non-empty, filters by account status (any of UserStatusActive, UserStatusInvited, UserStatusExpired). Signature:
func (c *Client) List(ctx context.Context, req ListRequest) (*UserList, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    resp, err := client.Users.List(context.Background(), users.ListRequest{
        Status: []users.UserStatus{users.UserStatusActive},
        Limit:  25,
    })
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, u := range resp.Users {
        fmt.Printf("%s: %s (%s)\n", u.Id, u.Email, u.Status)
    }
}

Get a User

Get returns a single user. User accepts either a user ID or an email address; an email is resolved to an ID via the users list endpoint (case-insensitive exact match), and a non-matching email yields a *arize.NotFoundError. Signature:
func (c *Client) Get(ctx context.Context, req GetRequest) (*User, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    u, err := client.Users.Get(
        context.Background(),
        users.GetRequest{User: "user@example.com"},
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("user not found: %v", notFound)
        }
        log.Fatal(err)
    }

    fmt.Printf("user %s: %s (%s)\n", u.Id, u.Email, u.Status)
}

Create a User

Create creates a new account user and returns it. Build the Role with AssignPredefinedRole (one of the UserRole* values) or AssignCustomRole (a custom role ID). InviteMode controls whether and how an invitation is sent (InviteModeNone, InviteModeEmailLink, or InviteModeTemporaryPassword). When InviteMode is not InviteModeNone, the request is idempotent on Email — re-creating a user with the same email returns the existing user. Signature:
func (c *Client) Create(ctx context.Context, req CreateRequest) (*User, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    u, err := client.Users.Create(
        context.Background(),
        users.CreateRequest{
            Name:       "Ada Lovelace",
            Email:      "ada@example.com",
            Role:       users.AssignPredefinedRole(users.UserRoleMember),
            InviteMode: users.InviteModeEmailLink,
        },
    )
    if err != nil {
        var badRequest *arize.BadRequestError
        if errors.As(err, &badRequest) {
            log.Fatalf("invalid request: %v", badRequest)
        }
        log.Fatal(err)
    }

    fmt.Printf("created user %s (%s)\n", u.Id, u.Email)
}

Update a User

Update updates a user’s display name and/or developer permission by ID. Name and IsDeveloper are pointers — nil preserves the existing value. At least one of Name or IsDeveloper must be non-nil; otherwise the call returns an error without contacting the server. Signature:
func (c *Client) Update(ctx context.Context, req UpdateRequest) (*User, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    newName := "Ada Lovelace (renamed)"
    u, err := client.Users.Update(
        context.Background(),
        users.UpdateRequest{
            UserID: "your-user-id",
            Name:   &newName,
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("user not found: %v", notFound)
        }
        log.Fatal(err)
    }

    fmt.Printf("updated user %s: %s\n", u.Id, u.Name)
}

Delete a User

Delete soft-deletes a user by ID. Cascades to organization and space memberships, API keys, and role bindings. Idempotent: deleting an already-inactive user succeeds. It returns only an error. Signature:
func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
Usage Example:
package main

import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    err = client.Users.Delete(
        context.Background(),
        users.DeleteRequest{UserID: "your-user-id"},
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Printf("no user to remove: %v", notFound)
            return
        }
        log.Fatal(err)
    }
}

Resend Invitation

ResendInvitation resends the invitation email for a pending (invited) user. The target user must be in the UserStatusInvited state. It returns only an error. Signature:
func (c *Client) ResendInvitation(ctx context.Context, req ResendInvitationRequest) error
Usage Example:
package main

import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    err = client.Users.ResendInvitation(
        context.Background(),
        users.ResendInvitationRequest{UserID: "your-user-id"},
    )
    if err != nil {
        var badRequest *arize.BadRequestError
        if errors.As(err, &badRequest) {
            log.Fatalf("user is not in invited state: %v", badRequest)
        }
        log.Fatal(err)
    }
}

Reset Password

ResetPassword triggers a password-reset email for a user. The user must authenticate via password (not SSO/SAML) and must have verified their account. It returns only an error. Signature:
func (c *Client) ResetPassword(ctx context.Context, req ResetPasswordRequest) error
Usage Example:
package main

import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    err = client.Users.ResetPassword(
        context.Background(),
        users.ResetPasswordRequest{UserID: "your-user-id"},
    )
    if err != nil {
        var badRequest *arize.BadRequestError
        if errors.As(err, &badRequest) {
            log.Fatalf("password reset not allowed: %v", badRequest)
        }
        log.Fatal(err)
    }
}

Bulk Delete Users

BulkDelete deletes users by ID and/or email. At least one of UserIDs or Emails must be provided. Each email is resolved to a user ID client-side via the users list endpoint (case-insensitive exact match); an unresolved email is recorded as DeletionStatusNotFound rather than aborting the batch. Each deletion’s outcome is returned as a BulkUserDeletionResult — per-user failures are recorded as DeletionStatusFailed and do not abort the batch. Signature:
func (c *Client) BulkDelete(
    ctx context.Context,
    req BulkDeleteRequest,
) ([]BulkUserDeletionResult, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/users"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    results, err := client.Users.BulkDelete(
        context.Background(),
        users.BulkDeleteRequest{
            UserIDs: []string{"user-id-1"},
            Emails:  []string{"ada@example.com", "missing@example.com"},
        },
    )
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, r := range results {
        switch r.Status {
        case users.DeletionStatusDeleted:
            fmt.Printf("deleted %s (%s)\n", r.UserID, r.Email)
        case users.DeletionStatusNotFound:
            fmt.Printf("not found: %s\n", r.Email)
        case users.DeletionStatusFailed:
            fmt.Printf("failed %s: %s\n", r.UserID, r.Error)
        }
    }
}