SweetConnect LogoSweetConnect
ApiDatasources

Update an existing datasource

Partially update fields of an existing datasource by its UUID. You can:

  • send only 'name' to rename the datasource

  • send 'datasourceType' and 'adapter' to change the adapter configuration

  • or send all three fields to update name and adapter in one request

When 'adapter' is present, 'datasourceType' is mandatory and controls how the adapter object is validated.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
PATCH
/v1/datasources/{datasourceId}

Path Parameters

datasourceId*string

UUID of the datasource

Formatuuid

Request Body

application/json

Partial update payload. At least one of 'name' or ('datasourceType' + 'adapter') must be provided.

datasourceType?string

Type of the datasource. Required when creating or updating the adapter

Value in"InfluxDB_v2" | "InfluxDB_v3" | "Inuatek"
name?string

Name of the datasource

adapter*|

The connection information of the datasource. If provided, the datasourceType field must also be provided and must match the structure of the adapter

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://my.sweetconnect.io/api/databus-controller/v1/datasources/9488c561-749f-4b3d-8c2f-30e867ba66db" \  -H "Content-Type: application/json" \  -d '{    "name": "new-name"  }'
{
  "data": {
    "affected": "1"
  }
}
{
  "errors": [
    {
      "errorCode": "RequestValidationError",
      "message": "The 'username' field is required.",
      "extension": {
        "type": "body",
        "key": "username"
      }
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "Unauthorized",
      "message": "Authentication is required to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NoPermission",
      "message": "You do not have permission to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected internal server error occurred.",
      "extension": {}
    }
  ]
}