POST
/admin/generate-user-key
const url = 'https://example.com/admin/generate-user-key';const options = { method: 'POST', headers: {'X-Tenzir-AdminKey': '<X-Tenzir-AdminKey>', 'Content-Type': 'application/json'}, body: '{"user_id":"example","expires":1,"tenant_ids":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/admin/generate-user-key \ --header 'Content-Type: application/json' \ --header 'X-Tenzir-AdminKey: <X-Tenzir-AdminKey>' \ --data '{ "user_id": "example", "expires": 1, "tenant_ids": [ "example" ] }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
UserKey
The decrypted X-Tenzir-UserKey header
object
user_id
required
User Id
string
expires
Expires
integer
tenant_ids
required
Tenant Ids
Array<string>
Example generated
{ "user_id": "example", "expires": 1, "tenant_ids": [ "example" ]}Responses
Section titled “ Responses ”Successful Response
Media type application/json
KeyResponse
object
key
required
Key
string
Example generated
{ "key": "example"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}