Skip to content

API Reference

Package exports

Everything exported from @selfagency/teamdynamix-ts:

Client

ExportKindDescription
createTeamDynamixClientFunctionCreates the HTTP client with auth, retry, and validation
createTeamDynamixSdkFunctionCreates the full SDK (10 domains + mutations + helpers + registry)
TeamDynamixClientConfigType (interface)Client configuration options

Auth helpers

ExportKindDescription
loginWithPasswordFunctionToken provider via username/password login
loginWithServiceAccountFunctionToken provider via BEID + WebServicesKey
createTokenProviderFromJWTFunctionWraps a pre-acquired JWT as a token provider

SDK domains

ExportKindDescription
TeamDynamixSdkType (interface)Full SDK shape with all domains and mutations
SdkDomainNameType (union)'discovery' | 'tickets' | ... | 'referenceData'
SdkRouteDefinitionType (interface)Route metadata used by the request pipeline
SdkRequestOptionsType (interface)Options for raw client requests

Standalone helpers

ExportKindDescription
projectFieldsFunctionProjection — reduces objects to selected fields
previewEntityFunctionHuman-readable entity preview
bulkAddUsersToGroupFunctionBulk-add members to a group
runTicketReportFunctionRun a saved ticket search with pagination

Helper return types

ExportKindDescription
BulkResultType (interface)Return type of bulkAddUsersToGroup
ReportPageType (interface)Return type of runTicketReport

Error handling

ExportKindDescription
TeamDynamixClientErrorClassAll SDK errors are instances of this
redactAuthorizationFunctionStrips Bearer tokens from strings for safe logging

Zod schemas

ExportKindDescription
appIdSchemaz.ZodSchemaValidates string | number app IDs
confirmTrueSchemaz.ZodSchemaValidates true literal (safety gate)
customAttributeSchemaz.ZodSchemaValidates { ID, Name?, Value? }
paginationSchemaz.ZodSchemaValidates { page?, pageSize? }
searchTextSchemaz.ZodSchemaValidates non-empty search text (max 500 chars)
tenantSchemaz.ZodSchemaValidates non-empty tenant string
tokenSchemaz.ZodSchemaValidates non-empty token string

SDK types (internal)

The following types are used by the SDK internally but may be useful for type annotations:

ExportKindDescription
TeamDynamixSdkTypeFull SDK interface with all 10 domains
RetryPolicyTypeRetry configuration shape
RuntimeValidationModeType'fail-closed' | 'fail-open'
SdkDomainNameTypeUnion of all domain names
SdkRouteDefinitionTypeRoute metadata interface
SdkRequestOptionsTypeRaw request options interface
BulkResultTypeBulk operation result
ReportPageTypePaginated report result

SDK domain methods

Each SDK domain has auto-generated read methods (all GET endpoints from the OpenAPI spec). See SDK Domains for the complete list with signatures.

Eight domains also have curated mutation methods — see SDK Mutations.

Raw client

For endpoints not covered by SDK methods, use client._client:

ts
const result = await client._client.request('/api/accounts', {
  method: 'GET',
  params: { Page: '1' },
})

See Advanced Usage for details.