Create API Client Credentials
  • 04 Jul 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Create API Client Credentials

  • Dark
    Light
  • PDF

Article summary

Post
/env-mgmt/1.0/api-key/clients

This API enables users to create Client Credentials associated to a Tenant or Environment.

Notice

Accessing the Policy Management APIs is through a dedicated domain/URL according to your PlainID Tenant Location:
https://api.{REGION}.plainid.io

United States (US) - https://api.us1.plainid.io
Canada (US) - https://api.ca1.plainid.io
Europe (US) - https://api.eu1.plainid.io

Replace{REGION} with your PlainID Tenant region (e.g. us1, eu1, ca1, etc.).


cURL Sample Guidelines

In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right. They will then appear in the cURL sample on the bottom of the page in the correct format.

Security
HTTP
Type bearer

For more details about Administration API Authentication, check out the Authentication APIs documentation. Provide your bearer token in the Authorization header when making requests to protected resources. Example: Authorization: Bearer 123

Body parameters
Environment Admin Sample
{
  "description": "Name21 Description",
  "name": "Name21",
  "ownerId": "b0e1f961-2061-4f83-8392-b5aa19fed0c1",
  "ownerType": "ENVIRONMENT",
  "permission": "ADMIN",
  "tokenDuration": "PT1440M"
}
Environment Viewer Sample
{
  "description": "Name22 Description",
  "name": "Name22",
  "ownerId": "b0e1f961-2061-4f83-8392-b5aa19fed0c1",
  "ownerType": "ENVIRONMENT",
  "permission": "VIEWER",
  "tokenDuration": "PT1440M"
}
Tenant Admin Sample
{
  "description": "Name23 Description",
  "name": "Name23",
  "ownerId": null,
  "ownerType": "TENANT",
  "permission": "ADMIN",
  "tokenDuration": "PT1440M"
}
object
description
string

API Client Credential Description

Max length200
name
string Required

API Client Credential Name

Max length100
ownerId
string (UUID) | null Required

Client Owner is the Environment ID. The Environment ID can be found under the Details tab in the Environment Settings. If this is for a Tenant Admin, input null or - in the ownerId field.

ownerType
string Required

Type of Client Owner.

Valid values[ "ENVIRONMENT", "TENANT" ]
permission
string Required

Client Access Permissions. When configuring Client Credentials for a Tenant, Permissions can be set to ADMIN only.

Valid values[ "ADMIN", "VIEWER" ]
tokenDuration
string (ISO-8601 duration) Required

Client Token Duration

ExamplePT90M
Responses
201

Client Created Successfully

description
string
id
string

Copy and save this id to use as your Client ID.

name
string
ownerId
string (UUID)
ownerType
string
permission
string
secret
string

Copy and save this secret to use as your Client Secret.

tokenDuration
string (ISO-8601 duration)
400

Bad Request

client already exists
{
  "id": "EW69XA",
  "message": "Client {name} already exists",
  "name": "clientAlreadyExists",
  "status": 400
}
client count limitation
{
  "id": "EW68XA",
  "message": "Client count limitation exceeded",
  "name": "clientCountLimitation",
  "status": 400
}
Expand All
object
args
object
path
string
code
string
id
string
message
string
name
string
status
integer
403

Forbidden

forbidden environment
{
  "id": "EW65XA",
  "message": "operation get for resource Environment {ownerId} is not allowed because the current user does not have the appropriate permissions",
  "name": "forbiddenEnvironment",
  "status": 403
}
forbidden tenant
{
  "id": "EW66XA",
  "message": "Operation GET for resource Tenant {tenantId} is not allowed because the current user does not have the appropriate permissions.",
  "name": "forbiddenTenant",
  "status": 403
}
Expand All
object
args
object
path
string
code
string
id
string
message
string
name
string
status
integer
404

NotFound

environment not found
{
  "code": "EVM-002",
  "id": "EW67XA",
  "message": "envId: {ownerId} does not exist",
  "name": "environmentNotFoundError",
  "status": 404
}
Expand All
object
args
object
path
string
code
string
id
string
message
string
name
string
status
integer
422

unprocessable entity

unsupported owner type
{
  "id": "EW51XA",
  "message": "{ownerType} is not supported",
  "name": "UnsupportedOwnerType",
  "status": 422
}
Expand All
object
args
object
path
string
code
string
id
string
message
string
name
string
status
integer

Was this article helpful?