Create a credential
POST/api/v1/Credential
Creates a credential (service account) that NPS uses to sign in to resources. If the request carries the ID of an existing credential and a domain, that credential is updated instead and set to the Configuration type. If the domain and user name already belong to a different credential, the call returns 409.
Permission required: Admin role.
Values for AuthenticationMethodType: 0 = Password, 1 = SshCertificate, 2 = SshCertificateAndPassword.
Values for CredentialType: -1 = Any, 0 = Configuration, 1 = User, 2 = Service, 3 = ActivityToken, 4 = Application, 5 = VaultUser, 6 = SshKeyCert.
Caution: The request body contains the account password or private key, so send it only over a secure connection and do not log it.
Request
Responses
- 200
- 400
- 403
- 409
The credential. Password, enable password, key and passphrase fields are left out.
The user name is missing, no password, private key or password vault connector was given, the user name and domain match an existing NPS user, or saving failed. When the request updates an existing credential, an SSH key that is not valid also returns 400. The body describes the problem.
The signed-in user does not have the required role.
The domain and user name already belong to a different service account.