---
title: "POST /{tenantID}/servicePrincipals"
method: POST
path: "/{tenantID}/servicePrincipals"
tags: ["ServicePrincipal"]
---

# POST /{tenantID}/servicePrincipals

`POST /{tenantID}/servicePrincipals`

Creates a service principal in the directory.

## Path parameters

- `tenantID` string, required

## Query parameters

- `api-version` string, required

## Request body

- ServicePrincipalCreateParameters — Active Directory service principal common properties shared among GET, POST and PATCH
  - `accountEnabled` boolean — whether or not the service principal account is enabled
  - `appRoleAssignmentRequired` boolean — Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application.
  - `keyCredentials` KeyCredential[] — The collection of key credentials associated with the service principal.
    - `startDate` string, date-time — Start date.
    - `endDate` string, date-time — End date.
    - `value` string — Key value.
    - `keyId` string — Key ID.
    - `usage` string — Usage. Acceptable values are 'Verify' and 'Sign'.
    - `type` string — Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'.
    - `customKeyIdentifier` string — Custom Key Identifier
  - `passwordCredentials` PasswordCredential[] — The collection of password credentials associated with the service principal.
    - `startDate` string, date-time — Start date.
    - `endDate` string, date-time — End date.
    - `keyId` string — Key ID.
    - `value` string — Key value.
    - `customKeyIdentifier` string, byte — Custom Key Identifier
  - `servicePrincipalType` string — the type of the service principal
  - `tags` string[] — Optional list of tags that you can apply to your service principals. Not nullable.

## Response `201`

The service principal was created successfully.

- ServicePrincipal — Represents an Azure Active Directory object.
  - `objectId` string — The object ID.
  - `objectType` string, required — The object type.
  - `deletionTimestamp` string, date-time, nullable — The time at which the directory object was deleted.

## Other responses

- `default` — Error response describing why the operation failed.

---

[API](https://skmtc.net/azure/apis/graphrbacmanagementclient.md) · [All operations](https://skmtc.net/azure/apis/graphrbacmanagementclient/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/graphrbacmanagementclient/revisions/71d95005600e/schema)
