POST
/v1/organizations/{organizationId}/projects/{projectId}/environments/{environmentId}/service-principalsCreate an Environment-scoped ServicePrincipal
Create a named machine identity whose immutable structural scope is this Environment.
Authentication
Send an API key as a Bearer token in the Authorization header.
Parameters
Request body
Required.
application/jsonobject- unknown properties allowed
false
displayNamerequiredstringThe human-readable name for this machine identity.- maximum length
200 - minimum length
1
- maximum length
Responses
201ServicePrincipalCreatedapplication/json400The request path, headers, query, or JSON body did not satisfy the published schema401Unauthorizedapplication/json403Forbiddenapplication/json404NotFoundapplication/jsonReusable schemas
ServicePrincipalCreatedEncoded
object- unknown properties allowed
false
principalIdrequiredstringThe Principal identifier.- maximum length
64 - pattern
^principal_[\s\S]+$
- maximum length
kindrequiredstringThe Principal kind.- allowed values
"servicePrincipal"
- allowed values
displayNamerequiredstringThe human-readable resource name.scoperequired- ServicePrincipalScopeThe immutable structural scope of this machine identity.
statusrequired- PrincipalStatusThe current lifecycle status.
createdAtrequiredstringWhen the resource was created, in UTC.- format
date-time
- format
updatedAtrequiredstringWhen the resource was last updated, in UTC.- format
date-time
- format
UnauthorizedEncoded
object- unknown properties allowed
false
_tagrequiredstringThe stable machine-readable error type.- allowed values
"Unauthorized"
- allowed values
reasonrequiredstringA safe explanation of why the credential was rejected.
ForbiddenEncoded
object- unknown properties allowed
false
_tagrequiredstringThe stable machine-readable error type.- allowed values
"Forbidden"
- allowed values
permissionrequiredstringThe permission required by the refused operation.
NotFoundEncoded
object- unknown properties allowed
false
_tagrequiredstringThe stable machine-readable error type.- allowed values
"NotFound"
- allowed values
resourcerequiredstringThe resource type relevant to the error.idrequiredstringThe identifier supplied for the resource that was not found.
ServicePrincipalScope
PrincipalStatus
string- allowed values
"active", "disabled"
OrganizationScope
object- unknown properties allowed
false
levelrequiredstringThe tenancy level of this structural scope.- allowed values
"organization"
- allowed values
organizationIdrequiredstringThe Organization identifier.- maximum length
64 - pattern
^org_[\s\S]+$
- maximum length
ProjectScope
object- unknown properties allowed
false
levelrequiredstringThe tenancy level of this structural scope.- allowed values
"project"
- allowed values
organizationIdrequiredstringThe Organization identifier.- maximum length
64 - pattern
^org_[\s\S]+$
- maximum length
projectIdrequiredstringThe Project identifier.- maximum length
64 - pattern
^proj_[\s\S]+$
- maximum length
EnvironmentScope
object- unknown properties allowed
false
levelrequiredstringThe tenancy level of this structural scope.- allowed values
"environment"
- allowed values
organizationIdrequiredstringThe Organization identifier.- maximum length
64 - pattern
^org_[\s\S]+$
- maximum length
projectIdrequiredstringThe Project identifier.- maximum length
64 - pattern
^proj_[\s\S]+$
- maximum length
environmentIdrequiredstringThe Environment identifier.- maximum length
64 - pattern
^env_[\s\S]+$
- maximum length