Skip to main content
Query the list of clients available from a provider connection. This allows Filed to discover clients from your platform.
query GetConnectionClients($workspaceId: ID!, $connectionId: ID!, $options: JSON) {
  me {
    workspaces(filters: { ids: [$workspaceId] }) {
      id
      connections(filters: { ids: [$connectionId] }) {
        id
        clients(options: $options) {
          id
          name
          email
          phone
          type
          lastModified
        }
      }
    }
  }
}
Query Pattern: Clients are accessed through the ProviderConnection type. Query connections from a workspace, then access the clients field on the connection.

Arguments

workspaceId
ID!
required
The ID of the workspace containing the provider connection.
connectionId
ID!
required
The ID of the provider connection. This identifies which integration connection to query clients from.
options
JSON
Optional query parameters for filtering or pagination. The exact options depend on your platform’s implementation and will be coordinated with Filed during integration setup.

Returns

id
String!
Client identifier from your platform.
name
String
Client name.
email
String
Client email address.
phone
String
Client phone number.
type
String
Client type or category.
lastModified
Date
Timestamp when the client was last modified in your platform.

Example

curl -X POST https://gateway.filed.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <accessToken>" \
  -H "source-platform: my-sample-platform" \
  -d '{
    "query": "query GetConnectionClients($workspaceId: ID!, $connectionId: ID!, $options: JSON) { me { workspaces(filters: { ids: [$workspaceId] }) { id connections(filters: { ids: [$connectionId] }) { id clients(options: $options) { id name email phone type lastModified } } } } }",
    "variables": {
      "workspaceId": "workspace_123456",
      "connectionId": "connection_789",
      "options": {
        "limit": 100,
        "offset": 0
      }
    }
  }'
{
  "data": {
    "me": {
      "workspaces": [
        {
          "id": "workspace_123456",
          "connections": [
        {
          "id": "connection_789",
          "clients": [
        {
          "id": "client-12345",
          "name": "John Smith",
          "email": "[email protected]",
          "phone": "+1-555-0123",
          "type": "individual",
          "lastModified": "2024-01-15T08:00:00Z"
        },
        {
          "id": "client-67890",
          "name": "Jane Doe",
          "email": "[email protected]",
          "phone": "+1-555-0456",
          "type": "individual",
          "lastModified": "2024-01-14T10:30:00Z"
        }
          ]
        }
      ]
        }
      ]
    }
  }
}
To query files for a specific client, use get client files with the client ID returned from this query.

Troubleshooting

Problem: No clients returned or empty list Solutions:
  • Verify the connection status is active
  • Check that your platform has clients available for this connection
  • Review the options parameter to ensure filters aren’t excluding all clients
  • Verify the connection credentials have permission to access client data
Problem: Connection not found Solutions:
  • Verify the connectionId exists and belongs to your workspace
  • Ensure you’re using the correct connection ID from the connection setup
  • Check that the connection status allows querying clients