ai-center
latest
false
UiPath logo, featuring letters U and I in white
AI Center
Automation CloudAutomation SuiteStandalone
Last updated Oct 10, 2024

Update ML Skill deployment using API

To access the AI Center APIs:

  1. Register an external application (one-time setup).
  2. Generate an authentication token (renew upon expiry).
  3. Make AI Center API calls.
Note: The first two steps enforce access control by making sure your application is registered and authenticated. To access the application, you must register and authenticate the application. (step 1 and 2)

Registering an external application

To use these APIs, your app must register as an external application within the AI Center scope.
  1. Go to the Admin page from the left navigation panel and select External Applications.
  2. Select + Add Application and give it a name, to add a new external application.
    Note: Only the confidential application type can access the AI Center APIs.
  3. Select Add scope to enable the AI Center scope to the external application.
    • Choose AI Center API Access (preview) from the Resource drop-down.
    • Go to the Application Scope tab and choose the APIs you want to give access to external applications. In the example below you select all the APIs for simplicity.


  4. A pop up with App ID and an App Secret confirms that the application was successfully added. Check the App ID and App Secret anytime from the Edit External application.
    Note: Use these credentials to generate an authentication token in the next step.


Check the Managing external applications page for more information.

Generating an authentication token

The external application must request an access token from the UiPath identity server for authentication and secure access.

Note: The authentication token expires in one hour. After this time, you'll need to generate a new one.

For simplicity, we use Postman in this tutorial. You can register 10 tokens for free and use their web interface, application, or any other tool.

Generate a POST request to the Identity Server endpoint that includes the following in the body of the request:

  • client_id: App ID from previous step.
  • client_secret: App Secret from previous step.
  • grant_type: client_credentials.
Select application/x-www-form-urlencoded as the content type if you're using Postman.


This request creates an authentication token, used for AI Center API calls:


You can also see the permissions enabled for this external application.

Check the additional information on credentials and authentication tokens in the External Applications (OAuth) page.

Making AI Center API calls

The API calls follow the https://cloud.uipath.com/accountname/tenantname/aifabric_/ 10 structure, where accountname and tenantname are specific to your account.
Most APIs need the following information:
  • Account ID and Tenant ID. Check the account and tenant details in the profile information section within the tenant.
  • Authorization. The authorization field is populated with the authentication token generated in the previous step.

You can now access specific APIs.

In the ML Skills list, sampleClassifierSkill (used as an example) is currently in the Available state.

Use the AI Center APIs to:

  • Find the ML Skill ID of sampleClassifierSkill.
  • Stop (undeploy) the ML Skill.
  • Start (redeploy) and verify status update.
Find ML Skill details
With the GET ML Skills call, you can retrieve all the ML Skills in your account and tenant.
To find a specific ML Skill and get its details, include its name in the query: GET /ai-deployer/v1/mlskills?name=sampleClassifierSkill
In this case, we find the ML Skill id for the sampleClassifierSkill.
Note: When using the authentication token, prefix it with Bearer.


In the response below, the key fields are highlighted in yellow. Use the ML Skill id in the following APIs to modify the state:


Update ML Skill replicas
Use the UPDATE ML Skill call to modify the deployment configuration on a specific ML skill.

In the example below, we change the replica count by including the new number in the request body.



Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.