Create
Create
client.organizations.serviceAccounts.credentials.create(stringserviceAccountID, CredentialCreateParams { organization_id, name, description, xClientRequestID } params, RequestOptionsoptions?): CredentialCreateResponse { id, client_id, client_secret, 3 more }
POST/organizations/{organization_id}/service-accounts/{service_account_id}/credentials
Create a new credential for a service account
Parameters
serviceAccountID: string
Identifier for API resources. A 26-char nanoid (URL/DNS safe).
minLength1
maxLength255
Returns
Create
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI();
const credential = await client.organizations.serviceAccounts.credentials.create(
'ab3def8hij2klm9opq5rst7uvw',
{ organization_id: 'x', name: 'name' },
);
console.log(credential.id);{
"id": "ab3def8hij2klm9opq5rst7uvw",
"client_id": "A1b2C3d4E5f6G7h8I9j0K",
"client_secret": "a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3X4y5Z6A7B8c9D0e1F2",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"description": "description"
}Returns Examples
{
"id": "ab3def8hij2klm9opq5rst7uvw",
"client_id": "A1b2C3d4E5f6G7h8I9j0K",
"client_secret": "a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3X4y5Z6A7B8c9D0e1F2",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"description": "description"
}