Skip to main content
When running in daemon mode, connectors communicate with C1 via gRPC. The SDK handles all API communication - connector developers implement interfaces, the SDK calls your code when tasks arrive. This document describes the C1 APIs that connectors use internally. You don’t call these APIs directly; the SDK manages them.

Communication architecture

Key points:
  • Connectors poll for tasks (pull model, not push)
  • Tasks include: Sync, Grant, Revoke, CreateAccount, DeleteResource, RotateCredential
  • Results upload via streaming (c1z files in 512KB chunks)
  • Heartbeats keep tasks alive during long operations

BatonServiceClient

The client interface used by connectors:

Task types

Sync tasks

Full or targeted data sync from the external system:
Connector produces: c1z file uploaded to C1

Grant task

Provision access to a user:

Revoke task

Remove access from a user:

CreateAccount task

Provision a new user account (JIT):
Returns to C1: Created account, credentials (encrypted by SDK)

DeleteResource task

RotateCredential task

Returns to C1: New credentials (encrypted by SDK)

Task lifecycle

Polling loop

Heartbeat intervals

C1 can adjust heartbeat interval per-task. If heartbeats stop, the task may be reassigned to another connector instance.

Task completion

Upload mechanism

Sync results (c1z files) upload via streaming:
Upload characteristics:
  • Streaming (not buffered in memory)
  • 512KB chunks
  • Resumable on network errors
  • Compressed c1z format

Authentication

Client credentials

Connectors authenticate using OAuth2 client credentials:
The SDK handles:
  • Token acquisition from C1’s OAuth endpoint
  • Token refresh before expiration
  • Token injection into request metadata

Host identification

Connectors identify themselves to C1:
This helps C1 track which host is running which connector instance.

Error handling

Retryable vs non-retryable

Error flow

Annotations for error context

Return annotations to provide context:

Debugging API communication

Enable debug logging

Debug output includes:
  • Task received notifications
  • Heartbeat timing
  • Upload progress
  • API response codes

Common issues

Quick reference

Daemon mode checklist

Task processing flow

  1. Hello - Connector identifies itself
  2. GetTask - Poll for work (returns task or empty)
  3. Process - Execute sync/grant/revoke/etc
  4. Heartbeat - Keep task alive during processing
  5. FinishTask - Report success or failure
  6. Upload - Send c1z file (sync tasks only)

SDK handles

  • OAuth2 token management
  • Connection pooling
  • Heartbeat scheduling
  • Chunk-based uploads
  • Retry with backoff
  • Error classification