<@U04S8PLJWMT> I am trying to use airbyte api to f...
# ask-ai
p
@kapa.ai I am trying to use airbyte api to fetch workspace names (or any other request) i am getting a forbidden error. currently im on a free trial plan which has around 400 credit tokens please let me know why am i not getting lists
k
If you are receiving a "forbidden" error (HTTP 403) when trying to fetch workspace names or make other requests to the Airbyte API, there are a few likely reasons based on the official documentation: 1. API Access Configuration: You must first configure API access by creating an application in the Airbyte UI, obtaining a
client_id
and
client_secret
, and then exchanging those for an
access_token
. This token must be included as a Bearer token in your API requests. If you skip any of these steps or use an expired/invalid token, you will receive a forbidden error. Make sure you are following the correct process for your Airbyte deployment (Cloud or Self-Managed) and using the correct endpoints and tokens. [See detailed steps here](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access). 2. Token Expiry: Access tokens are short-lived (typically 3 minutes for most plans, 60 minutes for Self-Managed Enterprise). If your token has expired, you must request a new one before making API calls. [Token validity details](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access). 3. Permissions: Application keys (client credentials) are tied to user permissions. If your user does not have the necessary permissions to list workspaces or perform the requested action, you will receive a forbidden error. Ensure your user account has the correct permissions in the Airbyte workspace. [Permissions info](https://docs.airbyte.com/platform/enterprise-setup/api-access-config). 4. API Endpoint: Make sure you are using the correct API endpoint for your plan. For example, for the Core plan, use the
/api/public/v1
path prefix. [API endpoint info](https://docs.airbyte.com/platform/api-documentation). 5. Free Trial Limitations: The documentation does not mention any API restrictions specific to free trial plans with available credits. As long as you have credits and have configured API access correctly, you should be able to use the API. Summary: A "forbidden" error is almost always due to missing or invalid authentication, expired tokens, or insufficient permissions. Double-check your API access setup, ensure your token is valid and included in the request, and verify your user permissions. If you have followed all steps and still encounter issues, it may be worth reaching out to Airbyte support for further assistance, as the documentation does not mention any API block for free trial users with credits. References: - [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access) - [API Documentation](https://docs.airbyte.com/platform/api-documentation) - [Enterprise API Access](https://docs.airbyte.com/platform/enterprise-setup/api-access-config)
p
@kapa.ai i dont have a core plan its free trial
k
A message from kapa.ai
Thank you for clarifying that you are on a free trial and not on the Core plan. Based on the knowledge sources, the Airbyte API is available for all Airbyte plans, including free trials, as long as you have configured API access correctly. The documentation does not mention any API restrictions specific to free trial users with available credits. The most common reasons for receiving a "forbidden" error (HTTP 403) are: - API Access Not Configured Properly: You must create an application in the Airbyte UI, obtain a
client_id
and
client_secret
, and exchange them for an
access_token
. This token must be included as a Bearer token in your API requests. If you skip any of these steps or use an expired/invalid token, you will receive a forbidden error. [See: Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access) - Token Expiry: Access tokens are short-lived. If your token has expired, you need to request a new one before making API calls. - Permissions: Application keys are tied to user permissions. If your user does not have the necessary permissions to list workspaces or perform the requested action, you will receive a forbidden error. - Correct Endpoint: Make sure you are using the correct API endpoint for your plan. For most plans, you should use the
/api/public/v1
path prefix (e.g.,
/api/public/v1/workspaces
) for listing workspaces. The knowledge sources do not explicitly mention any API limitations for free trial users with credits. If you have followed all the correct steps and are still receiving a forbidden error, it is likely due to one of the reasons above. If the issue persists after verifying your setup, you may need to contact Airbyte support, as there is no further troubleshooting information for free trial API access in the provided documentation. If you need step-by-step instructions for configuring API access, let me know!
p
@kapa.ai im using this endpoint https://api.airbyte.com/api/public/v1/workspaces/list and ive added bearer and in raw json im sending {}
k
A message from kapa.ai
The endpoint you are using,
https://api.airbyte.com/api/public/v1/workspaces/list
, does not match the documented Airbyte API endpoints for listing workspaces. According to the official documentation, to list workspaces you should use a GET request to:
Copy code
https://api.airbyte.com/api/public/v1/workspaces
or
Copy code
GET /api/public/v1/workspaces
You do not need to send a raw JSON body for this request; it should be a simple GET request with your Bearer token in the Authorization header. Sending a POST request or using
/workspaces/list
is not supported for listing workspaces and will result in errors such as "forbidden" or "not found" because the endpoint does not exist or is not allowed. Correct usage example:
Copy code
http GET https://api.airbyte.com/api/public/v1/workspaces Authorization: Bearer <your_access_token>
Make sure: - You are using the correct endpoint (
/workspaces
not
/workspaces/list
). - You are making a GET request, not POST. - Your Bearer token is valid and not expired. If you follow these steps and still receive a forbidden error, double-check your token and permissions as described earlier. The documentation does not mention any need to send a JSON body for this endpoint, nor does it mention a
/list
sub-path for workspaces in the public API [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access) | [API Reference](https://reference.airbyte.com/reference/start). If you continue to have issues after correcting the endpoint and method, it may be necessary to contact Airbyte support, as the knowledge sources do not provide further troubleshooting steps for this scenario.
p
@kapa.ai <html><head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>400 Bad Request</title> </head> <body text=#000000 bgcolor=#ffffff> <h1>Error: Bad Request</h1> <h2>Your client has issued a malformed or illegal request.</h2> <h2></h2> </body></html>
k
A message from kapa.ai
The error message "400 Bad Request" means that the request you sent to the Airbyte API is malformed or not in the expected format. Based on the knowledge sources, here are the most common reasons for this error when listing workspaces: 1. Incorrect HTTP Method or Endpoint The correct way to list workspaces is to send a GET request to:
Copy code
https://api.airbyte.com/api/public/v1/workspaces
Do not use
/workspaces/list
or send a POST request with a JSON body. The API expects a GET request with no body for this endpoint [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access). 2. Unnecessary Request Body For a GET request to
/workspaces
, you should not include a JSON body. Including a body in a GET request can cause a 400 error. 3. Malformed Headers Ensure your Authorization header is set correctly:
Copy code
Authorization: Bearer <your_access_token>
Example of a correct curl request:
Copy code
bash curl -X GET "https://api.airbyte.com/api/public/v1/workspaces" \   -H "Authorization: Bearer <your_access_token>"
Summary: - Use the correct endpoint:
/api/public/v1/workspaces
- Use the GET method, not POST - Do not include a request body - Ensure your Bearer token is valid and in the Authorization header If you follow these steps and still get a 400 error, double-check your access token and endpoint spelling. If the problem persists, the knowledge sources do not provide further troubleshooting steps for this specific error.
p
@kapa.ai i am still getting this { "message": "Forbidden", "_embedded": { "errors": [ { "message": "Forbidden", "_embedded": {}, "_links": {} } ] }, "_links": { "self": { "href": "/api/public/api/public/v1/workspaces", "templated": false } } } ive used correct access token and correct api as you sent me
k
A message from kapa.ai
Based on the knowledge sources, if you are receiving a response like:
Copy code
json {     "message": "Forbidden",     "_embedded": {         "errors": [             {                 "message": "Forbidden",                 "_embedded": {},                 "_links": {}             }         ]     },     "_links": {         "self": {             "href": "/api/public/api/public/v1/workspaces",             "templated": false         }     } }
even after using the correct access token and endpoint, here are the most likely causes according to the official Airbyte documentation: 1. Token or Permissions Issue - The access token you are using must be generated from an application created in the Airbyte UI, and the user associated with that application must have the necessary permissions to access the workspace list. If the user does not have access, or if the token is invalid or expired, you will receive a "Forbidden" error ([Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)). - Double-check that you are using a freshly generated token (they expire quickly, especially on non-Enterprise plans). 2. Endpoint Path Issue - The path in your error response shows
/api/public/api/public/v1/workspaces
, which is incorrect. The correct path should be
/api/public/v1/workspaces
. Make sure you are not accidentally duplicating the path prefix in your request URL. 3. Plan or Feature Limitation - The knowledge sources do not mention any API restrictions for free trial users with available credits. As long as you have credits and have configured API access correctly, you should be able to use the API. What you should do: - Ensure your request is to
https://api.airbyte.com/api/public/v1/workspaces
(not
/api/public/api/public/v1/workspaces
). - Use a valid, non-expired access token in the Authorization header. - Make sure the user who created the application has permission to list workspaces. Example curl command:
Copy code
bash curl -X GET "https://api.airbyte.com/api/public/v1/workspaces" \   -H "Authorization: Bearer <your_access_token>"
If you have verified all of the above and still receive a "Forbidden" error, the knowledge sources do not provide further troubleshooting steps for this scenario. In that case, you may need to contact Airbyte support for assistance, as there may be an account-specific or backend issue not covered in the documentation. References: [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access), [API Documentation](https://docs.airbyte.com/platform/api-documentation)