Clients

Clients are a core part of Elements. The Elements API refers to these as FirmClients. On this page, we'll dive into the different queries and mutations you can use to manage clients programmatically.

The FirmClient model

  • Name
    id
    Type
    ID!
    Description

    Unique identifier for the client.

  • Name
    createdAt
    Type
    Time!
    Description

    ISO-8601 timestamp of when this FirmClient was created.

  • Name
    updatedAt
    Type
    Time!
    Description

    ISO-8601 timestamp of when this FirmClient was last updated.

  • Name
    givenNamesDisplay
    Type
    String!
    Description

    The client's given names, as they should be displayed.

  • Name
    familyNamesDisplay
    Type
    String!
    Description

    The client's family names, as they should be displayed.

  • Name
    status
    Type
    FirmClientStatus!
    Description

    The client's status. This is an enum with possible values being ACTIVE or ARCHIVED.

  • Name
    mode
    Type
    FirmClientMode!
    Description

    The client's mode. This is an enum with possible values being PROSPECT, ONBOARDING_IN_PROGRESS (Onboarding), or ONBOARDING_COMPLETED (Active).

  • Name
    household
    Type
    Household!
    Description

    The household representing the client's household. Please reference the Household section for more information.

  • Name
    individuals
    Type
    [FirmClientIndividual!]!
    Description

    The individuals representing the client. These are typically the heads of the household. Each individual has a givenName, familyName, emailAddress, and phoneNumber.


queryfirmClientsForFirm

Querying clients

This query allows you to fetch all the clients for a firm. To get your firm ID, please see the Authentication section. The list of firms your user is affiliated (and their IDs) come back in the signIn mutation.

Required arguments

  • Name
    firmID
    Type
    ID!
    Description

    The ID for the firm you want to fetch clients for.

Optional arguments

  • Name
    cursor
    Type
    String
    Description

    A cursor to fetch the next page of results.

Request

query FirmClients($firmID: ID!, $cursor: String) {
  firmClientsForFirm(firmID: $firmID, cursor: $cursor) {
    items {
      id
      createdAt
      updatedAt
      givenNamesDisplay
      familyNamesDisplay
      status
      mode
      household {
        id
      }
      individuals {
        givenName
        familyName
        emailAddress
        phoneNumber
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

queryfirmClient

Retrieve a client

This query allows you to retrieve a client by providing the firm ID and client ID. To get your firm ID, please see the Authentication section. The list of firms your user is affiliated (and their IDs) come back in the signIn mutation.

Required arguments

  • Name
    firmID
    Type
    ID!
    Description

    The ID for the firm you want to fetch the client for.

  • Name
    id
    Type
    ID!
    Description

    The ID for the client you want to fetch.

Request

query FirmClient($firmID: ID!, $id: ID!) {
  firmClient(firmID: $firmID, id: $id) {
    id
    createdAt
    updatedAt
    givenNamesDisplay
    familyNamesDisplay
    status
    mode
    household {
      id
    }
    individuals {
      givenName
      familyName
      emailAddress
      phoneNumber
    }
  }
}