Skip to Content
Xeonr Developer Docs
API SpecificationPRIVATEService Accounts

Create Service Account

POST
/xeonr.auth.private.v1.ServiceAccountService/CreateServiceAccount

Creates a new service account for an application. Returns the service account details and a JWT token (shown only once).

Required scopes: auth:service-accounts:edit (organisation-wide) or auth:apps:edit:own (service accounts of applications owned by a team you are an owner of; never the auth application or an organisation-owned one)

Authorization

BearerAuth
AuthorizationBearer <token>

JWT access token for internal API access. Requires 'private' scope for most endpoints, 'admin' scope for administrative operations.

In: header

Header Parameters

Connect-Protocol-Version?number

Define the version of the Connect protocol

Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

applicationId?string
Length1 <= length <= 64
name?string
Length1 <= length <= 64
scopes?array<>
Items1 <= items
description?string
Lengthlength <= 256
applicationBindings?array<>

Application bindings to expand the service account's audience

iacManaged?boolean
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://auth.xeonr.io/xeonr.auth.private.v1.ServiceAccountService/CreateServiceAccount" \  -H "Connect-Protocol-Version: 1" \  -H "Connect-Timeout-Ms: 1000" \  -H "Content-Type: application/json" \  -d '{}'
{
  "serviceAccount": {
    "id": "sa_a1b2c3d4e5f6",
    "name": "CI/CD Pipeline",
    "applicationId": "app_prod_myapp",
    "scopes": [
      "read",
      "write",
      "admin"
    ],
    "enabled": true,
    "description": "Service account for automated deployments",
    "createdAt": "2023-01-15T01:30:15.01Z",
    "updatedAt": "2023-01-15T01:30:15.01Z",
    "applicationBindings": [
      {
        "applicationId": "app_prod_myapp",
        "jsonConfig": {
          "property1": {},
          "property2": {}
        },
        "iacManaged": true,
        "approved": true,
        "requestedScopes": [
          "string"
        ],
        "approvedScopes": [
          "string"
        ],
        "state": "APPLICATION_BINDING_STATE_UNSPECIFIED",
        "decisionPending": true,
        "autoApprovedScopes": [
          "string"
        ]
      }
    ],
    "iacManaged": true
  },
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}