# API Access

> Data Service Open API for managing Data Service resources from an external application using OAuth 2.0 authorization.

## Overview

Data Service Open API allows you to manage UiPath Data Service resources from an external application of your choice, and does so by enabling you to authorize the external app without sharing any credentials, through the Oauth 2.0 authorization framework.

Learn how to [register the external application](https://docs.uipath.com/automation-suite/automation-suite/2024.10/admin-guide/managing-external-applications) in UiPath<sup>®</sup> Automation Suite.

## API Permissions

To use the Data Service OpenAPI, you must grant API permissions to the external application. These API permissions are known as scopes, and there are three types for Data Service:

* **DataService.Schema.Read** - this **User Scope** allows your external app to read your tenant's Data Service schema, and it's dependent on the user's permissions.
* **DataService.Data.Read** - this **User Scope** allows your external app to read your tenant's Data Service data, and it's dependent on the user's permissions.
* **DataService.Data.Write** - this **User Scope** allows your external app to edit your tenant's Data Service data by deleting, updating or creating new data, and it's dependent on the user's permissions.

Learn more about the [user roles and permissions](https://docs.uipath.com/data-service/automation-suite/2024.10/user-guide/managing-access#managing-access) in Data Service.

## Download the OpenAPI Specification

With your external application and the user permissions set, it's time to download the OpenAPI specification of your tenant's Data Service data. Do so by navigating to the top-right menu on the tenant's **Data Service** tab > **API Access** > **Download OpenAPI file (JSON)**.

This will get you the OpenAPI 3.0 specifications of your tenant's Data Service entities, in JSON format. Clicking **Copy OpenAPI link** copies the API endpoint that generates the tenant's Data Service OpenAPI specification.

  <iframe width="100%" height="100%" src="https://documentationpicturerepo.blob.core.windows.net/screenshots/screenshots/Data_Service/openAPI_download_DS.mp4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## Authorizing the API Calls

To access the user-scoped resources of Data Service, authorize your external application with one of the following methods:

* [Authorization Code](https://docs.uipath.com/automation-suite/automation-suite/2024.10/api-guide/accessing-uipath-resources-using-external-applications#authorization-code) (for confidential external apps)
* [Authorization Code with PCKE](https://docs.uipath.com/automation-suite/automation-suite/2024.10/api-guide/accessing-uipath-resources-using-external-applications#authorization-code-with-pkce) (for non-confidential external apps)

## API Endpoints

OAuth2.0 authorization framework helps you generate a access token that allows your external application to make REST API calls to Data Service endpoints, for a limited time (one hour).

To continue calling the APIs you need to generate a new access token or [request a refresh token](https://docs.uipath.com/automation-suite/automation-suite/2024.10/api-guide/accessing-uipath-resources-using-external-applications#obtaining-a-refresh-token).

A Data Service API endpoint has the following syntax:

* **HTTP method** + **BaseURL** + **The resource category** + **The Data Service entity** + **The Operation** + **Path variables and query parameters**

  ![docs image](https://dev-assets.cms.uipath.com/assets/images/data-service/data-service-docs-image-47188-1cb058af-fd98dd9d.webp)

  **Data Service Entity Example**

  To describe each API request/response body, we are using the **Olympics** entity fields created in the Data Service. While we document the generic endpoint, such as `Get Entity Records`, your endpoint contains the exact name of your entity (for example, `Get Olympics Records`). The response and request bodies include all the fields from your entity, replicating the entity's structure.

  ![docs image](https://dev-assets.cms.uipath.com/assets/images/data-service/data-service-docs-image-47511-3bde8a7f-94c7e5db.webp)

  Further, let's [use the Data Service API guide to dive into each endpoint](https://docs.uipath.com/data-service/automation-cloud/latest/api-guide) and discover how you can put it to good use.
