---
updatedAt: 2025-06-05T04:54:30.000Z
agentTools:
  projectIndex: https://docs.zineone.com/llms.txt
---

# Working with Microservices

Microservices are small services that allow you to access data in the Session AI cloud server using APIs. A microservice can be available with public or restricted access. To create a microservice with restricted access, you should generate an API key that can be used for authentication.

For example, you can create a microservice to get the profile ID for a given key. Using the **Microservices** menu, you can write custom code, provide or restrict the accessibility of the microservice, set the REST endpoint, and save the microservice. The system generates the API URL to call the microservices that you created.

For more information about calling microservices API, refer to [Call Microservices](https://devguide.zineone.com/v2.0/docs/call-microservices) in *Session AI Developer's Guide*.

This section further describes how to:

* [Create a Microservice with Public Access](https://docs.zineone.com/docs/microservices#section-create-a-microservice-with-public-access)
* [Create a Microservice with Restricted Access](https://docs.zineone.com/docs/microservices#section-create-a-microservice-with-restricted-access)

## Create a Microservice with Public Access

1. In the **Integration** menu, click **Microservices** tab.\
   The **Microservices** screen appears.
2. On the **Microservice** screen, click **Create New**.

![](https://files.readme.io/a7f0a6a-small-Microservices.png)

The **Microservice** screen appears.

<Image align="center" className="border" border={true} src="https://files.readme.io/d4da791-CreateMicroservices.png" />

4. On the **Microservice** screen, perform the following:

* **Unique Name**: Enter the appropriate microservice name.
* **Allow access without API key**: Switch on the toggle to enable microservice for public access. The **API Key** option is disabled.
* **Select end point REST method type**: Select the desired endpoint option from the drop-down list. Session AI provides POST and GET endpoints.
* **Microservice code**: You can write your custom code to create the microservice. In addition, you can use the out-of-the-box snippets available in the **Snippets** and **Attributes** tabs.
* Click **Save**.

<Image align="center" className="border" border={true} src="https://files.readme.io/52181e1-Create_Microservices.png" />

The **Available Microservices** list displays the Status, Type, and system-generated API URL. Use this API URL to call the microservices you created.

5. Click <img src="https://files.readme.io/b6fa4c2-Elips.png" height="20px" width="20px" /> icon to perform the following activity:

* a. To **Suspend** the microservice
* b. To **Copy URL** of the microservice
* c. To **Edit** the microservice
* d. **Audit Trail** to view the detailed information of the microservice
* e. To **Delete** the microservice

![](https://files.readme.io/462002e-small-Available_Microservices.png)

> 🚧 Namespace
>
> To use the publicly accessible microservices, which do not require an API key, the namespace should be a part of the URL in the following format:
>
> *http\://\<cloud>public/api/v1/service/\<microservice\_name>?namespace=\<namespace>*
>
> For example, if the microservice name is "TestMicroService" and the namespace is "automation\_com", then the URL format should be:
>
> *http\://\<cloud>public/api/v1/service/TestMicroService?namespace=automation\_com*
>
> To know your namespace, contact your *Session AI Cloud Administrator*.

## Create a Microservice with Restricted Access

1. On the **Microservices** screen, click **Create New** from the top left corner.\
   The **Microservice** screen appears.
2. On the **Microservice** screen, perform the following:

* **Unique Name**: Enter the appropriate microservice name.
* **Select end point REST method type**: Select the desired endpoint option from the drop-down list. Session AI provides GET and POST endpoints.
* **Microservice code**: You can write your custom code to create the microservice. In addition, you can use the out-of-the-box snippets available in the **Snippets** and **Attributes** tabs.
* Click **Save**. The newly created microservice for public access appears in the **Available Microservices** list.

> 📘 Note
>
> To generate an API key, you must first save the microservice.

3. To create the API key, click the newly created microservice.\
   The **Editing Microservices definition** screen appears.
4. Click **+ Click here to generate an API Key specific to this Microservice**.\
   The system generates an API key that is used to access this microservice.
5. Click **Save**.\
   The **Available Microservices** list displays the system-generated API URL. Use this API URL to call the microservices you created.

<Image align="center" className="border" border={true} src="https://files.readme.io/62f76b4-MSAPI_Key.png" />

> 📘 API Key
>
> In the API Key section, click the **Deactivate** and **Delete** button to deactivate and remove the generated API key, respectively.