---
title: "Create Security Role"
method: POST
path: "/v2/partition/{partitionId}/security"
tags: ["Security Groups"]
---

# Create Security Role

`POST /v2/partition/{partitionId}/security`

## Request

- Base URL: `https://api.alianza.com`
- URL: `https://api.alianza.com/v2/partition/{partitionId}/security`
- Auth: API key in header `X-AUTH-TOKEN`
- TypeScript: <https://skmtc.dev/alianza/apis/alianza-public-api/docs/v2/partition/:partitionId/security/post.ts> (a function with typed inputs; its response is checked against the schema)

Use to create a security role.  <span hidden>For more information see <a href="group.html#createSecurityRole">here</a></span>

## Path parameters

- `partitionId` string, required

## Request body

- SecurityRoleX
  - `id` string
  - `partitionId` string: Reference to <a href="#/~schema/PartitionX">partition.id</a>
  - `name` string: The name of the Role. Must be unique among SecurityRoleX with the same partitionId.
  - `userType` 'AccountUser' | 'EndUser' | 'ManagementUser' | 'AlianzaUser' | 'BusinessLines': Which user type can be assigned the role.
  - `userCount` integer: A readonly (calculated) value which indicates how many users are assigned this Role.
  - `permissions` SecurityPermissionX[]: The set of permissions which will apply to any users who are assigned to this role.
    - `type` 'NONE' | 'Account' | 'AccountHistory' | 'AccountCallHistory' | 'AccountBulkStatuses' | 'IpWhitelist' | 'PhoneNumber' | 'PhoneNumberServiceActivation' | 'PhoneNumberInventory' | 'Product' | 'ProductCallingPlan' | 'ProductGroups' | 'ProductUsers' | 'Reports' | 'RoutePlan' | 'SipCredentials' | 'EU_DeviceSwapCreate' | 'EU_Account' | 'EU_AccountMedia' | 'EU_CallHistory' | 'EU_Device' | 'EU_DeviceSwap' | 'EU_DeviceLine' | 'EU_IVR' | 'EU_LineAppearance' | 'EU_LineHardware' | 'EU_LineHuntGroup' | 'EU_Voicemail' | 'EU_VoicemailMessage' | 'EU_VoicemailUnlock' | 'EU_Telephone' | 'EU_SipTrunk' | 'EU_User' | 'EU_UserResetPassword' | 'EU_History' | 'EU_BUSINESS_LINE' | 'EU_BUSINESS_LINE_PROVISIONING' | 'EU_BUSINESS_LINE_VOICEMAIL' | 'EU_BUSINESS_LINE_HUNT_GROUP' | 'EU_911_ADDRESS' | 'EU_TELEPHONE_DESTINATION' | 'EU_ENDUSER_REPURPOSE' | 'ALIANZA_MasterRoutePlan' | 'ALIANZA_TogglzAdmin' | 'ANY_END_USER' | 'ANY_MANAGEMENT_USER' | 'ANY_ALIANZA_USER': The type of permission. Features of the api are mostly categorized under one of these permission types.
    - `accessType` 'NONE' | 'READ_MYUSER' | 'READ' | 'EDIT_MYUSER' | 'EDIT' | 'CREATE_MYUSER' | 'CREATE' | 'DELETE_MYUSER' | 'DELETE' | 'DENIED': The level of access to grant for the type of permission

## Response `200`

Successful operation

- SecurityRoleX
  - `id` string
  - `partitionId` string: Reference to <a href="#/~schema/PartitionX">partition.id</a>
  - `name` string: The name of the Role. Must be unique among SecurityRoleX with the same partitionId.
  - `userType` 'AccountUser' | 'EndUser' | 'ManagementUser' | 'AlianzaUser' | 'BusinessLines': Which user type can be assigned the role.
  - `userCount` integer: A readonly (calculated) value which indicates how many users are assigned this Role.
  - `permissions` SecurityPermissionX[]: The set of permissions which will apply to any users who are assigned to this role.
    - `type` 'NONE' | 'Account' | 'AccountHistory' | 'AccountCallHistory' | 'AccountBulkStatuses' | 'IpWhitelist' | 'PhoneNumber' | 'PhoneNumberServiceActivation' | 'PhoneNumberInventory' | 'Product' | 'ProductCallingPlan' | 'ProductGroups' | 'ProductUsers' | 'Reports' | 'RoutePlan' | 'SipCredentials' | 'EU_DeviceSwapCreate' | 'EU_Account' | 'EU_AccountMedia' | 'EU_CallHistory' | 'EU_Device' | 'EU_DeviceSwap' | 'EU_DeviceLine' | 'EU_IVR' | 'EU_LineAppearance' | 'EU_LineHardware' | 'EU_LineHuntGroup' | 'EU_Voicemail' | 'EU_VoicemailMessage' | 'EU_VoicemailUnlock' | 'EU_Telephone' | 'EU_SipTrunk' | 'EU_User' | 'EU_UserResetPassword' | 'EU_History' | 'EU_BUSINESS_LINE' | 'EU_BUSINESS_LINE_PROVISIONING' | 'EU_BUSINESS_LINE_VOICEMAIL' | 'EU_BUSINESS_LINE_HUNT_GROUP' | 'EU_911_ADDRESS' | 'EU_TELEPHONE_DESTINATION' | 'EU_ENDUSER_REPURPOSE' | 'ALIANZA_MasterRoutePlan' | 'ALIANZA_TogglzAdmin' | 'ANY_END_USER' | 'ANY_MANAGEMENT_USER' | 'ANY_ALIANZA_USER': The type of permission. Features of the api are mostly categorized under one of these permission types.
    - `accessType` 'NONE' | 'READ_MYUSER' | 'READ' | 'EDIT_MYUSER' | 'EDIT' | 'CREATE_MYUSER' | 'CREATE' | 'DELETE_MYUSER' | 'DELETE' | 'DENIED': The level of access to grant for the type of permission

## Other responses

- `400`: Invalid Security Role
- `401`: Unauthorized
- `404`: Path error, probably bad partitionId

---

[API](https://skmtc.dev/alianza/apis/alianza-public-api.md) - [All operations](https://skmtc.dev/alianza/apis/alianza-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alianza/apis/alianza-public-api/revisions/7223246c352c?raw)
