Create a data source
- Last Updated: August 11, 2025
- 3 minute read
- Hybrid Data Pipeline
- Version 5.0
- Documentation
Purpose
Creates a data source or group data source. The user who creates the data source is the owner of the data source. When an administrator creates a data source on behalf of a user, the user identified with the user query parameter is the owner of the data source.
- When using the Data Sources API to configure Snowflake for key-pair authentication, the multiline format of the private key must be modified for the JSON request payload. See Configuring Snowflake key-pair authentication using the API for details.
- A group data source is a data source that is comprised of member data sources. The creation and configuration of group data sources allows a single OData endpoint to be configured for multiple member data sources. See Configuring OData connectivity for details.
- An administrator can execute this operation on behalf of a user by appending the user query parameter to the request and specifying a user name. See also Managing resources on behalf of users.
- Permissions can only be set on a data source by an administrator when creating or updating the data source on behalf of a user.
URL
https://<myserver>:<port>/api/mgmt/datasources
Method
POST
URL Parameters
<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a non-load balancer deployment, or the machine hosting the load balancer for a load balancer deployment. For a non-load balancer deployment, <port> is the port number specified as the Server Access Port during deployment. For a load balancer deployment, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.
Request Definition
{
"name": "datasource_name",
"dataStore": datastore_id,
"connectionType": "connection_type",
"description": "datasource_description",
"options": {
"option1": "option1_value",
"option2": "option2_value",
...
},
"permissions": [integer, integer, ...],
"members": ["datasource1", "datasource2", ...]
}
| Parameter | Description | Usage | Valid Values |
|---|---|---|---|
| "name" | The name of the data source. This name is passed as a database parameter when establishing a connection to the data source with the ODBC driver, the JDBC driver, or the OData API. | Required | The first character of the name must be a letter, and the name can contain only alphanumeric characters, underscores, and dashes. |
| "dataStore" | The ID of the data store on which the data source
is being created. The data store defines the options that can be
specified when creating the data source. Group data sources must be created on the Hybrid Data Pipeline group data store. A group data source is comprised of multiple member data sources that connect to one or more back end data stores such as Salesforce or SQL Server. |
Required | The integer ID of the data store If you are
creating a group data source, this property must be set to 56 to
specify the Data store IDs can be obtained with the Get data stores call. |
| "connectionType" | Specifies whether the data source is a cloud, hybrid, or group data source | Required | "Cloud" |
"Hybrid" | GroupIf set to
If set
to If set to |
| "description" | A description of the data source | Optional | A description of the data source provided by the user who created the data source |
| "options" | The list of option names and values to be set on the data source. The list of allowed options depends on the data store. Data store options can be retrieved with the Get options for a data store call. | Required | A comma separated list of options and their
values. The content of the options object is zero or more sets of option names and values. If no options are to be set on the data source, specify an empty object {}. |
| "permissions" | A list of permissions associated explicitly with
the data source. Permissions can only be set on a data source by an
administrator when creating or updating the data source on behalf of
a user. Any permissions specified for this data source will override the permissions for the user or the user's role that own this data source. You must specify the exact set of permissions that you want to set for this data source as no permissions are inherited from the user or user's role if permissions are specified on a data source. Permissions set on a group data source override permissions set on any of its member data sources. |
Optional | A comma separated list of permission IDs See Data source permissions for supported permissions. |
| "members" | The members object can be used to assign member data sources to a group data source. A member data source cannot itself be a group data source. Member data sources can be assigned when a group data source is being created or added after the group data source has been created. | Optional | The members object includes an "id" property and
an "entityPrefix" property. The "id" specifies the ID of a member data source. The member data source cannot itself be a group data source. The "entityPrefix" is a user-defined prefix associated with a specific data source to resolve naming conflicts. The prefix must be 1 to 64 characters in length and must be unique. |
Example 1: Request Payload
In this example, a standard user creates a data source on a Salesforce data store.
POST https://Server03:8443/api/mgmt/datasources
{
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
}
}
Success Response
Status code: 201
Successful response
{
"id":"5039",
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
}
}
Example 2: Request Payload
In this example, an administrator creates a data source with permissions on behalf of a user. The user's access to the data store is restricted by the permissions.
https://Server03:8443/api/mgmt/datasources?user=user11
{
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
},
"permissions": [
1,
2,
3,
4,
5
]
}
Success Response
Status code: 201
Successful response
{
"id":"6444",
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
},
"permissions": [
1,
2,
3,
4,
5
]
}
Example 3: Request Payload
In this example, a standard user creates a group data source for testing OData access.
https://Server03:8443/api/mgmt/datasources
{
"name": "OData_Group",
"dataStore": "56",
"connectionType": "Group",
"description": "Test OData connectivity",
"options": {
"Name": "OData_Group",
"Description": "Test OData connectivity",
"ODataVersion": "4",
"MaximumEntityNameLength": "64"
},
"members": [
{
"id": 3,
"entityPrefix": "fin"
},
{
"id": 6,
"entityPrefix": "mkt"
}
]
}
Sample Success Responses
Status code: 201
Successful response
{
"id":"7255",
"name": "OData_Group",
"dataStore": "56",
"connectionType": "Group",
"description": "Test OData connectivity",
"options": {
"Name": "OData_Group",
"Description": "Test OData connectivity",
"ODataVersion": "4",
"MaximumEntityNameLength": 64,
},
"members": [
{
"id": 3,
"entityPrefix": "fin"
},
{
"id": 6,
"entityPrefix": "mkt"
}
]
}
Example 4: Request Payload
In this example, a standard user creates a data source with OData access.
https://Server03:8443/api/mgmt/datasources
{
"name": "OData_Test",
"dataStore": "61",
"connectionType": "Hybrid",
"description": "Test OData datasource",
"options": {
"User": "test_user",
"Password": "secret",
"URL": "jdbc:testdb:testsql://myserver:9001/useraccount",
"ODataVersion": "4",
"DriverClass": org.testdb.jdbcDriver",
"ODataNameMappingCase": "Uppercase",
"ODataSchemaMap": "{\"odata_mapping_v4\":{\"schemas\":[{\"name\":\"D2CQA01\",
\"tables\":{\"Dept_Emp\":{},\"Employees\":{},\"Departments\":{},\"Salaries\":{},
\"Titles\":{},\"Dept_Manager\":{}}}]}}",
},
}
Sample Success Responses
Status code: 201
Successful response
{
"id":"8299",
"name": "OData_Test",
"dataStore": "61",
"connectionType": "Hybrid",
"description": "Test OData datasource",
"options": {
"User": "test_user",
"Password": "secret",
"URL": "jdbc:testdb:testsql://myserver:9001/useraccount",
"ODataVersion": "4",
"DriverClass": org.testdb.jdbcDriver",
"ODataNameMappingCase": "Uppercase",
"ODataSchemaMap": "{\"odata_mapping_v4\":{\"schemas\":[{\"name\":\"D2CQA01\",
\"tables\":{\"Dept_Emp\":{},\"Employees\":{},\"Departments\":{},\"Salaries\":{},
\"Titles\":{},\"Dept_Manager\":{}}}]}}",
},
}
Authentication
Basic Authentication using Login ID and Password.
Authorization
The user must have the MgmtAPI (11) and CreateDataSource (1) permissions.