POST
/admin/add-auth-function
const url = 'https://example.com/admin/add-auth-function';const options = { method: 'POST', headers: {'X-Tenzir-AdminKey': '<X-Tenzir-AdminKey>', 'Content-Type': 'application/json'}, body: '{"tenant_id":"example","auth_fn":{"auth_fn":"auth_user","user_id":"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/add-auth-function \ --header 'Content-Type: application/json' \ --header 'X-Tenzir-AdminKey: <X-Tenzir-AdminKey>' \ --data '{ "tenant_id": "example", "auth_fn": { "auth_fn": "auth_user", "user_id": "example" } }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
AddAuthFunctionRequest
object
tenant_id
required
Tenant Id
string
auth_fn
required
Any of:
UserAuthFunction
object
auth_fn
Auth Fn
string
user_id
required
User Id
string
EmailDomainFunction
Grants access for users from a specific connection (e.g. gmail) having email addresses from a given domain (e.g. @tenzir.com)
OrganizationRoleFunction
Grants access to users who have some role in some organization.
OrganizationMembershipFunction
Grants access to users that belong to some organization.
AllowAllAuthFunction
object
auth_fn
Auth Fn
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleValidation 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" } ]}