<@U04S8PLJWMT> I created a custom connector in the...
# replication-ask-ai
h
@kapa.ai I created a custom connector in the Builder menu. The authentication of the service I'm interacting with is OAuth2. Part of the response is "expires_in" which is the time we should refresh the token in. I was wondering if it is possible to, instead of relying on value returned by the API to set it to a constant value of seconds.
k
The knowledge sources do not explicitly describe a built-in "constant refresh interval" option in the Connector Builder UI. However, based on what's available, here are your options: Setting a Constant Token Expiry in the Connector Builder Option 1: Use Token Expiry Date (static value) In the Connector Builder's OAuth configuration, there is a Token Expiry Date field. You can set a fixed expiry date here, but this is a static date rather than a recurring interval — so it's not ideal for long-term use. [Auth config options] Option 2: Override expires_in via the Refresh Request Body You can add a custom field to the Refresh Request Body in the OAuth configuration to send a specific
expires_in
value to the token endpoint. This tells the API to issue a token valid for your desired duration (e.g., 14400 seconds = 4 hours). However, this only works if the API honors the
expires_in
value you send in the request — not all APIs do. For example, in YAML this would look like:
Copy code
refresh_request_body:
  expires_in: 14400
Note: This approach was actually removed from the Zendesk Support connector because Zendesk enforces whatever
expires_in
you send, which caused issues. [Zendesk fix] Option 3: Use the Low-Code YAML directly If the Connector Builder UI is too restrictive, you can switch to editing the YAML manifest directly. The
OAuthAuthenticator
supports
expires_in_name
to point to the correct field in the response, and you can combine it with
token_expiry_date
to set a fixed value. [YAML Reference] Important caveat: There is no native "refresh every X seconds regardless of API response" option in the Connector Builder UI today. The closest workaround is overriding
expires_in
in the refresh request body (if your API supports it) or setting a static
Token Expiry Date
. If neither works for your use case, you may need to use the Python CDK for more fine-grained control. 👍 0 button 👎 0 button â„šī¸ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.