Adding a service account to a Collab Team or a Group

Last modified by chaney08 on 2023/04/28 14:55

Abstract

In some case, you maybe want your service account beeing member of a team or a group (to access APIs of theses team/group with your service account token).

This is not possible through the front-end, service account doesn't appears. But you can do it using the API.

Requirement

You need first to create an OIDC client and enable the service account for this client and fetch an access token for this account.

1 - Create your OIDC Client

2 - Enable the service account and get a token
 

Getting once an Access Token using the client_credentials flow is necessary to generate the service-account user in our system. If you don't do this step, you will encounter a 404 User Not Found while adding your service account to a team or a group.

How to

Finally, your just have to refer to the Collab API  section Team or Group and use the PUT request to add a user to a team/group

The only thing to know is that the username value for service account is the prefix service-account- followed by the clientId of your oidc client.

Now if you fetch an access token for your service account using scopes team and group, you will see that your service account is member of theses teams/groups and you will be able to use your service account to interact with your collab or you groups through a notebook or any scripts.

Screenshot 2022-10-19 at 15.00.51.png