Skip to main content
POST
/
v2
/
workspaces
/
{workspaceId}
/
security
/
apikeys
Create API Key
curl --request POST \
  --url https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/security/apikeys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "rules": [
    {
      "role": [
        "<string>"
      ],
      "inverted": true,
      "reason": "<string>",
      "conditions": {},
      "fields": [
        "<string>"
      ],
      "priority": 123
    }
  ]
}
'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rules: [
{
role: ['<string>'],
inverted: true,
reason: '<string>',
conditions: {},
fields: ['<string>'],
priority: 123
}
]
})
};

fetch('https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/security/apikeys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/security/apikeys"

payload = {
"name": "<string>",
"rules": [
{
"role": ["<string>"],
"inverted": True,
"reason": "<string>",
"conditions": {},
"fields": ["<string>"],
"priority": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "apiKey": "<string>",
  "subjectType": "<string>",
  "subjectId": "<string>",
  "rules": [
    {
      "role": [
        "<string>"
      ],
      "inverted": true,
      "reason": "<string>",
      "conditions": {},
      "fields": [
        "<string>"
      ],
      "priority": 123
    }
  ],
  "name": "<string>",
  "disabled": true
}
{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}
{
"error": "AuthenticationError",
"message": "Unauthenticated"
}
{
"error": "ForbiddenError",
"message": "Forbidden"
}
{
"error": "ObjectNotFound",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

Workspace id

Body

application/json
name
string
required
rules
object[]
required

Response

Success Response

apiKey
string
required
subjectType
string
required
subjectId
string
required
rules
object[]
required
name
string
disabled
boolean