<@U04S8PLJWMT> I am using Airbyte Self hosted vers...
# ask-ai
a
@kapa.ai I am using Airbyte Self hosted version. How to create a connection using the api. I have username and password as credentials?
k
To create a connection using the Airbyte API in the self-hosted version with username and password credentials, you'll need to follow these steps: 1. First, you need to obtain an access token using your username and password. 2. Then, you can use that access token to make API requests to create a connection. Here's a more detailed breakdown: 1. Obtain an access token: Make a POST request to the following endpoint:
Copy code
POST <YOUR_WEBAPP_URL>/api/v1/applications/token
Include this JSON body in your request, replacing with your actual credentials:
Copy code
json {    "client_id": "your_username",    "client_secret": "your_password"  }
This will return an
access_token
which you'll use for subsequent API calls. 2. Create a connection: Once you have the access token, you can make a POST request to create a connection:
Copy code
POST <YOUR_WEBAPP_URL>/api/public/v1/connections
Include your access token as a Bearer token in the Authorization header. The request body should look something like this:
Copy code
json {   "sourceId": "YourSourceID",   "destinationId": "YourDestinationID",   "name": "Your Connection Name",   "schedule": {     "scheduleType": "manual"   },   "dataResidency": "auto",   "namespaceDefinition": "destination",   "namespaceFormat": null,   "nonBreakingSchemaUpdatesBehavior": "ignore",   "configurations": {     "streams": [       {         "syncMode": "full_refresh_overwrite",         "name": "YourTableName"       }     ]   } }
Make sure to replace
YourSourceID
,
YourDestinationID
, and other placeholders with your actual values. For more detailed information on the API endpoints and request/response formats, you can refer to the [Airbyte API Reference](https://reference.airbyte.com/reference/start). Please note that the exact steps might vary depending on your specific Airbyte setup and version. If you encounter any issues, you may need to consult your specific Airbyte documentation or reach out to Airbyte support. [Airbyte Public API - Connections](https://reference.airbyte.com/reference/start) [Configuring API Access](https://docs.airbyte.com/enterprise-setup/api-access-config)