<@U04S8PLJWMT> Exception: Token refresh API respon...
# ask-ai
h
@kapa.ai Exception: Token refresh API response was missing access token {self.get_access_token_name()}
k
The exception "Token refresh API response was missing access token {self.get_access_token_name()}" indicates that Airbyte expected the token refresh endpoint to return a property (by default, access_token) in its response, but it was missing. This typically happens when: - The token refresh endpoint does not return an access_token property in the response. - The property name is different (e.g., token instead of access_token). - The response format is not as expected. How to resolve: 1. Check the token refresh endpoint response: Ensure that the endpoint you configured returns an access_token property in the JSON response. For example:
Copy code
json    {      "access_token": "YOUR_ACCESS_TOKEN_123",      "refresh_token": "YOUR_REFRESH_TOKEN_123",      "expires_in": 7200    }
If the property name is different, you must specify it using the
access_token_name
parameter in your authenticator configuration. 2. Set the correct access_token_name: In your connector's OAuthAuthenticator configuration, set the
access_token_name
to match the property name in the response. For example:
Copy code
yaml    authenticator:      type: OAuthAuthenticator      token_refresh_endpoint: "https://yourconnectorservice.com/oauth/refresh/endpoint"      client_id: "{{ config['client_id'] }}"      client_secret: "{{ config['client_secret'] }}"      refresh_token: "{{ config['refresh_token'] }}"      access_token_name: "token"  # Use the actual property name if it's not "access_token"
[See YAML reference for OAuthAuthenticator](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator) 3. Verify the refresh request body and headers: Some APIs require specific request bodies or headers. Use
refresh_request_body
and
refresh_request_headers
to customize the request if needed. 4. Debugging tip: If you are unsure what the API returns, try calling the token refresh endpoint manually (e.g., with curl or Postman) and inspect the response. Summary: This error is almost always due to a mismatch between what Airbyte expects (the property name for the access token) and what the API actually returns. Adjust the
access_token_name
parameter to match the API response, and the error should be resolved. For more details and examples, see the [OAuthAuthenticator documentation](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator) and [advanced OAuth configuration examples](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#advanced-case-refresh-token--single-use-refresh-token-support).
h
@kapa.ai My token refresh endpoint response is like this: { "code": 0, "message": "OK", "result": { "access_token": "abc123", "expires_in": 3600, "refresh_token": "def456" } } This is how I declare it in yaml: expires_in_name: result.expires_in access_token_name: result.access_token
k
A message from kapa.ai
Your current configuration for
access_token_name: result.access_token
and
expires_in_name: result.expires_in
is not correct for Airbyte's OAuthAuthenticator. According to the documentation, these fields expect only the property name, not a dot-separated path. By default, Airbyte looks for the property at the top level of the response, but if your token is nested (as in your example), you need to use a different approach. Your API response:
Copy code
json {   "code": 0,   "message": "OK",   "result": {     "access_token": "abc123",     "expires_in": 3600,     "refresh_token": "def456"   } }
Correct way to handle nested fields: Currently, the
OAuthAuthenticator
does not support dot notation (like
result.access_token
) for nested fields. It only supports top-level keys. If your access token is nested, you have two options: 1. Update your backend to return the token at the top level (if possible). 2. Write a custom authenticator (not supported in config-based connectors out-of-the-box). 3. (Declarative Connectors Only) If you are using declarative connectors, you can use the
path_in_oauth_response
property to specify the path to the nested field, but this is not available in the config-based
OAuthAuthenticator
YAML as per the current documentation. Documentation Reference: > The field to extract access token from in the response. Default: "access_token". > (No support for dot notation or nested fields in config-based YAML) [See OAuthAuthenticator Reference](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator) Summary Table: | What you want | What Airbyte supports in config-based YAML | |--------------------|-------------------------------------------| | result.access_token| ✗ (not supported) | | access_token | ✓ (top-level only) | What you should do: - If you control the API, return the tokens at the top level. - If not, you will need to implement a custom connector or wait for nested field support in config-based connectors. If you are using declarative connectors (advanced_auth), you can do:
Copy code
yaml path_in_oauth_response:   - result   - access_token
But this is not available in the config-based
OAuthAuthenticator
YAML. --- In summary: You cannot use
result.access_token
in
access_token_name
. Airbyte expects just the property name, and it must be at the top level of the response. Nested fields are not supported in config-based YAML at this time [see documentation](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator).
h
@kapa.ai My yaml looks like this: version: 3.9.6 type: DeclarativeSource check: type: CheckStream stream_names: - NewAPITest definitions: streams: NewAPITest: type: DeclarativeStream name: NewAPITest retriever: type: SimpleRetriever paginator: type: DefaultPaginator page_size_option: type: RequestOption field_name: page_size inject_into: body_json page_token_option: type: RequestOption field_name: page inject_into: body_json pagination_strategy: type: PageIncrement page_size: 10 start_from_page: 1 inject_on_first_request: true requester: $ref: '#/definitions/base_requester' path: search http_method: POST request_headers: Content-Type: application/json request_body_data: |- { "keyword": "", "pageable": { "page": 1, "page_size": 10, "sort": [ { "property": "id", "direction": "desc" } ] }, "filters": [ { "name": "", "value": {}, "operation": "" } ] } request_parameters: {} record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] schema_loader: type: InlineSchemaLoader schema: $ref: '#/schemas/NewAPITest' base_requester: type: HttpRequester url_base: http://10.0.0.50:8620/api/v1/airflow/airflow-job/ authenticator: type: OAuthAuthenticator scopes: - email profile client_id: 6a3b1878-dd5d-46f5-852b-65bee233d2b2 grant_type: refresh_token client_secret: 1xJ0HU06bGeepZJSwHG2iFtEAVENzlDl refresh_token: >- eyJhbGciOiJIUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiMWU2MjA4Zi04NTFlLTQ3ZDEtYWRhNy0xMmJkODFmOWUxZmEifQ.eyJleHAiOjE3NTM5NDQxODcsImlhdCI6MTc1Mzk0MjM4NywianRpIjoiY2I0MTcwMGQtM2RkMi00NzM1LTk1MTctODAwYjZiNzkzZDc0IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvYm9jb25ndGh1b25nIiwiYXVkIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvYm9jb25ndGh1b25nIiwic3ViIjoiMmQxMTI2YjAtYzFmMy00MjljLWEyNjItYmY1Y2U1M2Q4OTgxIiwidHlwIjoiUmVmcmVzaCIsImF6cCI6ImJhY2tlbmQiLCJzaWQiOiJlMzM4MDg4Ny0xZGU0LTQwZjctODM3Ni04NzZiM2ZjZjMyOGQiLCJzY29wZSI6InJvbGVzIGVtYWlsIHByb2ZpbGUgYWNyIHdlYi1vcmlnaW5zIGJhc2ljIn0.uJHbQowqQpJBDLr8NytnjlnqOmzSKbtzlpRC2SYqGNMyfxODcAoBYAOkO8kMvkL9Pw_rSTQTBYZgSiZk3Dhe7w expires_in_name: result.expires_in access_token_name: result.access_token refresh_request_body: password: '123' username: admin refresh_token_updater: refresh_token_name: refresh_token access_token_config_path: - oauth_access_token refresh_token_config_path: - client_refresh_token token_expiry_date_config_path: - oauth_token_expiry_date token_refresh_endpoint: http://10.0.0.50:8602/api/v1/sys/token/login streams: - $ref: '#/definitions/streams/NewAPITest' spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: [] properties: {} additionalProperties: true metadata: assist: {} testedStreams: NewAPITest: streamHash: e2fe90e35a9d5cf38e02f353880631764b69f63e hasResponse: false responsesAreSuccessful: false hasRecords: false primaryKeysArePresent: false primaryKeysAreUnique: false autoImportSchema: NewAPITest: true schemas: NewAPITest: type: object $schema: http://json-schema.org/draft-07/schema# properties: {} additionalProperties: true How do I change this to accomodate for nested fields in token refresh endpoint response?
k
A message from kapa.ai
Based on the Airbyte documentation, for declarative connectors (using
DeclarativeSource
), you can specify the path to nested fields in the OAuth response using the
path_in_oauth_response
property. However, the `OAuthAuthenticator`'s
access_token_name
and
expires_in_name
fields do not support dot notation (e.g.,
result.access_token
) for nested fields. They only support top-level keys in the response. This means your current configuration with
access_token_name: result.access_token
and
expires_in_name: result.expires_in
will not work as intended. What the documentation says: - For config-based connectors, only top-level keys are supported for
access_token_name
and similar fields. Nested fields are not supported via dot notation or path arrays in the
OAuthAuthenticator
YAML configuration [see reference](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator). - For declarative connectors, you can use
path_in_oauth_response
to specify the path to a nested field, but this is only available in the `advanced_auth`/`oauth_config_specification` block, not in the
OAuthAuthenticator
block. Example from documentation:
Copy code
yaml access_token:   type: string   path_in_connector_config:     - access_token   path_in_oauth_response:     - result     - access_token
This is only available in the
advanced_auth
block, not in the
OAuthAuthenticator
block of the
HttpRequester
definition [see example](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#case-c-oauth-flow-returns-the-access_token-and-the-refresh_token). What you can do: - If you control the API, modify the token refresh endpoint to return the tokens at the top level. - If you do not control the API and must use the declarative YAML, you cannot currently extract nested fields from the token refresh response using
OAuthAuthenticator
in the
HttpRequester
block. Summary: You cannot extract nested fields from the token refresh endpoint response using
access_token_name: result.access_token
in the
OAuthAuthenticator
block. Only top-level keys are supported. If you need to extract nested fields, you must use the
advanced_auth
block with
path_in_oauth_response
, which is not available in the
OAuthAuthenticator
block of the declarative YAML as per the current documentation [see documentation](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator). If you need this functionality, you may need to: - Request a change to the API to return tokens at the top level, or - Wait for Airbyte to support nested field extraction in the
OAuthAuthenticator
block, or - Implement a custom connector in Python. References: - [Declarative OAuth 2.0 - Case C Example](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#case-c-oauth-flow-returns-the-access_token-and-the-refresh_token) - [OAuthAuthenticator Reference](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator)
h
@kapa.ai
Copy code
Something went wrong in the connector. See the logs for more details. - Traceback (most recent call last): File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 133, in read yield from self._read_stream( File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 232, in _read_stream for record_data_or_message in record_iterator: File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/streams/core.py", line 185, in read for record_data_or_message in records: File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 136, in read_records yield from self.retriever.read_records(self.get_json_schema(), stream_slice) File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 370, in read_records yield from self._read_single_page(record_generator, stream_state, _slice) File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 317, in _read_single_page response = self._fetch_next_page(stream_state, stream_slice) File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 484, in _fetch_next_page return self.requester.send_request( File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/requesters/http_requester.py", line 305, in send_request request, response = self._http_client.send_request( File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http_client.py", line 378, in send_request request: requests.PreparedRequest = self._create_prepared_request( File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http_client.py", line 172, in _create_prepared_request raise RequestBodyException( airbyte_cdk.sources.streams.http.exceptions.RequestBodyException: At the same time only one of the 'request_body_data' and 'request_body_json' functions can return data
ERROR
Copy code
None - Traceback (most recent call last): File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/connector_builder/message_grouper.py", line 302, in _read_stream yield from AirbyteEntrypoint(source).read(source.spec(self.logger), config, configured_catalog, state) File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 166, in read for message in self.source.read(self.logger, config, catalog, state): File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/manifest_declarative_source.py", line 165, in read yield from super().read(logger, config, catalog, state) File "/home/airbyte/.pyenv/versions/3.9.19/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 186, in read raise AirbyteTracedException(message=error_message, failure_type=FailureType.config_error) airbyte_cdk.utils.traced_exception.AirbyteTracedException: None
k
A message from kapa.ai
The error you are seeing:
Copy code
RequestBodyException: At the same time only one of the 'request_body_data' and 'request_body_json' functions can return data
means that your connector is configured to send both
request_body_data
and
request_body_json
in the same request, which is not allowed in Airbyte. You must use only one of these options per request. In your YAML, you have:
Copy code
yaml request_body_data: |-   {     "keyword": "",     "pageable": {       "page": 1,       "page_size": 10,       "sort": [         {           "property": "id",           "direction": "desc"         }       ]     },     "filters": [       {         "name": "",         "value": {},         "operation": ""       }     ]   }
and your paginator is set to inject page and page_size into `body_json`:
Copy code
yaml page_size_option:   type: RequestOption   field_name: page_size   inject_into: body_json page_token_option:   type: RequestOption   field_name: page   inject_into: body_json
This causes Airbyte to try to use both
request_body_data
and
request_body_json
at the same time, which is not supported.
--- ## How to fix - If your API expects a JSON body, use only
request_body_json
(not
request_body_data
). - Move your request body definition from
request_body_data
to
request_body_json
. - Remove
request_body_data
from your YAML. Example fix:
Copy code
yaml request_body_json:   keyword: ""   pageable:     page: 1     page_size: 10     sort:       - property: id         direction: desc   filters:     - name: ""       value: {}       operation: ""
This will allow the paginator to inject the
page
and
page_size
values into the correct place in the JSON body. --- Summary: You cannot use both
request_body_data
and
request_body_json
in the same request. Use only
request_body_json
for JSON APIs, and remove
request_body_data
from your configuration. This should resolve the error you are seeing [see documentation](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/request-options#request-options-provider).
h
@kapa.ai How do I insert this body json: { "sortExpression": "Id desc", "predicate": { "advanceSearchInfo": { "IsQDXPUBND": false, "DonViGop": false, "CurentMaDonVi": "T25", "CurentDonViId": "1046" } } } Using the connection builder UI?
k
Sorry @Hoang Tran Minh, it looks like your question contains files, which I cannot process. Please reformulate your question without including any files.
h
@kapa.ai How do I insert this body json: { "sortExpression": "Id desc", "predicate": { "advanceSearchInfo": { "IsQDXPUBND": false, "DonViGop": false, "CurentMaDonVi": "T25", "CurentDonViId": "1046" } } } Using the connection builder UI?
k
A message from kapa.ai
To insert the following JSON body using the Airbyte Connector Builder UI:
Copy code
json {   "sortExpression": "Id desc",   "predicate": {     "advanceSearchInfo": {       "IsQDXPUBND": false,       "DonViGop": false,       "CurentMaDonVi": "T25",       "CurentDonViId": "1046"     }   } }
Follow these steps: 1. In the Connector Builder UI, go to your stream configuration. 2. Scroll to the Request Body section. 3. Select "JSON" as the body type (this is typically labeled as "Form encoded (key-value pairs)", "Plain text", or "JSON"—choose "JSON"). 4. Enter your JSON structure in the editor, using the key-value format. For your example, it should look like this:
Copy code
yaml     request_body_json:       sortExpression: "Id desc"       predicate:         advanceSearchInfo:           IsQDXPUBND: false           DonViGop: false           CurentMaDonVi: "T25"           CurentDonViId: "1046"
In the UI, this is usually done by adding keys and nesting objects as needed. 5. Save your configuration. Notes: - If you need to inject dynamic values (e.g., from config or variables), you can use Jinja expressions in the values, such as
{{ config['CurentMaDonVi'] }}
. - Only use
request_body_json
for JSON bodies; do not use
request_body_data
at the same time, as only one can be active per request [see documentation](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester). If you need to use the UI's form fields: - Add a key for
sortExpression
with value
"Id desc"
. - Add a key for
predicate
, then within that, add a nested object for
advanceSearchInfo
with the appropriate fields and values. This approach is supported and recommended for JSON request bodies in the Airbyte Connector Builder UI [see YAML reference](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester).
h
@kapa.ai How do I insert this body json: { "sortExpression": "Id desc", "predicate": { "advanceSearchInfo": { "IsQDXPUBND": false, "DonViGop": false, "CurentMaDonVi": "T25", "CurentDonViId": "1046" } } } Using the connection builder UI JSON key-value?
k
A message from kapa.ai
To insert the provided JSON body using the Airbyte Connector Builder UI's JSON key-value editor, you should use the nested key-value structure supported by the
request_body_json
field. According to the documentation,
request_body_json
can contain nested objects, and you can represent your JSON as nested key-value pairs in the UI [see YAML reference](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester). How to do it: 1. In the Connector Builder UI, go to the section where you define the request body. 2. Select the option for JSON key-value pairs (this is typically labeled as "JSON" or "Key-value pairs (JSON)"). 3. Enter your structure as nested keys, like this: - Key:
sortExpression
Value:
Id desc
- Key:
predicate
Value: (object) - Key:
advanceSearchInfo
Value: (object) - Key:
IsQDXPUBND
Value:
false
- Key:
DonViGop
Value:
false
- Key:
CurentMaDonVi
Value:
T25
- Key:
CurentDonViId
Value:
1046
In YAML (for reference, but the UI will use a form):
Copy code
yaml request_body_json:   sortExpression: "Id desc"   predicate:     advanceSearchInfo:       IsQDXPUBND: false       DonViGop: false       CurentMaDonVi: "T25"       CurentDonViId: "1046"
Summary: In the UI, you will add each key and, for nested objects, add sub-keys as children. This will result in the correct JSON body being sent in your requests. The Airbyte documentation confirms that nested objects are supported in
request_body_json
using the key-value editor in the Connector Builder UI [see reference](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester).
h
@kapa.ai What do you mean when you said: 3. Enter your structure as nested keys, like this: - Key:
sortExpression
Value:
Id desc
- Key:
predicate
Value: (object) - Key:
advanceSearchInfo
Value: (object) - Key:
IsQDXPUBND
Value:
false
- Key:
DonViGop
Value:
false
- Key:
CurentMaDonVi
Value:
T25
- Key:
CurentDonViId
Value:
1046
k
A message from kapa.ai
When I said "Enter your structure as nested keys," I meant that in the Airbyte Connector Builder UI's JSON key-value editor, you should represent your JSON body by creating keys for each field, and for any field whose value is an object, you add its sub-keys as children. This mirrors the structure of your JSON, but in a form-based, hierarchical way. For example, for your JSON:
Copy code
json {   "sortExpression": "Id desc",   "predicate": {     "advanceSearchInfo": {       "IsQDXPUBND": false,       "DonViGop": false,       "CurentMaDonVi": "T25",       "CurentDonViId": "1046"     }   } }
In the UI, you would do the following: - Add a key called
sortExpression
with the value
Id desc
. - Add a key called
predicate
, and for its value, you add another key called
advanceSearchInfo
. - Under
advanceSearchInfo
, you add the keys
IsQDXPUBND
,
DonViGop
,
CurentMaDonVi
, and
CurentDonViId
with their respective values. This approach is supported by Airbyte's
request_body_json
, which allows for nested objects in the request body, as described in the documentation. The UI will typically let you add keys and, for object values, expand them to add sub-keys, matching the nested structure of your JSON body [see documentation](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester). If the UI does not support this directly, you can always use the YAML editor to input the nested structure as shown above.
h
@kapa.ai What do you mean by "- Under
advanceSearchInfo
, you add the keys
IsQDXPUBND
,
DonViGop
,
CurentMaDonVi
, and
CurentDonViId
with their respective values."? There's no option to add anything under
advanceSearchInfo
k
A message from kapa.ai
Thank you for your follow-up. Based on the official Airbyte documentation, when using the Connector Builder UI's JSON key-value editor, you can add nested objects by creating a key and then specifying its value as an object. However, the documentation does not provide detailed step-by-step UI screenshots or explicit instructions for how the UI handles adding sub-keys under a nested object like
advanceSearchInfo
. The documentation does confirm that
request_body_json
supports nested objects in YAML or JSON, for example:
Copy code
yaml request_body_json:   predicate:     advanceSearchInfo:       IsQDXPUBND: false       DonViGop: false       CurentMaDonVi: "T25"       CurentDonViId: "1046"
But it does not specify exactly how the UI allows you to add these nested keys—whether you can do it directly in the UI as nested fields, or if you need to switch to a raw JSON/YAML editor to input the structure manually ([see documentation](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester)). In summary: If the UI does not provide an option to add sub-keys under
advanceSearchInfo
, you may need to use the raw JSON or YAML editor to input the nested structure directly. The knowledge sources do not contain enough information to confirm the exact UI behavior for adding nested keys under an object in the key-value editor.
h
@kapa.ai I'm trying to create a source using file with SFTP option, and when testing it returned the error in the attached file
k
Sorry @Hoang Tran Minh, it looks like your question contains files, which I cannot process. Please reformulate your question without including any files.
h
@kapa.ai I'm trying to create a source of File type using SFTP with the following: host:10.0.0.100 user:Administrator pass:Ab@123456 port:22 file location in the server: "C:\Users\Administrator\Test_CSV.csv" how do I write a valid URL with those info?
k
A message from kapa.ai
To configure a File source in Airbyte using SFTP, you do not use a URL in the traditional sense (like
sftp://...
). Instead, you provide the SFTP connection details (host, port, username, password) and specify the file path as it appears on the SFTP server. Important notes from the documentation: - For SFTP, you need to provide the host address, port, username, password (or key), and the file path. - The file path should be specified as it is accessible from the SFTP server, and for Windows servers, you should use forward slashes (
/
) instead of backslashes (
\
) in the file path, as SFTP expects Unix-style paths ([see SFTP reference](https://docs.airbyte.com/integrations/sources/sftp#reference)). Given your file location:
C:\Users\Administrator\Test_CSV.csv
You should write the file path as:
/Users/Administrator/Test_CSV.csv
Summary of your configuration: - Host:
10.0.0.100
- Port:
22
- Username:
Administrator
- Password:
Ab@123456
- File Path:
/Users/Administrator/Test_CSV.csv
You do not need to construct a URL; just enter these values in the respective fields in the Airbyte UI for the SFTP source connector. The knowledge sources do not mention using a URL field for SFTP; instead, they specify entering the file path and connection details separately ([see SFTP setup guide](https://docs.airbyte.com/integrations/sources/sftp#sftp)). If you are using the File source connector with SFTP as the storage provider, select "SFTP" as the provider and enter the above details in the configuration fields ([see File source storage providers](https://docs.airbyte.com/integrations/sources/file#storage-providers)).
h
@kapa.ai But the URL field is required in the airbyte UI, what do I put in it?
k
A message from kapa.ai
Based on the official Airbyte documentation, when using the File (CSV, JSON, Excel, Feather, Parquet) source connector with SFTP as the storage provider, the URL field should contain the path to the file as it appears on the SFTP server. The documentation does not specify a full SFTP URL format (like
sftp://...
). Instead, it instructs you to enter the file path as it would be accessed via SFTP, using forward slashes. For your example, if your file is located at
C:\Users\Administrator\Test_CSV.csv
on the Windows server, you should enter the path as:
Copy code
/Users/Administrator/Test_CSV.csv
So, in the Airbyte UI: - URL field:
/Users/Administrator/Test_CSV.csv
You do not need to include the host, port, or credentials in the URL field; those are entered in their respective fields in the UI. The knowledge sources do not mention using a full SFTP URL (such as `sftp://user:pass@host:port/path`), only the file path as shown above [see documentation](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup). If you need to specify a folder, you can use the folder path (e.g.,
/Users/Administrator/
). For a single file, use the full file path as above. If you encounter issues, please ensure your SFTP server is accessible and the path is correct. The documentation does not provide an example of a full SFTP URL for the File source connector, so if the UI requires a URL and does not accept just the path, the knowledge sources do not contain enough information to provide a different format.
h
@kapa.ai Testing the source returns: Failed to load sftp:///Users/Administrator/Test_CSV.csv. You could have provided an invalid URL, please verify it: OSError('Failure').
k
A message from kapa.ai
Based on the knowledge sources, when using the File source connector with SFTP as the storage provider, you should provide the file path as it appears on the SFTP server, using forward slashes (e.g.,
/Users/Administrator/Test_CSV.csv
). You do not need to include the protocol (
sftp://
) in the URL field—just the path itself. The error message you received (
Failed to load sftp:///Users/Administrator/Test_CSV.csv
) suggests that the connector is interpreting your input as a URL with the
sftp://
protocol, but the documentation does not instruct you to use this format. Instead, it specifies to enter the file path only, not a full URL ([see File source setup guide](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup)). What you should do: - In the URL field, enter:
Copy code
/Users/Administrator/Test_CSV.csv
(Do not include
sftp://
.) - Make sure you have correctly filled out the SFTP connection details (host, port, username, password) in their respective fields. If you still receive an error, double-check: - The file path is correct and accessible from the SFTP root directory. - The SFTP user has permission to access the file. - The SFTP server is running and reachable from the Airbyte instance. The knowledge sources do not provide an example of using a full SFTP URL (like `sftp://user:pass@host:port/path`) for the File source connector, and instead consistently show only the file path being used ([see documentation](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup)). If the error persists, it may be due to SFTP server permissions or path issues, not the URL format itself.
h
@kapa.ai I didn't include "sftp://", I only enter "/Users/Administrator/Test_CSV.csv" into the URL field
k
A message from kapa.ai
Thank you for clarifying that you only entered
/Users/Administrator/Test_CSV.csv
in the URL field. Based on the official Airbyte documentation, this is the correct approach for the File source connector when using SFTP as the storage provider: you should enter the file path as it appears on the SFTP server, using forward slashes, and not include the protocol or host in the URL field. The host, port, username, and password are provided in their own fields [see documentation](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup). However, since you are still seeing an error (
Failed to load sftp:///Users/Administrator/Test_CSV.csv. You could have provided an invalid URL, please verify it: OSError('Failure')
), this suggests one of the following issues: - The file path may not be correct relative to the SFTP root directory. On many SFTP servers, the root directory for a user is not the system root (
C:\
), but rather the user's home directory or a specific folder. Try adjusting the path to remove the leading slash or use a relative path, such as
Users/Administrator/Test_CSV.csv
or just
Test_CSV.csv
if the file is in the home directory of the SFTP user. - Permissions or access issues. The SFTP user (
Administrator
) may not have permission to access the specified path or file. - SFTP server configuration. Some SFTP servers restrict access to certain directories, or the SFTP root may be mapped differently than the Windows file system path. The knowledge sources do not provide more detailed troubleshooting steps for this specific error or for SFTP on Windows servers. If adjusting the path does not resolve the issue, you may need to check your SFTP server's configuration or try connecting to the server using an SFTP client (like WinSCP or FileZilla) with the same credentials to verify the correct path from the SFTP root. Summary: You are using the correct format for the URL field according to the documentation. The error likely relates to the file path relative to the SFTP root, permissions, or SFTP server configuration, but the knowledge sources do not provide further details for this specific scenario.
h
@kapa.ai When I changed the URL field to just "Test_CSV.csv" I got the following error: Failed to load sftp://Test_CSV.csv. You could have provided an invalid URL, please verify it: FileNotFoundError(2, 'No such file').
k
A message from kapa.ai
Based on the knowledge sources, when using the File source connector with SFTP as the storage provider, the URL field should contain the path to the file as it appears from the SFTP root directory, using forward slashes. You should not include the protocol (
sftp://
) or host information in this field—just the file path itself ([see documentation](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup)). The error message you received (
FileNotFoundError(2, 'No such file')
) when using
"Test_CSV.csv"
as the URL indicates that Airbyte could not find the file at that path on the SFTP server. This suggests that the file path you provided does not match the file's actual location relative to the SFTP root directory for the user you are authenticating as. The knowledge sources do not provide specific troubleshooting steps for SFTP on Windows or for determining the SFTP root directory. They also do not specify how to handle Windows-style paths or SFTP server configurations that may affect the root directory. If both
/Users/Administrator/Test_CSV.csv
and
Test_CSV.csv
do not work, it is likely that the file is not located at those paths relative to the SFTP root, or there may be a permissions issue. Summary: - The correct approach is to enter the file path as it appears from the SFTP root, using forward slashes, in the URL field. - If you receive a "No such file" error, the file path may be incorrect relative to the SFTP root, or there may be a permissions or configuration issue on the SFTP server. - The knowledge sources do not contain enough information to provide further troubleshooting steps for this specific scenario.
h
@kapa.ai I created a file source with a google drive link to a json file that contain data like this: ["test", "test1", "test2"]. But when I create a connection it cannot get any schema from it at all. What happened?
k
A message from kapa.ai
The issue is that your JSON file contains a JSON array (e.g.,
["test", "test1", "test2"]
), not a JSON object or an array of objects. Airbyte expects the file to contain either a JSON object or an array of objects (e.g.,
[{"field": "value"}, ...]
) to infer a schema. According to the documentation, when using the File source connector (including with Google Drive), Airbyte needs to infer a schema from the file's structure. If the file is just a flat array of strings, there are no field names or object structure for Airbyte to use to generate a schema, so schema inference will fail or return nothing [see documentation](https://docs.airbyte.com/integrations/sources/file#file-formats). How to fix: Change your JSON file to an array of objects, for example:
Copy code
json [   {"value": "test"},   {"value": "test1"},   {"value": "test2"} ]
This way, Airbyte can infer a schema with a field called
value
. The knowledge sources do not mention support for flat arrays of primitive types (like strings) for schema inference, only objects or arrays of objects. Summary: Airbyte cannot infer a schema from a JSON file that is just an array of strings. You need to provide a file with objects (with named fields) for schema inference to work.
h
@kapa.ai what's the api url for updating connector builder?
k
A message from kapa.ai
As of Airbyte version 1.6, you can update custom connectors created with the Connector Builder (using a YAML manifest) via the public API. The relevant endpoint for updating a YAML source definition is:
Copy code
PUT /workspaces/{workspaceId}/definitions/declarative_sources/{definitionId}
This endpoint allows you to update a specific YAML source definition in your workspace. You will need your workspace ID and the definition ID of the connector you want to update. This API is available for custom connectors created with a Connector Builder YAML manifest, but not for modifying Airbyte’s public connector definitions [see release notes](https://docs.airbyte.com/release_notes/v-1.6#create-custom-connectors-from-yaml-or-docker-images-using-the-api-and-terraform). For more details and the full list of endpoints, refer to the [API reference documentation](https://reference.airbyte.com/reference/getting-started#/).
h
@kapa.ai how does an airbyte connection handle data types from a source sql server to a postgres destination
k
A message from kapa.ai
When syncing data from a SQL Server (MSSQL) source to a Postgres destination in Airbyte, data types are mapped in two stages: 1. MSSQL Source to Airbyte Types: Airbyte first maps SQL Server data types to its internal Airbyte types. For example: -
int
,
bigint
,
float
,
decimal
,
numeric
, etc. in MSSQL are mapped to the Airbyte type
number
. -
date
,
datetime
,
datetime2
,
smalldatetime
are mapped to Airbyte types like
date
or
timestamp
. - String types (
varchar
,
nvarchar
, etc.) are mapped to
string
. - Complex types like
geometry
or
geography
are mapped to
string
as well. If a type is not recognized, it is coerced into a string. [See MSSQL data type mapping](https://docs.airbyte.com/integrations/sources/mssql#data-type-mapping) 2. Airbyte Types to Postgres Types: When writing to Postgres, Airbyte maps its internal types to the closest compatible Postgres types: -
string
→
VARCHAR
-
number
→
DECIMAL
-
integer
→
BIGINT
-
boolean
→
BOOLEAN
-
object
and
array
→
JSONB
-
timestamp_with_timezone
→
TIMESTAMP WITH TIME ZONE
-
timestamp_without_timezone
→
TIMESTAMP
-
date
→
DATE
[See Postgres schema map](https://docs.airbyte.com/integrations/destinations/postgres#schema-map) Key Points: - Airbyte attempts to preserve data fidelity, but if a type cannot be mapped directly, it may be stored as a string or JSONB. - Some special or complex types (like geometry) may lose fidelity and be stored as strings, which can result in data not being usable in its original form in the destination [see example](https://github.com/airbytehq/airbyte/issues/3199). - If a source column is not recognized or mapped, it may not appear in the destination at all [see forum post](https://discuss.airbyte.io/t/3587). Summary: Airbyte handles data type conversion by mapping source types to internal types, then to destination types. Most common types are mapped appropriately, but some complex or unrecognized types may be stored as strings or omitted if not mapped.
h
@kapa.ai when I test an API connection builder, why does the record object not return the null fields in the response object?
k
A message from kapa.ai
When using the Airbyte Connector Builder, if the record object does not return null fields from the response object, it is because Airbyte's record generation process omits fields with null values by default. This behavior has been observed and reported by users: when the response body contains attributes with null data, the generated records exclude these fields, even though the schema detects them in the Builder. There is currently no documented way to force Airbyte to include these null attributes in the emitted records, and the knowledge sources do not provide a configuration option to change this behavior ([see GitHub issue](https://github.com/airbytehq/airbyte/issues/36061)). In summary, Airbyte omits null fields from records by default in the Connector Builder, and there is no documented setting to include them. If this is critical for your use case, you may need to follow updates on this issue or consider a custom implementation if/when support is added.
h
@kapa.ai when I'm trying to create a file source on airbyte with this GG Drive link containing an excel file: https://drive.google.com/uc?export=download&id=1jPZ1FgHsUwUob3YZny1lf9yQSdqbCqDY But when testing the connection I got this error: 2025-09-12 031028 platform > Docker volume job log path: /tmp/workspace/66efb615-7fb1-4543-b32b-c31232e1673d/0/logs.log 2025-09-12 031028 platform > Executing worker wrapper. Airbyte version: 0.63.13 2025-09-12 031028 platform > Using default value for environment variable SIDECAR_KUBE_CPU_LIMIT: '2.0' 2025-09-12 031028 platform > 2025-09-12 031028 platform > Using default value for environment variable SOCAT_KUBE_CPU_LIMIT: '2.0' 2025-09-12 031028 platform > Using default value for environment variable SIDECAR_KUBE_CPU_REQUEST: '0.1' 2025-09-12 031028 platform > ----- START CHECK ----- 2025-09-12 031028 platform > Using default value for environment variable SOCAT_KUBE_CPU_REQUEST: '0.1' 2025-09-12 031028 platform > 2025-09-12 031028 platform > Checking if airbyte/source-file:0.5.3 exists... 2025-09-12 031028 platform > airbyte/source-file:0.5.3 was found locally. 2025-09-12 031028 platform > Creating docker container = source-file-check-66efb615-7fb1-4543-b32b-c31232e1673d-0-gyokv with resources io.airbyte.config.ResourceRequirements@17d82ec1[cpuRequest=1,cpuLimit=2,memoryRequest=,memoryLimit=,additionalProperties={}] and allowedHosts null 2025-09-12 031028 platform > Preparing command: docker run --rm --init -i -w /data/66efb615-7fb1-4543-b32b-c31232e1673d/0 --log-driver none --name source-file-check-66efb615-7fb1-4543-b32b-c31232e1673d-0-gyokv --network host -v airbyte_workspace:/data -v oss_local_root:/local -e DEPLOYMENT_MODE=OSS -e WORKER_CONNECTOR_IMAGE=airbyte/source-file:0.5.3 -e AUTO_DETECT_SCHEMA=true -e LAUNCHDARKLY_KEY= -e SOCAT_KUBE_CPU_REQUEST=0.1 -e SOCAT_KUBE_CPU_LIMIT=2.0 -e FIELD_SELECTION_WORKSPACES= -e USE_STREAM_CAPABLE_STATE=true -e WORKER_ENVIRONMENT=DOCKER -e AIRBYTE_ROLE=dev -e APPLY_FIELD_SELECTION=false -e WORKER_JOB_ATTEMPT=0 -e OTEL_COLLECTOR_ENDPOINT=http://host.docker.internal:4317 -e FEATURE_FLAG_CLIENT=config -e AIRBYTE_VERSION=0.63.13 -e WORKER_JOB_ID=66efb615-7fb1-4543-b32b-c31232e1673d --cpus=2 airbyte/source-file:0.5.3 check --config source_config.json 2025-09-12 031028 platform > Reading messages from protocol version 0.2.0 2025-09-12 031032 platform > TransportParams: None 2025-09-12 031034 platform > Failed to load https://drive.google.com/uc?export=download&id=1jPZ1FgHsUwUob3YZny1lf9yQSdqbCqDY. You could have provided an invalid URL, please verify it: AttributeError("'DataFrame' object has no attribute 'dtype'"). 2025-09-12 031034 platform > Check failed 2025-09-12 031034 platform > Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@718d012e[status=failed,message=Failed to load https://drive.google.com/uc?export=download&id=1jPZ1FgHsUwUob3YZny1lf9yQSdqbCqDY. You could have provided an invalid URL, please verify it: AttributeError("'DataFrame' object has no attribute 'dtype'").,additionalProperties={}] 2025-09-12 031034 platform > 2025-09-12 031034 platform > ----- END CHECK ----- 2025-09-12 031034 platform > My airbyte is using an external database
k
A message from kapa.ai
Short answer: your URL format is correct, but the File connector is failing while parsing the Excel file. What to check/try: - In the File source config, set File Format to “Excel” (not CSV/JSON). The connector supports Excel, but you must select the correct format. [[File source](https://docs.airbyte.com/integrations/sources/file); [Storage providers](https://docs.airbyte.com/integrations/sources/file#storage-providers)] - Use the Google Drive “download” URL exactly as documented (which you already did): https://drive.google.com/uc?export=download&id=FILE_ID. [[Step 3](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup)] - If the error persists, it can be due to how redirects/content are handled before parsing. There’s an open issue where the File connector doesn’t properly follow some HTTP 302s, which leads to downloading an HTML page instead of the Excel file and then a parse error. Google Drive can return redirects in some cases, producing similar symptoms. Workarounds: host the file on a direct-download URL (S3/GCS/HTTPS), or download/serve it without redirects. [[Redirects issue](https://github.com/airbytehq/airbyte/issues/32073); [Step 3](https://docs.airbyte.com/integrations/sources/file#step-3-complete-the-connector-setup)] If none of the above helps, this is likely a connector-side parsing bug for Excel from that URL. The knowledge sources don’t provide a definitive fix beyond selecting the correct format and avoiding redirecting links.
h
@kapa.ai which table in the airbyte db that stores the read file's infos?
k
A message from kapa.ai
I’m sorry, but the knowledge sources don’t mention any Airbyte internal database table that stores “read file” information. The documented internal Jobs database only contains job/attempt metadata (
jobs
,
attempts
,
airbyte_metadata
). [[Jobs DB](https://docs.airbyte.com/platform/understanding-airbyte/database-data-catalog#jobs-database); [Jobs DB next](https://docs.airbyte.com/platform/next/understanding-airbyte/database-data-catalog#jobs-database)] For file transfers, Airbyte writes file metadata to the destination you configure (e.g., as JSONL with fields like
_airbyte_raw_id
,
_airbyte_data.file_name
,
_airbyte_file_path
), not to the internal Jobs DB. [[Configure metadata](https://docs.airbyte.com/platform/using-airbyte/sync-files-and-records#configure-file-metadata); [Metadata sample](https://docs.airbyte.com/platform/using-airbyte/delivery-methods#configure-file-metadata)]
h
@kapa.ai Failure in destination: Failed to drop table without the CASCADE option. Consider changing the drop_cascade configuration parameter What does this error mean when I'm syncing a connection?
k
A message from kapa.ai
This means the destination tried to drop a table during the sync (e.g., when recreating tables after a schema change/reset), but the drop failed because “Drop tables with CASCADE” is disabled and there are dependent objects (views, foreign keys, indexes, etc.) blocking the drop. What to do: - Enable the “Drop tables with CASCADE” option in your destination settings so Airbyte can drop and recreate the table along with its dependents. Warning: this will also drop any dependent objects and can cause unrecoverable data loss. [[Postgres creating dependent objects](https://docs.airbyte.com/integrations/destinations/postgres#creating-dependent-objects); [Postgres reference](https://docs.airbyte.com/integrations/destinations/postgres#reference)] - Or, remove/adjust the dependent objects yourself (or drop the table manually) and re-run the sync to avoid using CASCADE. [[Postgres creating dependent objects](https://docs.airbyte.com/integrations/destinations/postgres#creating-dependent-objects)] Note: The “Drop tables with CASCADE” setting (drop_cascade) is available in multiple destinations like Postgres and Redshift. Use it only if you understand the consequences. [[Postgres reference](https://docs.airbyte.com/integrations/destinations/postgres#reference); [Redshift reference](https://docs.airbyte.com/integrations/destinations/redshift#reference)]
h
@kapa.ai Then how do I add the option Drop tables with CASCADE when creating a destination through Airbyte api
/api/v1/destinations/create
?
k
A message from kapa.ai
Include the drop_cascade flag inside the destination’s configuration payload when creating the destination via the API. - Public API endpoint: POST /destinations. [[createDestination](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)] - Field name in destination configs: drop_cascade (boolean). [[Postgres reference](https://docs.airbyte.com/integrations/destinations/postgres#reference); [Redshift reference](https://docs.airbyte.com/integrations/destinations/redshift#reference)] Example: Postgres destination with CASCADE drops enabled
Copy code
json {   "name": "Analytics Postgres",   "workspaceId": "2155ae5a-de39-4808-af6a-16fe7b8b4ed2",   "configuration": {     "airbyte_destination_name": "postgres",     "host": "db.example.com",     "port": 5432,     "database": "analytics",     "username": "airbyte",     "password": "******",     "schema": "public",     "ssl": true,     "ssl_mode": { "mode": "prefer" },     "drop_cascade": true   } }
[[createDestination](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml); [Postgres reference](https://docs.airbyte.com/integrations/destinations/postgres#reference)] Example: Redshift destination
Copy code
json {   "name": "DW Redshift",   "workspaceId": "2155ae5a-de39-4808-af6a-16fe7b8b4ed2",   "configuration": {     "airbyte_destination_name": "redshift",     "host": "redshift-cluster.xxxx.aws-region.redshift.amazonaws.com",     "port": 5439,     "database": "dev",     "username": "airbyte",     "password": "******",     "schema": "analytics",     "drop_cascade": true,     "uploading_method": {       "method": "S3_STAGING",       "s3_bucket_name": "my-bucket",       "s3_bucket_region": "us-east-1",       "access_key_id": "AKIA...",       "secret_access_key": "..."     }   } }
[[createDestination](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml); [Redshift reference](https://docs.airbyte.com/integrations/destinations/redshift#reference)] Notes: - Use the destination-specific config schema; drop_cascade is supported by several SQL destinations (e.g., Postgres, Redshift). [[Postgres reference](https://docs.airbyte.com/integrations/destinations/postgres#reference); [Redshift reference](https://docs.airbyte.com/integrations/destinations/redshift#reference)] - If you’re using the legacy OSS API route /api/v1/destinations/create, the concept is the same: put "drop_cascade": true in the configuration object for that destination. The provided spec above documents the current public POST /destinations endpoint. [[createDestination](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)]
h
@kapa.ai I have a file source on airbyte. Why when I call the API
api/v1/connections/last_job_per_stream
It retturns an empty array?
k
A message from kapa.ai
I'm sorry, but the knowledge sources do not contain information about the behavior of the
api/v1/connections/last_job_per_stream
endpoint, especially in relation to file sources or why it might return an empty array. There is no documentation or example in the provided sources that explains this specific API response or its expected behavior for file sources.
h
@kapa.ai No API with the endpoint of
connections/last_job_per_stream
exists? Then how do I get a stream of a job connection through API?
k
A message from kapa.ai
Based on the knowledge sources, there is no mention of an API endpoint named
connections/last_job_per_stream
. The official Airbyte API documentation and references do not list this endpoint, and there is no information about its existence or usage. To get job and stream information for a connection via the API: - You can use the
/jobs
endpoint to list jobs for a specific connection by passing the
connectionId
as a query parameter. This will return job details, including job status and metadata, but not per-stream details directly. Example:
Copy code
GET /jobs?connectionId=<your-connection-id>
This returns a list of jobs for the given connection, including job IDs, statuses, and other metadata [see OpenAPI spec](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml). - The knowledge sources do not describe an API endpoint that returns per-stream job information directly. If you need stream-level details, you may need to inspect the job logs or metadata from the returned jobs, but this is not explicitly documented. Summary: There is no documented
connections/last_job_per_stream
endpoint. To get job information for a connection, use the
/jobs
endpoint with the
connectionId
parameter. The knowledge sources do not provide a way to get per-stream job information directly via the API.
h
@kapa.ai what's the full API endpoint for getting the stream info of an airbyte connection?
k
A message from kapa.ai
I'm sorry, but the knowledge sources do not provide a specific API endpoint for directly retrieving the stream info of an Airbyte connection (such as listing all streams configured for a connection) via the public API. However, you can retrieve the details of a connection—including its configured streams—using the following endpoint:
Copy code
GET /connections/{connectionId}
This endpoint returns the connection details, and within the response, you will find the
configurations.streams
array, which contains information about each stream configured for that connection. The stream info includes the stream name, sync mode, cursor field, and primary key, but not detailed schema information ([see OpenAPI spec](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)). For detailed schema information about streams available for a source/destination pair, you can use:
Copy code
GET /streams?sourceId={sourceId}&destinationId={destinationId}
This returns the available stream properties, including stream names, supported sync modes, and schema fields ([see OpenAPI spec](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)). Summary: - To get the streams configured for a connection:
GET /connections/{connectionId}
- To get available stream properties for a source/destination:
GET /streams?sourceId={sourceId}&destinationId={destinationId}
If you need more granular or per-job/per-stream sync status, the knowledge sources do not provide an endpoint for that.
h
@kapa.ai what's the full API endpoint for getting the current stream info of an airbyte connection
k
A message from kapa.ai
To get the current stream info of an Airbyte connection, you should use the following API endpoint:
Copy code
GET /connections/{connectionId}
This endpoint returns the details of the specified connection, including the
configurations.streams
array, which contains information about each stream configured for that connection (such as stream name, sync mode, cursor field, and primary key). This is the documented way to retrieve the current stream configuration for a connection [see OpenAPI spec](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml). If you need detailed schema information for streams, you can use:
Copy code
GET /streams?sourceId={sourceId}&destinationId={destinationId}
This will provide available stream properties for the given source and destination. The knowledge sources do not mention any other endpoint for retrieving the current stream info of a connection.
h
@kapa.ai why when I call api
/v1/jobs?connectionId=365ced2c-fdd7-491b-b73d-e864a6ddaec6
it returns this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="icon" href="/favicon.ico"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#000000"> <meta name="description" content="Airbyte is the turnkey open-source data integration platform that syncs data from applications, APIs and databases to warehouses."> <meta name="airbyte:sec-token" content="c82db11b-64df-413d-aba8-ee66b99c046f"> <meta name="airbyte:version" content=0.63.13> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/manifest.json"> <link rel="stylesheet" href="/index.css"> <title>Airbyte</title> <script type="module" crossorigin src="/assets/main-dxqyhnd5.js"></script> <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-cm6ok5jwih.js"> <link rel="modulepreload" crossorigin href="/assets/broadcast-channel-d2aggzsa1i.js"> <body> <noscript> <img src="/logo.png" alt="" width="90" height="94"> <div class="card">You need to enable JavaScript to run this app.</div> </noscript> <div id="root"></div> </body> </html>
k
A message from kapa.ai
When you call the API endpoint
/v1/jobs?connectionId=365ced2c-fdd7-491b-b73d-e864a6ddaec6
and receive an HTML page (such as the Airbyte UI or a "You need to enable JavaScript to run this app" message) instead of a JSON response, it usually means that your request is being routed to the Airbyte web frontend rather than the backend API server. Possible reasons for this behavior, based on the knowledge sources: - Incorrect Port or Path: You might be sending the request to the wrong port or path that serves the Airbyte UI, not the API. For example, the UI is typically served on port 8000, while the API might be on a different port or path. - Proxy or Routing Misconfiguration: If you are running Airbyte behind a proxy or using Docker/Kubernetes, the proxy might not be routing
/v1/jobs
to the API server correctly. This has been reported as a common issue when the API is not exposed or routed as expected, resulting in HTML responses instead of JSON ([see related issues](https://github.com/airbytehq/airbyte/issues/33742)). - API Not Enabled or Not Exposed: In some Airbyte deployments, the public API is only available in certain editions or must be explicitly enabled and exposed ([see API access docs](https://docs.airbyte.com/platform/enterprise-setup/api-access-config)). What you can do: - Double-check the URL, port, and path you are using for the API request. Make sure you are targeting the backend API, not the UI. - If you are using a proxy or custom deployment, verify that requests to
/v1/jobs
are routed to the Airbyte API server, not the frontend. - Consult your deployment's documentation to ensure the API is enabled and accessible. The knowledge sources do not provide more specific troubleshooting steps for this scenario, but misrouting to the UI instead of the API is a common cause of receiving HTML instead of JSON from an API endpoint ([see related issue](https://github.com/airbytehq/airbyte/issues/33742)).
h
@kapa.ai I'm using a Docker custom deployment, how do i verify that requests to
/v1/jobs
are routed to the Airbyte API server and not the frontend?
k
A message from kapa.ai
To verify that requests to
/v1/jobs
are routed to the Airbyte API server and not the frontend in a Docker custom deployment, you should: 1. Check the port and service you are targeting: The Airbyte UI (frontend) and the API server may run on different ports or services. If you send API requests to the same port as the UI (commonly 8000), you may get HTML responses instead of JSON. Make sure you are sending requests to the correct port where the API server is listening. The knowledge sources highlight that sending requests to the wrong port or service is a common cause of this issue [see related issue](https://github.com/airbytehq/airbyte/issues/33742). 2. Review your Docker Compose or deployment configuration: Ensure that the API server container is exposed and accessible, and that your proxy (if any) is routing
/v1/jobs
to the API server, not the webapp. Misconfiguration here can cause requests to be routed to the frontend, resulting in HTML responses [see related issue](https://github.com/airbytehq/airbyte/issues/33742). 3. Test the endpoint directly: Try sending a request (e.g., with
curl
) to the API server's port and compare the response. If you get a JSON response, you are hitting the API server. If you get HTML, you are hitting the frontend. The knowledge sources do not provide a step-by-step guide for this verification, but they do confirm that routing issues between the API and frontend are a common cause of receiving HTML instead of JSON from API endpoints. If you continue to receive HTML, double-check your network and proxy configuration to ensure correct routing.
h
@kapa.ai tell me how to use /v1/jobs API
k
A message from kapa.ai
To use the
/v1/jobs
API in Airbyte, you can retrieve job information related to your connections. According to the Airbyte public API specification, the endpoint is used as follows: Endpoint:
Copy code
GET /jobs
Query Parameters: -
connectionId
(string, optional): Filter jobs by a specific connection. -
limit
(integer, optional): Limit the number of jobs returned (default is 20, max is 100). -
offset
(integer, optional): Offset for pagination (default is 0). -
jobType
(string, optional): Filter by job type (
sync
,
reset
). -
workspaceIds
(array of strings, optional): Filter jobs by workspace IDs. -
status
(string, optional): Filter by job status (
pending
,
running
,
incomplete
,
failed
,
succeeded
,
cancelled
). -
createdAtStart
,
createdAtEnd
,
updatedAtStart
,
updatedAtEnd
(string, optional): Filter by creation or update date. -
orderBy
(string, optional): Field and method for ordering. Example Request:
Copy code
http GET /jobs?connectionId=<your-connection-id>&limit=10
Response: A successful response returns a JSON object with a
data
array, where each item contains job details such as
jobId
,
status
,
jobType
,
startTime
,
connectionId
, and other metadata. Note: - This endpoint does not require authentication by default, but your deployment may require it depending on your configuration. - Make sure you are sending the request to the correct API server endpoint, not the Airbyte UI, to avoid receiving an HTML response instead of JSON ([see OpenAPI spec](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)). If you receive an HTML response, it likely means your request is being routed to the frontend instead of the API server. Double-check your deployment and routing configuration to ensure you are targeting the correct service.
h
@kapa.ai after calling /v1/jobs API using curl I got this {"message":"Unauthorized","_embedded":{"errors":[{"message":"Unauthorized","_embedded":{},"_links":{}}]},"_links":{"self":{"href":"/api/public/v1/jobs?connectionId=c9bdb4f1-c803-4786-81e0-95e08c1c4251","templated":false}}}
k
A message from kapa.ai
The error message
{"message":"Unauthorized", ...}
indicates that your request to the
/v1/jobs
API endpoint is missing the required authentication. According to the Airbyte documentation, you need to include a valid access token (Bearer token) in your API request headers to authenticate. The process to obtain this token depends on your Airbyte deployment (Cloud or Self-Managed): 1. Obtain an Access Token: - For Self-Managed, you must first create an application in the Airbyte UI to get a
client_id
and
client_secret
. - Use these credentials to request an access token from the API:
Copy code
http      POST <YOUR_WEBAPP_URL>/api/v1/applications/token      Content-Type: application/json       {        "client_id": "<your_client_id>",        "client_secret": "<your_client_secret>"      }
- The response will include an
access_token
(Bearer token) [see documentation](https://docs.airbyte.com/platform/1.7/using-airbyte/configuring-api-access). 2. Call the
/v1/jobs
API with the Access Token:
- Add the following header to your
curl
request:
Copy code
-H "Authorization: Bearer <your_access_token>"
- Example:
Copy code
bash      curl -X GET "<YOUR_WEBAPP_URL>/api/public/v1/jobs?connectionId=<your-connection-id>" \        -H "Authorization: Bearer <your_access_token>"
Summary: You are receiving "Unauthorized" because your request is missing the required Bearer token. Obtain an access token as described above and include it in your API request header [see documentation](https://docs.airbyte.com/platform/1.7/using-airbyte/configuring-api-access).
h
@kapa.ai I have an existing table, and after I'm running a connection with a stream with sync mode as incremental append (the existing table and the stream has the same fields), why does no data have been transferred?
k
A message from kapa.ai
If you are using Incremental Append sync mode and no data has been transferred, even though your existing table and the stream have the same fields, the most likely reason is that there have been no new or updated records in the source since the last sync. In Incremental mode, Airbyte only transfers records that are new or have been updated since the last synchronization, based on the cursor field (such as an
updated_at
timestamp). If the source data hasn't changed, no records will be emitted or transferred, and the destination table will remain unchanged ([see tutorial](https://airbyte.com/tutorials/incremental-data-synchronization#step-7)). Additionally, if the cursor field is not properly updated when records are modified in the source, those changes will not be detected by Airbyte and thus not transferred. The incremental sync relies on the cursor field to identify new or changed records. If the cursor field (e.g.,
updated_at
) is not updated when a record changes, Airbyte will not pick up the change ([see known limitations](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append#known-limitations)). Summary: - No data is transferred if there are no new or updated records since the last sync. - Ensure the cursor field is correctly configured and updated in your source data. - This is expected behavior for Incremental Append sync mode. If you want to transfer all data regardless of changes, consider using Full Refresh sync mode instead.
A message from kapa.ai
Your observations align with how Incremental Sync - Append + Deduped mode is designed to work in Airbyte: 1. First sync after deleting all data in the destination: When you delete all data in the destination and run the sync, Airbyte treats this as if the destination is empty. All records from the source that meet the incremental criteria (i.e., have a cursor value greater than the last synced value, or all records if this is the first sync) are transferred and loaded into the destination. The deduplication process ensures that only the latest version of each record (based on the primary key and cursor field) is present in the final table [see rules](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#rules). 2. Second sync after updating source data: When you update data in the source (increase cursor values and change other columns, while keeping the primary key intact), Airbyte detects these as new or updated records because their cursor values are now greater than the last synced value. During the sync, only these new or updated records are transferred. The deduplication process in the destination ensures that for each primary key, only the record with the latest cursor value is kept in the final table [see overview](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped). This behavior is expected and matches the documented logic for Incremental Sync - Append + Deduped mode: - Only new or updated records (based on the cursor field) are transferred. - The final table in the destination contains a single, up-to-date record per primary key, deduplicated by the cursor field [see high-level context](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped). If you observe this pattern, your Airbyte connection is functioning as intended for this sync mode.
h
@kapa.ai I'm syncing an airbyte connection (postgres source to postgres destination) with a stream with Incremental Sync - Append + Deduped mode: • First, I'm deleting all existing data in the existing table in destination db, then sync the connection. It's a success, and there are data being transferred and records loaded. • Second, I'm changing the data in the source table (increasing cursor values (the cursor column has int values), changing data in other column, primary key column intact) then sync the connection. It's a success, and there are new data being transferred and records loaded. • Third, I'm repeating step 1. It's still a success, but there are no new data being transferred and no new records loaded. What happened?
k
A message from kapa.ai
In your scenario with Incremental Sync - Append + Deduped mode, the behavior you observed is expected and explained by how Airbyte tracks incremental syncs: - First sync after deleting all data in the destination: Airbyte does not reset its internal state or cursor just because you deleted data in the destination table. It still remembers the last cursor value it synced from the source. So, it only transfers records from the source that have a cursor value greater than the last synced value. If this is the very first sync (no state), all records are transferred ([see documentation](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped)). - Second sync after updating source data: When you update records in the source (with higher cursor values), Airbyte detects these as new or updated and syncs them, updating its internal state to the latest cursor value. - Third sync after deleting all data in the destination again: Even though you deleted all data in the destination, Airbyte's internal state (the last synced cursor value) is not reset. Therefore, unless there are new or updated records in the source with a cursor value greater than the last synced value, no data will be transferred. Airbyte does not re-sync old data just because the destination table is empty; it relies on its state to avoid re-sending already-synced records ([see documentation](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped)). Summary: Deleting data in the destination does not reset Airbyte's incremental sync state. To re-sync all data, you would need to reset the connection in Airbyte, which clears the state and causes a full re-sync. The knowledge sources confirm this is the expected behavior for incremental sync modes.