Create a service account
Reviewed on · View on GitHub
A service account automates tasks or carries out operations on behalf of a user. It is characterized by a name, an access key and a secret code. For creation, a name must be provided by the user and the command returns the access key and the secret code associated with this account.
Permissions
This action requires the following IAM (Identity and Access Management) permissions:
- iam.serviceAccount.create
- Console
- API
- Terraform
Console

After the creation, the console displays the access key/secret code, then the spaces, roles and permissions assignment screens illustrated below.
-
In the IAM menu, click Service Accounts. You access the dashboard dedicated to service accounts.
-
In the Service Accounts dashboard, click the Create Service Account button. A new window appears.
-
In the new window, enter the information for the new service account:
- "Service Account name":
- the name of the account owner or of the associated technical service. The allowed characters are a-z, A-Z, 0-9 and _;
- "Expiration date":
- the date after which this service account can no longer request a new access token and will be denied any connection to Numspot;
- "Token duration":
- the access token allows the service account to authenticate to the Numspot service. Its lifetime ranges from 1 second to 48 hours (24 hours by default). At each new session, the service account must request a new token.
Click the Create Service Account button.
- "Service Account name":
-
Securely store the new service account's information.
warningCopy this security information, it will not be displayed again. The access key and the secret code may also be referred to as "access key/secret key" or "client id/client secret".

Then click the Assign roles and permissions button.
-
"Spaces" step: choose the spaces to associate with the service account, then click Save spaces. You can also click Skip step.
-
"Roles" step: select the "Organisation" tab or the relevant space, tick the roles to assign, then click Save roles. You can also click Do not assign roles or Skip step.
-
"Permissions" step: select the "Organisation" tab or the relevant space, tick the permissions to assign, then click Save permissions to complete the service account setup.
-
A confirmation message is displayed at the bottom indicating that the service account's permissions have been saved.
You can create a service account from the profile of an existing service account: from the list or the details page, click Create a Service Account from this profile. The new service account inherits the same spaces, roles and permissions as the initial one.
API
Creating a service account and assigning roles or permissions are done in separate steps.
The creation can be done at organisation level or at the level of a space of the organisation. The scope of the accounts' rights will be limited to their perimeter. The principle is the same, only the API URLs change.
Creating the service account at organisation level
curl example
curl 'https://api.{region}.numspot.com/iam/organisations/{organisationId}/serviceAccounts' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"name": "",
"tokenDuration": "PT24H",
"expirationDate": "2025-12-31"
}'
Command response:
{
"name": "…",
"id": "…",
"tokenDuration": "…",
"secret": "…",
"expirationDate": "…"
}
Creating the service account at space level
curl example
curl 'https://api.{region}.numspot.com/iam/spaces/{spaceId}/serviceAccounts' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"name": "le nom du service-account",
"tokenDuration": "PT24H",
"expirationDate": "2025-12-31"
}'
Command response:
{
"name": "…",
"id": "…",
"tokenDuration": "…",
"secret": "…",
"expirationDate": "…"
}
Assigning roles and permissions to a service account in an organisation
curl example
curl 'https://api.{region}.numspot.com/iam/organisations/{organisationId}/iampolicy/{subjectType}/{subjectId}' \
--request PATCH \
--header 'Content-Type: application/json' \
--data '{
"add": {
"roles": [
""
],
"permissions": [
""
]
},
"delete": {
"roles": [
""
],
"permissions": [
""
]
}
}'
Assigning roles and permissions to a service account in a space
curl example
curl 'https://api.{region}.numspot.com/iam/spaces/{spaceId}/iampolicy/{subjectType}/{subjectId}' \
--request PATCH \
--header 'Content-Type: application/json' \
--data '{
"add": {
"roles": [
""
],
"permissions": [
""
]
},
"delete": {
"roles": [
""
],
"permissions": [
""
]
}
}'
Terraform
The Terraform documentation is available on the Numspot registry ↗.