[Yandex Cloud documentation](../../../index.md) > [Yandex DataSphere](../../index.md) > [Step-by-step guides](../index.md) > Community management > Creating a service agent

# Creating a service agent

With a [service agent](../../../iam/concepts/service-control.md#service-agent), you will be able to work with other services, e.g., refresh your authorization tokens for DataSphere notebooks.

A service agent is a special service account under which DataSphere projects will perform actions in other Yandex Cloud services. Once enabled in a community, a service agent will be available across all the projects in that community.

You can also [manage a service agent](../projects/jobs-with-ssa.md) from [DataSphere Jobs](../../concepts/jobs/index.md).

{% note info %}

To enable a service agent in a DataSphere community, you need the `datasphere.communities.editor` [role](../../security/index.md) or higher.

You need the [admin](../../../resource-manager/security/index.md#resource-manager-admin) or [owner](../../../resource-manager/security/index.md#resource-manager-clouds-owner) role for the cloud to manage service access to resources.

{% endnote %}

If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

1. To allow a service agent to operate in DataSphere, ask your cloud admin or owner to run the following command in the Yandex Cloud CLI:

   ```bash
   yc iam service-control enable datasphere --cloud-id <cloud_ID>
   ```

   Where `--cloud-id` is the [ID of the cloud](../../../resource-manager/operations/cloud/get-id.md) you are going to use in the DataSphere community.

1. [Create](../../../iam/operations/sa/create.md) a service account and [assign](../../../iam/operations/sa/assign-role-for-sa.md) to it the roles required to use the selected service. For more information about the required roles, see **Access management** for the service in question.

    To send requests to nodes from a notebook, assign the `datasphere.user` role to the service account.       

1. Open the DataSphere [home page](https://datasphere.yandex.cloud). In the left-hand panel, select ![community-panel](../../../_assets/console-icons/circles-concentric.svg) **Communities**.
1. Select the community for which you want to create a service agent.
1. Go to the **Settings** tab.
1. Under **Service agent**, click **Add service account**.
1. In the window that opens, select the service account and click **Add**.

{% note info %}

To manage a community via the API, [add](add-user.md) the service account to the community member list. To send requests to a node from a notebook or access a project via the API, add the service account to the community and [project](../projects/add-user.md) member lists.

{% endnote %}