Reference
Configuration Models

Configuration Models

All configuration models use Pydantic v2 for validation.

OAuth2Config

Configuration for OAuth2 authentication.

from intapp_rest_client import OAuth2Config, OAuth2GrantType
 
config = OAuth2Config(
    token_url="https://api.example.com/oauth/token",
    client_id="your_client_id",
    client_secret="your_secret",
    grant_type=OAuth2GrantType.CLIENT_CREDENTIALS,  # Default
    scope="data",
    token_refresh_margin=30  # Refresh 30s before expiry
)

Fields

FieldTypeDefaultDescription
token_urlstr(required)OAuth2 token endpoint URL
client_idstr(required)OAuth2 client ID
client_secretstr(required)OAuth2 client secret
grant_typeOAuth2GrantTypeCLIENT_CREDENTIALSGrant type
scopestrNoneOAuth2 scope
usernamestrNoneUsername (for password grant)
passwordstrNonePassword (for password grant)
auth_urlstrNoneAuthorization URL (for auth code grant)
redirect_uristrNoneRedirect URI (for auth code grant)
token_refresh_marginint30Seconds before expiry to refresh

Grant Types

from intapp_rest_client import OAuth2GrantType
 
OAuth2GrantType.CLIENT_CREDENTIALS  # Default, for service-to-service
OAuth2GrantType.PASSWORD            # For user credentials
OAuth2GrantType.REFRESH_TOKEN       # Token refresh
OAuth2GrantType.AUTHORIZATION_CODE  # Interactive OAuth flow

JWTConfig

Configuration for JWT token generation.

from intapp_rest_client import JWTConfig
 
config = JWTConfig(
    secret_key="your-secret-key",
    algorithm="HS256",
    token_lifetime=3600,
    issuer="my-service",
    audience="api.example.com",
    custom_claims={"user_id": 123}
)

Fields

FieldTypeDefaultDescription
secret_keystr(required)Secret key for signing
algorithmstr"HS256"JWT signing algorithm
token_lifetimeint3600Token lifetime in seconds
issuerstrNoneToken issuer (iss claim)
audiencestrNoneToken audience (aud claim)
custom_claimsdictAdditional custom claims

Supported Algorithms

FamilyAlgorithms
HMACHS256, HS384, HS512
RSARS256, RS384, RS512
ECDSAES256, ES384, ES512
RSA-PSSPS256, PS384, PS512
💡

JWT support requires the jwt extra:

  • pip: pip install intapp-rest-client[jwt]
  • uv: uv add intapp-rest-client[jwt]
  • poetry: poetry add intapp-rest-client -E jwt

RetryConfig

Configuration for retry behavior.

from intapp_rest_client import RetryConfig
 
config = RetryConfig(
    max_retries=5,
    backoff_factor=2.0,
    retryable_statuses=(429, 500, 502, 503, 504),
    respect_retry_after=True,
    max_backoff=60.0,
    retry_count_by_status={429: 10, 500: 2},
    jitter=True,
    jitter_min=0.5,
    jitter_max=1.5
)

Fields

FieldTypeDefaultDescription
max_retriesint3Default retry count
backoff_factorfloat2.0Exponential backoff multiplier
retryable_statusestuple(429, 500, 502, 503, 504)Status codes that trigger retry
respect_retry_afterboolTrueHonor Retry-After header
max_backofffloat60.0Maximum wait between retries
retry_count_by_statusdictNonePer-status retry counts
jitterboolTrueAdd randomization to backoff
jitter_minfloat0.5Minimum jitter multiplier
jitter_maxfloat1.5Maximum jitter multiplier

Methods

config = RetryConfig(...)
 
# Get retry count for a specific status
count = config.get_max_retries_for_status(429)  # Returns per-status or default
 
# Check if status should trigger retry
should_retry = config.should_retry(429)  # True if in retryable_statuses
 
# Copy that drops given statuses from retry lists (e.g. custom transports / fail-fast on 429)
no_429 = config.without_retry_on_statuses(429)

without_retry_on_statuses returns a new RetryConfig with those HTTP statuses removed from retryable_statuses and from retry_count_by_status keys. The built-in client uses this pattern internally for code paths that must not retry 429.

ConnectionPoolConfig

Configuration for HTTP connection pooling.

from intapp_rest_client import ConnectionPoolConfig
 
config = ConnectionPoolConfig(
    max_connections=100,
    max_keepalive_connections=20,
    keepalive_expiry=5.0
)

Fields

FieldTypeDefaultDescription
max_connectionsint100Maximum total connections
max_keepalive_connectionsint20Maximum persistent connections
keepalive_expiryfloat5.0Idle timeout in seconds

SSLConfig

SSL/TLS configuration for custom certificates and verification. Pass as ssl_config to RestClient. See SSL/TLS configuration for usage.

from intapp_rest_client import RestClient, SSLConfig
 
# Custom CA bundle for internal APIs
client = RestClient(
    base_url="https://api.example.com",
    api_key="key",
    ssl_config=SSLConfig(ca_bundle="/etc/ssl/certs/company-ca.crt")
)
 
# Mutual TLS (client certificate)
client = RestClient(
    base_url="https://api.example.com",
    api_key="key",
    ssl_config=SSLConfig(
        client_cert="/path/to/client.crt",
        client_key="/path/to/client.key"
    )
)

Fields

FieldTypeDefaultDescription
verifyboolTrueEnable SSL certificate verification
ca_bundlestrNonePath to custom CA bundle file or directory
client_certstrNonePath to client certificate (mutual TLS)
client_keystrNonePath to client private key (required if client_cert set)
client_key_passwordstrNonePassword for encrypted client key
⚠️

Set verify=False only for development/testing. Never disable verification in production.

CircuitBreakerConfig

Configuration for circuit breaker pattern.

from intapp_rest_client import CircuitBreakerConfig
 
config = CircuitBreakerConfig(
    failure_threshold=5,
    reset_timeout=60.0,
    half_open_requests=1,
    failure_statuses=(500, 502, 503, 504),
    count_network_errors=True
)

Fields

FieldTypeDefaultDescription
failure_thresholdint5Failures before opening circuit
reset_timeoutfloat60.0Seconds before trying again
half_open_requestsint1Test requests when half-open
failure_statusestuple(500, 502, 503, 504)Status codes that count as failures
count_network_errorsboolTrueCount network errors as failures

Circuit States

from intapp_rest_client import CircuitState
 
CircuitState.CLOSED     # Normal operation
CircuitState.OPEN       # Failing fast
CircuitState.HALF_OPEN  # Testing recovery
💡

RestClient builds RetryTransport without a CircuitBreaker, so the breaker types are for advanced use: pass a CircuitBreaker into RetryTransport / AsyncRetryTransport if you compose custom httpx clients, or use the exported CircuitBreaker class in your own orchestration.

EntraConfig

Configuration for Microsoft Entra ID (Azure AD).

from intapp_rest_client import EntraConfig
 
config = EntraConfig(
    tenant_id="your-tenant-id",
    client_id="your-client-id",
    client_secret="your-client-secret",
    scope="api://your-api/.default"
)

Fields

FieldTypeDefaultDescription
tenant_idstr(required)Azure AD tenant ID
client_idstr(required)Application (client) ID
client_secretstr(required)Client secret
scopestr(required)API scope (usually ends with .default)

OktaConfig

Configuration for Okta authentication.

from intapp_rest_client import OktaConfig
 
config = OktaConfig(
    domain="your-org.okta.com",
    client_id="your-client-id",
    client_secret="your-client-secret",
    scope="api-scope"
)

Fields

FieldTypeDefaultDescription
domainstr(required)Okta domain (org.okta.com)
client_idstr(required)Okta client ID
client_secretstr(required)Okta client secret
scopestr(required)API scope

LogLevel

Logging levels for the client.

from intapp_rest_client import LogLevel
 
LogLevel.DEBUG     # 10 - All details
LogLevel.INFO      # 20 - Standard (default)
LogLevel.WARNING   # 30 - Warnings and errors
LogLevel.ERROR     # 40 - Errors only
LogLevel.CRITICAL  # 50 - Critical only

AuthType

Authentication type enumeration.

from intapp_rest_client import AuthType
 
AuthType.NONE                      # No authentication
AuthType.OAUTH2_CLIENT_CREDENTIALS # OAuth2 client credentials
AuthType.OAUTH2_PASSWORD           # OAuth2 password grant
AuthType.OAUTH2_REFRESH_TOKEN      # OAuth2 refresh token
AuthType.API_KEY                   # API key (header or query)
AuthType.JWT                       # JWT token
AuthType.BASIC                     # HTTP Basic auth
AuthType.ENTRA_ID                  # Microsoft Entra ID
AuthType.OKTA                      # Okta

ErrorHandling

Error handling mode for parallel methods (parallel_get, parallel_post, parallel_put, parallel_delete, and async aparallel_*).

from intapp_rest_client import RestClient, ErrorHandling
 
ErrorHandling.FAIL_FAST   # Raise on first error (default)
ErrorHandling.COLLECT     # Collect all errors, return (results, errors)
ErrorHandling.LOG_ONLY    # Log errors and continue, return (results, errors)
ValueBehavior
FAIL_FASTRaise on first failure; return list of results only
COLLECTContinue on failure; return (results, errors)
LOG_ONLYSame as COLLECT; errors are also logged