Introduction

The IBM® Cloud Pak for Data Platform API connects to your Cloud Pak for Data platform to manage your user account. Administrators can also manage the users who have access to the platform, manage roles, and monitor the status of the platform.

Authentication

To authenticate to the API, you pass an access token in an Authorization header. The token is associated with a user name. To generate an access token, call the Get authorization token method.

Generating an access token. The response includes a token property.

Replace {cpd_cluster_host} and {port} with the details for the service instance. Replace {username} and {password} with your IBM Cloud Pak for Data credentials.

curl -k -X POST -d "{\"username\":\"{username}\",\"password\":\"{password}\"}" "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize"

Authenticating to the API. Replace {token} with your details.

curl -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/v1/{method}"

Service endpoint

The service endpoint is based on your IBM Cloud Pak deployment URL.

https://{cpd_cluster_host}{:port}/icp4d-api/v1/{method}

For example, if your instance is deployed at https://www.example.com:31843, you can access the APIs at https://www.example.com:31843/icp4d-api/v1/{method}.

Example

curl -H "Authorization: Bearer {token}" -X {request_method} "https://{cpd_cluster_host}{:port}/icp4d-api/v1/{method}"

Disabling SSL verification

All Cloud Pak for Data services use Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.

If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.

Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if absolutely necessary, and take steps to enable SSL as soon as possible.

To disable SSL verification for a curl request, use the --insecure (-k) option with the request.

Example that disables SSL verification

curl -k -X {request_method} -H "Authorization: Bearer {token}" "{url}/v1/{method}"

Error handling

IBM Cloud Pak for Data uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.

ErrorResponse

Name Description
messageCode
string
An identifier of the response.
statusCode
integer
The HTTP response code.
exception
string
An explanation of the problem.
message
string
An explanation of the messageCode.

IBM Cloud Pak for Data docs

  • Watson Data API: Manage data-related assets and the people who need to use these assets.
  • Watson Machine Leaning API: Build and train analytical models and neural networks.
  • Watson OpenScale API: Measure the outcomes of your AI models.
  • Watson APIs for Cloud Pak for Data
    • Watson Assistant API: v2 | v1
    • Watson Discovery API v1
    • Watson API Kit
      • Natural Language Understanding API
      • IBM Watson Speech to Text API
      • IBM Watson Text to Speech API

Methods

Get authorization token

Generate a bearer token from your Cloud Pak for Data credentials.

Generate a bearer token from your Cloud Pak for Data credentials.

Generate a bearer token from your Cloud Pak for Data credentials.

Generate a bearer token from your Cloud Pak for Data credentials.

Generate a bearer token from your Cloud Pak for Data credentials.

POST /v1/authorize
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetAuthorizationToken(getAuthorizationTokenOptions *GetAuthorizationTokenOptions) (*core.DetailedResponse, error)
ServiceCall<LoginResponse> getAuthorizationToken(GetAuthorizationTokenOptions getAuthorizationTokenOptions)
getAuthorizationToken(params, [callback()])
get_authorization_token(self, password, username, **kwargs)
Request

Instantiate the GetAuthorizationTokenOptions struct and set the fields to provide parameter values for the GetAuthorizationToken method.

Use the GetAuthorizationTokenOptions.Builder to create a GetAuthorizationTokenOptions object that contains the parameter values for the getAuthorizationToken method.

The GetAuthorizationToken options.

The getAuthorizationToken options.

parameters

  • IBM Cloud Pak for Data password.

  • IBM Cloud Pak for Data user name.

parameters

  • IBM Cloud Pak for Data password.

  • IBM Cloud Pak for Data user name.

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal error

Example responses

Get all users

Returns all users in the cluster.

Returns all users in the cluster.

Returns all users in the cluster.

Returns all users in the cluster.

Returns all users in the cluster.

GET /v1/users
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetAllUsers(getAllUsersOptions *GetAllUsersOptions) (*core.DetailedResponse, error)
ServiceCall<GetAllUsersResponse> getAllUsers()
getAllUsers(params, [callback()])
get_all_users(self, **kwargs)
Request

Custom Headers

  • The bearer token associated with a user name.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Create user

Create a user account for the cluster.

Create a user account for the cluster.

Create a user account for the cluster.

Create a user account for the cluster.

Create a user account for the cluster.

POST /v1/users
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) CreateUser(createUserOptions *CreateUserOptions) (*core.DetailedResponse, error)
ServiceCall<CreateUserSuccessResponse> createUser(CreateUserOptions createUserOptions)
createUser(params, [callback()])
create_user(self, display_name, email, user_name, user_roles, **kwargs)
Request

Instantiate the CreateUserOptions struct and set the fields to provide parameter values for the CreateUser method.

Use the CreateUserOptions.Builder to create a CreateUserOptions object that contains the parameter values for the createUser method.

Custom Headers

  • The bearer token associated with a user name.

The new user.

Example:

The CreateUser options.

The createUser options.

parameters

  • The name that is displayed for this user.

  • The user's email address.

  • The user name.

  • The roles assigned to the user.

parameters

  • The name that is displayed for this user.

  • The user's email address.

  • The user name.

  • The roles assigned to the user.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Get user information

Get details about one user.

Get details about one user.

Get details about one user.

Get details about one user.

Get details about one user.

GET /v1/users/{user_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetUser(getUserOptions *GetUserOptions) (*core.DetailedResponse, error)
ServiceCall<GetUserResponse> getUser(GetUserOptions getUserOptions)
getUser(params, [callback()])
get_user(self, user_name, **kwargs)
Request

Instantiate the GetUserOptions struct and set the fields to provide parameter values for the GetUser method.

Use the GetUserOptions.Builder to create a GetUserOptions object that contains the parameter values for the getUser method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The user name.

The GetUser options.

The getUser options.

parameters

  • The user name.

parameters

  • The user name.

Response

Status Code

  • Success

  • Unauthorized

  • Not Found

  • Internal error

Example responses

Update user details

Update information about a user account.

Update information about a user account.

Update information about a user account.

Update information about a user account.

Update information about a user account.

PUT /v1/users/{user_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) UpdateUser(updateUserOptions *UpdateUserOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> updateUser(UpdateUserOptions updateUserOptions)
updateUser(params, [callback()])
update_user(self, user_name, approval_status=None, display_name=None, email=None, user_roles=None, **kwargs)
Request

Instantiate the UpdateUserOptions struct and set the fields to provide parameter values for the UpdateUser method.

Use the UpdateUserOptions.Builder to create a UpdateUserOptions object that contains the parameter values for the updateUser method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The user name.

The updated user information.

The UpdateUser options.

The updateUser options.

parameters

  • The user name.

  • The status of the user's access to the web client.

    Allowable values: [pending,approved]

  • The name that is displayed for this user.

  • The user's email address.

  • The roles assigned to the user.

parameters

  • The user name.

  • The status of the user's access to the web client.

    Allowable values: [pending,approved]

  • The name that is displayed for this user.

  • The user's email address.

  • The roles assigned to the user.

Response

Status Code

  • Success

  • Unauthorized

  • Not found.

  • Internal error

Example responses

Delete user

Delete a user from the cluster.

Delete a user from the cluster.

Delete a user from the cluster.

Delete a user from the cluster.

Delete a user from the cluster.

DELETE /v1/users/{user_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) DeleteUser(deleteUserOptions *DeleteUserOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> deleteUser(DeleteUserOptions deleteUserOptions)
deleteUser(params, [callback()])
delete_user(self, user_name, **kwargs)
Request

Instantiate the DeleteUserOptions struct and set the fields to provide parameter values for the DeleteUser method.

Use the DeleteUserOptions.Builder to create a DeleteUserOptions object that contains the parameter values for the deleteUser method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The user name.

The DeleteUser options.

The deleteUser options.

parameters

  • The user name.

parameters

  • The user name.

Response

Status Code

  • Success

  • Unauthorized

  • Not Found

  • Internal error

Example responses

List all roles

Returns the user roles in the cluster.

Returns the user roles in the cluster.

Returns the user roles in the cluster.

Returns the user roles in the cluster.

Returns the user roles in the cluster.

GET /v1/roles
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetAllRoles(getAllRolesOptions *GetAllRolesOptions) (*core.DetailedResponse, error)
ServiceCall<GetAllRolesResponse> getAllRoles()
getAllRoles(params, [callback()])
get_all_roles(self, **kwargs)
Request

Custom Headers

  • The bearer token associated with a user name.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Create role

If the provided roles do not meet your needs, you can create other roles.

If the provided roles do not meet your needs, you can create other roles.

If the provided roles do not meet your needs, you can create other roles.

If the provided roles do not meet your needs, you can create other roles.

If the provided roles do not meet your needs, you can create other roles.

POST /v1/roles
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) CreateRole(createRoleOptions *CreateRoleOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> createRole(CreateRoleOptions createRoleOptions)
createRole(params, [callback()])
create_role(self, permissions, role_name, description=None, **kwargs)
Request

Instantiate the CreateRoleOptions struct and set the fields to provide parameter values for the CreateRole method.

Use the CreateRoleOptions.Builder to create a CreateRoleOptions object that contains the parameter values for the createRole method.

Custom Headers

  • The bearer token associated with a user name.

Information for creating a role

Example:

The CreateRole options.

The createRole options.

parameters

  • The permissions associated with the role.

  • Name for the role.

  • Description of the role.

parameters

  • The permissions associated with the role.

  • Name for the role.

  • Description of the role.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

List all permissions

Returns all permissions in the cluster.

Returns all permissions in the cluster.

Returns all permissions in the cluster.

Returns all permissions in the cluster.

Returns all permissions in the cluster.

GET /v1/roles/permissions
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetAllPermissions(getAllPermissionsOptions *GetAllPermissionsOptions) (*core.DetailedResponse, error)
ServiceCall<GetPermissionsResponse> getAllPermissions()
getAllPermissions(params, [callback()])
get_all_permissions(self, **kwargs)
Request

Custom Headers

  • The bearer token associated with a user name.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Get role information

Get details about one role.

Get details about one role.

Get details about one role.

Get details about one role.

Get details about one role.

GET /v1/roles/{role_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetRole(getRoleOptions *GetRoleOptions) (*core.DetailedResponse, error)
ServiceCall<GetRoleResponse> getRole(GetRoleOptions getRoleOptions)
getRole(params, [callback()])
get_role(self, role_name, **kwargs)
Request

Instantiate the GetRoleOptions struct and set the fields to provide parameter values for the GetRole method.

Use the GetRoleOptions.Builder to create a GetRoleOptions object that contains the parameter values for the getRole method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The name of the role.

The GetRole options.

The getRole options.

parameters

  • The name of the role.

parameters

  • The name of the role.

Response

Status Code

  • Success

  • Unauthorized

  • Not Found

  • Internal error

Example responses

Update role

Update the name, description, and permissions associated with a role.

Update the name, description, and permissions associated with a role.

Update the name, description, and permissions associated with a role.

Update the name, description, and permissions associated with a role.

Update the name, description, and permissions associated with a role.

PUT /v1/roles/{role_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) UpdateRole(updateRoleOptions *UpdateRoleOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> updateRole(UpdateRoleOptions updateRoleOptions)
updateRole(params, [callback()])
update_role(self, role_name, permissions, description=None, **kwargs)
Request

Instantiate the UpdateRoleOptions struct and set the fields to provide parameter values for the UpdateRole method.

Use the UpdateRoleOptions.Builder to create a UpdateRoleOptions object that contains the parameter values for the updateRole method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The name of the role.

The updated role information.

Example:

The UpdateRole options.

The updateRole options.

parameters

  • The name of the role.

  • The permissions associated with the role.

  • The description of the role.

parameters

  • The name of the role.

  • The permissions associated with the role.

  • The description of the role.

Response

Status Code

  • Success

  • Unauthorized

  • Not Found

  • Internal error

Example responses

Delete role

Delete a role from the cluster.

Delete a role from the cluster.

Delete a role from the cluster.

Delete a role from the cluster.

Delete a role from the cluster.

DELETE /v1/roles/{role_name}
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) DeleteRole(deleteRoleOptions *DeleteRoleOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> deleteRole(DeleteRoleOptions deleteRoleOptions)
deleteRole(params, [callback()])
delete_role(self, role_name, **kwargs)
Request

Instantiate the DeleteRoleOptions struct and set the fields to provide parameter values for the DeleteRole method.

Use the DeleteRoleOptions.Builder to create a DeleteRoleOptions object that contains the parameter values for the deleteRole method.

Custom Headers

  • The bearer token associated with a user name.

Path Parameters

  • The name of the role.

The DeleteRole options.

The deleteRole options.

parameters

  • The name of the role.

parameters

  • The name of the role.

Response

Status Code

  • Success

  • Unauthorized

  • Not Found

  • Internal error

Example responses

Change my password

Change the logged in user's password.

Change the logged in user's password.

Change the logged in user's password.

Change the logged in user's password.

Change the logged in user's password.

POST /v1/changepassword
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) ChangePassword(changePasswordOptions *ChangePasswordOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> changePassword(ChangePasswordOptions changePasswordOptions)
changePassword(params, [callback()])
change_password(self, password, **kwargs)
Request

Instantiate the ChangePasswordOptions struct and set the fields to provide parameter values for the ChangePassword method.

Use the ChangePasswordOptions.Builder to create a ChangePasswordOptions object that contains the parameter values for the changePassword method.

Custom Headers

  • The bearer token associated with a user name.

Form Parameters

  • New password.

The ChangePassword options.

The changePassword options.

parameters

  • New password.

parameters

  • New password.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Get my account information

Get details about the logged in user.

Get details about the logged in user.

Get details about the logged in user.

Get details about the logged in user.

Get details about the logged in user.

GET /v1/me
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetMe(getMeOptions *GetMeOptions) (*core.DetailedResponse, error)
ServiceCall<GetMeResponse> getMe()
getMe(params, [callback()])
get_me(self, **kwargs)
Request

Custom Headers

  • The bearer token associated with a user name.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Update my information

Update the display name or email address for the logged in user.

Update the display name or email address for the logged in user.

Update the display name or email address for the logged in user.

Update the display name or email address for the logged in user.

Update the display name or email address for the logged in user.

PUT /v1/me
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) UpdateMe(updateMeOptions *UpdateMeOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> updateMe(UpdateMeOptions updateMeOptions)
updateMe(params, [callback()])
update_me(self, display_name=None, email=None, **kwargs)
Request

Instantiate the UpdateMeOptions struct and set the fields to provide parameter values for the UpdateMe method.

Use the UpdateMeOptions.Builder to create a UpdateMeOptions object that contains the parameter values for the updateMe method.

Custom Headers

  • The bearer token associated with a user name.

The updated user information.

The UpdateMe options.

The updateMe options.

parameters

  • The name that is displayed for this user.

  • The user's email address.

parameters

  • The name that is displayed for this user.

  • The user's email address.

Response

Status Code

  • Success

  • Unauthorized

  • Internal error

Example responses

Check server status

Indicates whether your Cloud Pak for Data API server is running.

Indicates whether your Cloud Pak for Data API server is running.

Indicates whether your Cloud Pak for Data API server is running.

Indicates whether your Cloud Pak for Data API server is running.

Indicates whether your Cloud Pak for Data API server is running.

GET /v1/monitor
(ibmCloudPakForDataPlatformApi *IbmCloudPakForDataPlatformApiV1) GetMonitor(getMonitorOptions *GetMonitorOptions) (*core.DetailedResponse, error)
ServiceCall<SuccessResponse> getMonitor()
getMonitor(params, [callback()])
get_monitor(self, **kwargs)
Request

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • Success

  • Error

Example responses