Skip to content
  • Auto
  • Light
  • Dark
Get Started

Create

Create
client.IAM.PersonalClients.New(ctx, body) (*ClientPersonalClientClientSecretstringIAMPersonalClientNewResponse, error)
post/api/v1/iam/personal_clients

Create creates a new PersonalClient object for the current User.

Parameters
bodyAllowSourceCidrfieldDisplayNamefieldExpiresfieldScopedRolesfieldIAMPersonalClientNewParams
Hide ParametersShow Parameters
AllowSourceCidrfield
optional
param.Field[[]string]

A list of CIDRs to restrict this credential to.

DisplayNamefield
optional
param.Field[string]

The display name for the new personal client.

Expiresfield
optional
param.Field[string]
formatduration
ScopedRolesfield
optional
param.Field[[]string]

The list of roles to restrict the credential to.

Returns
IAMPersonalClientNewResponsestruct

The PersonalClientServiceCreateResponse message contains the created personal client and client secret.

Hide ParametersShow Parameters
ClientIDstringAllowSourceCidrarrayClientIDstringCreatedAtTimeDeletedAtTimeDisplayNamestringExpiresTimeTimeLastUsedAtTimeScopedRolesarrayUpdatedAtTimeUserIDstringPersonalClient
optional

The PersonalClient message contains information about a presonal client credential.

ClientSecretstring
optional

The client secret that corresponds to the personal client. Make sure to save this, because it cannot be returned or queried again.

Request example Go
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := conductoronesdk.NewClient(
    option.WithAPIKey("My API Key"),
  )
  personalClient, err := client.IAM.PersonalClients.New(context.TODO(), conductoronesdk.IAMPersonalClientNewParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", personalClient.Client)
}
200 Example
{
  "client": {
    "allowSourceCidr": [
      "string"
    ],
    "displayName": "displayName",
    "expiresTime": "2019-12-27T18:11:19.117Z",
    "scopedRoles": [
      "string"
    ]
  },
  "clientSecret": "clientSecret"
}