---
updatedAt: 2026-06-12T14:47:10.000Z
agentTools:
  projectIndex: https://docs.formant.io/llms.txt
---

# Create service account

Create a new service account.
Resource: users
Authorized roles: administrator

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "ScopeFilter": {
        "properties": {
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "end": {
            "format": "date-time",
            "type": "string"
          },
          "tags": {
            "title": "MultiTagSets",
            "description": "One or more TagSets (combined with OR logic)",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TagSets"
                }
              },
              {
                "$ref": "#/components/schemas/TagSets"
              }
            ]
          },
          "deviceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "types": {
            "items": {
              "type": "string",
              "enum": [
                "bitset",
                "localization",
                "point cloud",
                "location",
                "file",
                "health",
                "transform tree",
                "battery",
                "video",
                "numeric set",
                "json",
                "image",
                "numeric",
                "text"
              ]
            },
            "type": "array"
          },
          "notTags": {},
          "notNames": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "agentIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "nullable": true
      },
      "UserScope": {
        "properties": {
          "roles": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Roles to which a user with this scope has access."
          },
          "users": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Users to which a user with this scope has access."
          },
          "teams": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Teams to which a user with this scope has access."
          },
          "devices": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Devices to which a user with this scope has access."
          },
          "fleets": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Fleets to which a user with this scope has access."
          },
          "events": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Events to which a user with this scope has access."
          },
          "views": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "Views to which a user with this scope has access."
          },
          "keyValue": {
            "$ref": "#/components/schemas/ScopeFilter",
            "nullable": true,
            "description": "keyValue entries to which a user with this scope has access."
          },
          "tags": {
            "title": "MultiTagSets",
            "description": "One or more TagSets (combined with OR logic)",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TagSets"
                }
              },
              {
                "$ref": "#/components/schemas/TagSets"
              }
            ]
          },
          "deviceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "types": {
            "items": {
              "type": "string",
              "enum": [
                "bitset",
                "localization",
                "point cloud",
                "location",
                "file",
                "health",
                "transform tree",
                "battery",
                "video",
                "numeric set",
                "json",
                "image",
                "numeric",
                "text"
              ]
            },
            "type": "array"
          },
          "notTags": {},
          "notNames": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "agentIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "end": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object",
        "nullable": true
      },
      "User": {
        "properties": {
          "organizationId": {
            "format": "uuid",
            "type": "string",
            "description": "ID of the organization to which this user belongs."
          },
          "accountId": {
            "format": "uuid",
            "type": "string",
            "nullable": true,
            "description": "ID of the account to which this user belongs."
          },
          "roleId": {
            "format": "uuid",
            "type": "string",
            "nullable": true,
            "description": "ID of this user's role."
          },
          "email": {
            "format": "email",
            "type": "string",
            "description": "Email address of this user."
          },
          "externalUserId": {
            "type": "string",
            "nullable": true,
            "description": "Ignore this - for internal use only."
          },
          "firstName": {
            "maxLength": 255,
            "type": "string",
            "description": "First name of this user."
          },
          "lastName": {
            "maxLength": 255,
            "type": "string",
            "description": "Last name of this user."
          },
          "scope": {
            "$ref": "#/components/schemas/UserScope",
            "type": "object",
            "minProperties": 1,
            "nullable": true,
            "description": ""
          },
          "teamId": {
            "format": "uuid",
            "type": "string",
            "nullable": true,
            "description": "ID of the team to which this user belongs."
          },
          "phoneNumber": {
            "pattern": "^\\+[1-9]\\d{1,14}$|^$",
            "type": "string",
            "description": "User's phone number (e.g., +14155550100)."
          },
          "isPhoneNumberVerified": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable this user. Set this to False to delete this user."
          },
          "isOrganizationOwner": {
            "type": "boolean",
            "description": "Should this user have organization owner privileges?"
          },
          "termsAccepted": {
            "type": "string",
            "description": "Has this user accepted Formant terms and conditions?"
          },
          "lastLoggedIn": {
            "nullable": true,
            "format": "date-time",
            "type": "string"
          },
          "passwordHash": {
            "pattern": "^\\$2[abxy]\\$.{56}$",
            "type": "string",
            "nullable": true
          },
          "isSingleSignOn": {
            "type": "boolean"
          },
          "smsOptInStatus": {
            "type": "string",
            "enum": [
              "OPT_IN",
              "OPT_OUT"
            ],
            "nullable": true
          },
          "region": {
            "type": "string",
            "enum": [
              "AMER",
              "EMEA",
              "JAPAC"
            ]
          },
          "isServiceAccount": {
            "type": "boolean"
          },
          "jobTitle": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en-US",
              "fr-CA"
            ]
          },
          "units": {
            "type": "string",
            "enum": [
              "metric",
              "imperial"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "title": {
            "maxLength": 20,
            "type": "string",
            "nullable": true,
            "description": "Title for the user."
          },
          "description": {
            "maxLength": 2048,
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "nullable": true
          },
          "grants": {
            "title": "TagSets",
            "description": "A map of tag keys to an array of values",
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "type": "object",
        "required": [
          "email",
          "firstName",
          "roleId"
        ]
      },
      "CreateServiceAccountRequest": {
        "properties": {
          "name": {
            "pattern": "^[0-9A-Za-z ]+$",
            "type": "string",
            "maxLength": 255,
            "description": "Name of this service account."
          },
          "roleId": {
            "format": "uuid",
            "type": "string",
            "description": "ID of the role for this service account."
          },
          "accountId": {
            "format": "uuid",
            "type": "string",
            "description": "ID of the account to which this service account belongs."
          },
          "scope": {
            "$ref": "#/components/schemas/UserScope",
            "description": "Currently unused, ignore."
          },
          "description": {
            "maxLength": 2048,
            "type": "string",
            "nullable": true
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "type": "object",
        "required": [
          "name",
          "roleId"
        ]
      },
      "CreateServiceAccountResponse": {
        "properties": {
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "password": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "user",
          "password"
        ]
      },
      "TagSets": {
        "title": "TagSets",
        "description": "A map of tag keys to an array of values",
        "type": "object",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "info": {
    "title": "Formant admin-api",
    "version": "1.357.8"
  },
  "openapi": "3.0.0",
  "paths": {
    "/auth/service-account": {
      "post": {
        "operationId": "AuthController.createServiceAccount",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceAccountRequest"
              }
            }
          },
          "description": "CreateServiceAccountRequest",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateServiceAccountResponse"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Create service account",
        "tags": [
          "Auth"
        ],
        "description": "Create a new service account.\nResource: users\nAuthorized roles: administrator",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.formant.io/v1/admin"
    }
  ]
}
```