Installation

Install the server-side SDK of your choice by running a command in your terminal, or by using a dependency management tool specific to your project.

# The Go library is hosted on GitHub so you can use this command to import it
# to your Go application.
go get github.com/prove-identity/prove-sdk-server-go

# Ensure you import the SDK in your code like this:
import (
	provesdkservergo "github.com/prove-identity/prove-sdk-server-go"
	"github.com/prove-identity/prove-sdk-server-go/models/components"
)

Authentication

Identity Manager uses OAuth 2.0 client credentials authentication. You’ll need to obtain an access token before making API calls.

// Get environment variables.
clientID := os.Getenv("PROVE_CLIENT_ID")
clientSecret := os.Getenv("PROVE_CLIENT_SECRET")
proveEnv := "uat-us" // Use UAT in US region for testing

// Create client for Prove API.
client := provesdkservergo.New(
  provesdkservergo.WithServer(proveEnv),
  provesdkservergo.WithSecurity(components.Security{
    ClientID:     provesdkservergo.String(clientID),
    ClientSecret: provesdkservergo.String(clientSecret),
  }),
)
Token Expiration

The OAuth token expires after 60 minutes, requiring you to get another token. The SDK handles token refresh automatically.

API Functions

Identity Manager provides eight core functions for comprehensive identity management. Refer to the API reference documentation for detailed information on each endpoint.

Enroll Identity

Enrolls a single identity for monitoring.

rspEnrollIdentity, err := client.IdentityManager.V3EnrollIdentity(ctx &components.V3EnrollIdentityRequest{
  PhoneNumber: "2001004031",
  ClientCustomerId: provesdkservergo.String("customer-123"),
  ClientRequestId: provesdkservergo.String("request-456"),
})
if err != nil {
  return fmt.Errorf("error creating identity: %w", err)
}

// Access response fields
identityId := rspEnrollIdentity.V3EnrollIdentityResponse.IdentityId
success := rspEnrollIdentity.V3EnrollIdentityResponse.Success

Parameters:

  • phoneNumber : The number of the consumer being enrolled.

Optional Parameters:

  • clientCustomerId : A client-generated unique ID for a specific customer.
  • clientRequestId : A client-generated unique ID for a specific session.
  • deviceId : A string that is the unique identifier for the Prove Key on the device. Only applicable if you are leveraging Prove Unify.

Returns:

  • identityId: A unique Prove-generated identifier for the enrolled identity.
  • success: If true, the request was successful and the identity was created.

Batch Enroll Identities

Enrolls multiple customers in a single request for efficient bulk operations (up to 100).

identities := []components.IdentityData{
  {
    PhoneNumber: "2001004031",
    ClientCustomerId: provesdkservergo.String("customer-123"),
  },
  {
    PhoneNumber: "2001004032",
    ClientCustomerId: provesdkservergo.String("customer-124"),
  },
}

rspBatchEnroll, err := client.IdentityManager.V3BatchEnrollIdentities(ctx, &components.V3BatchEnrollIdentitiesRequest{
  Identities: identities,
})

Parameters:

  • clientRequestId : A client-generated unique ID for a specific session.
  • items: Represents a list of identities that you wish to enroll.

Returns:

  • results: Represents a list of identities that were either successfully enrolled or an error message.

Batch Get Identities

Return a list of all identities you have enrolled in Identity Manager with pagination support.

rspGetIdentities, err := client.IdentityManager.V3BatchGetIdentities(ctx, &components.GetIdentitiesRequest{
  Limit:  provesdkservergo.Int(50),
})

Parameters:

  • limit : The maximum number of identities to return per call.

Returns:

  • lastKey: A pagination token for callers that have more identities left to return.
  • results: The list of identity IDs associated with the client.

Get Identity

Return details of an identity given the identity ID.

rspGetIdentity, err := client.IdentityManager.V3GetIdentity(ctx, "identity-id-123")

Parameters:

  • identityId : A unique Prove-generated identifier for the enrolled identity.

Returns:

  • Complete identity object with all associated data.

Get Identities By Phone Number

Return list of all identities you have enrolled that are associated with this phone number.

rspLookup, err := client.IdentityManager.V3GetIdentitiesByPhoneNumber(ctx, &components.LookupIdentityRequest{
  PhoneNumber: "2001004031",
})

Parameters:

  • mobileNumber : The phone number to retrieve identities for.

Returns:

  • items: The list of identities associated with the given phone number.

Activate Identity

Sets an identity as active for monitoring.

rspActivate, err := client.IdentityManager.V3ActivateIdentity(ctx, "identity-id-123")

Parameters:

  • identityId : A Prove-generated unique ID for a specific identity.

Returns:

  • success: Boolean indicating if activation was successful

Deactivate Identity

Sets an identity as inactive, stopping webhook notifications.

rspDeactivate, err := client.IdentityManager.V3DeactivateIdentity(ctx, "identity-id-123")

Parameters:

  • identityId (required): The unique identifier of the identity

Returns:

  • success: If true, the deactivate operation was successful.

Deactivated identities remain in the system and can be reactivated later. Use this instead of disenroll for temporary monitoring suspension.

Disenroll Identity

Disenrolls an identity from Identity Manager. If you wish to monitor in future, re-enrollment of that identity is required.

rspDelete, err := client.IdentityManager.V3DisenrollIdentity(ctx, "identity-id-123")

Parameters:

  • identityId (required): The unique identifier of the identity

Returns:

  • success: If true, the disenroll operation was successful.

Disenrolled identities cannot be recovered through the API. Consider using deactivate instead for temporary suspension.

Always test your implementation thoroughly in the sandbox environment before moving to production.