Create a credential
curl --request POST \
--url https://sta.sandbox.lerian.net/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"institutionCode": "<string>",
"operatorId": "<string>",
"password": "<string>",
"description": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sta.sandbox.lerian.net/v1/credentials"
payload := strings.NewReader("{\n \"institutionCode\": \"<string>\",\n \"operatorId\": \"<string>\",\n \"password\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
institutionCode: '<string>',
operatorId: '<string>',
password: '<string>',
description: '<string>'
})
};
fetch('https://sta.sandbox.lerian.net/v1/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sta.sandbox.lerian.net/v1/credentials"
payload = {
"institutionCode": "<string>",
"operatorId": "<string>",
"password": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"institutionCode": "<string>",
"operatorId": "<string>",
"status": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"asOf": "2023-11-07T05:31:56Z",
"daysRemaining": 123,
"description": "<string>",
"expiryStatus": "<string>",
"lastExpiryCheckedAt": "2023-11-07T05:31:56Z",
"lastRotatedAt": "2023-11-07T05:31:56Z",
"lastTestResult": "<string>",
"lastTestedAt": "2023-11-07T05:31:56Z",
"passwordExpiresAt": "2023-11-07T05:31:56Z"
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Create a credential
Provisions a new credential, encrypts the plaintext password with the current master key, and emits credential.created via audit_outbox in the same transaction.
POST
/
v1
/
credentials
Create a credential
curl --request POST \
--url https://sta.sandbox.lerian.net/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"institutionCode": "<string>",
"operatorId": "<string>",
"password": "<string>",
"description": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sta.sandbox.lerian.net/v1/credentials"
payload := strings.NewReader("{\n \"institutionCode\": \"<string>\",\n \"operatorId\": \"<string>\",\n \"password\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
institutionCode: '<string>',
operatorId: '<string>',
password: '<string>',
description: '<string>'
})
};
fetch('https://sta.sandbox.lerian.net/v1/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sta.sandbox.lerian.net/v1/credentials"
payload = {
"institutionCode": "<string>",
"operatorId": "<string>",
"password": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"institutionCode": "<string>",
"operatorId": "<string>",
"status": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"asOf": "2023-11-07T05:31:56Z",
"daysRemaining": 123,
"description": "<string>",
"expiryStatus": "<string>",
"lastExpiryCheckedAt": "2023-11-07T05:31:56Z",
"lastRotatedAt": "2023-11-07T05:31:56Z",
"lastTestResult": "<string>",
"lastTestedAt": "2023-11-07T05:31:56Z",
"passwordExpiresAt": "2023-11-07T05:31:56Z"
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
JWT bearer token issued by the identity provider.
Body
application/json
Response
Created
Was this page helpful?

