---
title: "Create service account API key"
method: POST
path: "/admin/service-accounts"
tags: ["Service Accounts"]
---

# Create service account API key

`POST /admin/service-accounts`

## Request

- Base URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api`
- URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/admin/service-accounts`
- Auth: HTTP bearer

Generate a new M2M API key for backend services (admin only)

## Request body

- object
  - `name` string, required: Service account name
  - `description` string: Purpose of this service account
  - `environment` 'development' | 'production' | 'enterprise', required
  - `projectId` string: Firebase project ID this service belongs to
  - `scopes` string[], required: Permissions (e.g., ["read:users", "write:subscriptions"])
  - `expiresInDays` integer: Optional expiration window in days

## Response `201`

Service account created

## Other responses

- `401`: Missing or invalid authentication token
- `403`: Admin access required

---

[API](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api.md) · [All operations](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/revisions/53e075911af9?raw)
