Account
Create an API key
POST
/
api
/
v1
/
api-keys
Create an API key
curl --request POST \
--url https://dev.simforge.ai/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"expiresInDays": 123
}
'import requests
url = "https://dev.simforge.ai/api/v1/api-keys"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"expiresInDays": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>'], expiresInDays: 123})
};
fetch('https://dev.simforge.ai/api/v1/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": {
"id": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}Authorizations
A sfc_at_… access token from simforge login, or an sfk_… API key. An operation's security lists the scopes the credential must hold.
Body
application/json
⌘I
Create an API key
curl --request POST \
--url https://dev.simforge.ai/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"expiresInDays": 123
}
'import requests
url = "https://dev.simforge.ai/api/v1/api-keys"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"expiresInDays": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>'], expiresInDays: 123})
};
fetch('https://dev.simforge.ai/api/v1/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": {
"id": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}{
"error": {
"code": "bad_request",
"reason": "<string>",
"retryable": true,
"requestId": "<string>",
"hint": "<string>",
"param": "<string>",
"detail": "<unknown>",
"path": "<string>"
}
}