Hi, I am working on creating an api with which I c...
# replication-troubleshooting
c
Hi, I am working on creating an api with which I can create a source, but I need to build the connector first. Is there a way to make an api for building, as publish api gives sourcedefinitionID as output, which we can further use to create a source.
k
Yes, you can programmatically create custom connectors (source definitions) in Airbyte using the public API. Once you have created a connector (source definition), you will receive a
sourceDefinitionId
, which you can then use to create a source instance via the API. How to build and publish a connector via API: - If you are using a YAML manifest (created with Connector Builder), you can use the following API endpoints: -
POST /workspaces/{workspaceId}/definitions/declarative_sources/
to create a new YAML source definition. - The response will include the
sourceDefinitionId
you need for subsequent source creation. - If you are using a Docker image for your connector, use: -
POST /workspaces/{workspaceId}/definitions/sources/
to create a new Docker-based source definition. Limitations: - These endpoints are for creating custom connectors in your own workspace. You cannot use them to modify Airbyte’s public connector definitions. - In Airbyte Cloud, only YAML manifest-based custom connectors are supported via the API. References and further details: - [Create custom connectors from YAML or Docker images using the API](https://docs.airbyte.com/release_notes/v-1.6#create-custom-connectors-from-yaml-or-docker-images-using-the-api-and-terraform) - [API reference docs](https://reference.airbyte.com/reference/getting-started#/) Typical workflow: 1. Build your connector (using Connector Builder for YAML, or your own Docker image). 2. Use the API to publish the connector and obtain the
sourceDefinitionId
. 3. Use the
sourceDefinitionId
in the API call to create a source instance. This approach allows you to automate the entire process of connector creation and source instantiation via API calls, as you described. If you need more details on the exact API payloads, refer to the [API reference docs](https://reference.airbyte.com/reference/getting-started#/).