---
title: "Add Auth Function Endpoint"
method: POST
path: "/admin/add-auth-function"
tags: ["admin"]
---

# Add Auth Function Endpoint

`POST /admin/add-auth-function`

## Request body

- AddAuthFunctionRequest
  - `tenant_id` string, required
  - `auth_fn` union, required
    - UserAuthFunction
      - `auth_fn` 'auth_user'
      - `user_id` string, required
    - EmailDomainFunction — Grants access for users from a specific connection (e.g. gmail) having email addresses from a given domain (e.g. @tenzir.com)
      - `auth_fn` 'auth_email_suffix'
      - `connection` string, nullable
      - `email_domain` string, required
    - OrganizationRoleFunction — Grants access to users who have some role in some organization.
      - `auth_fn` 'auth_organization_role'
      - `connection` string, nullable
      - `roles_claim` string, required
      - `role` string, required
      - `organization_claim` string, required
      - `organization` string, required
    - OrganizationMembershipFunction — Grants access to users that belong to some organization.
      - `auth_fn` 'auth_organization'
      - `connection` string, nullable
      - `organization_claim` string, required
      - `organization` string, required
    - AllowAllAuthFunction
      - `auth_fn` 'auth_allow_all'

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/tenzir/apis/tenzir-platform-api.md) · [All operations](https://skmtc.dev/tenzir/apis/tenzir-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tenzir/tenzir-platform-api/revisions/1c6c33bb8ba3/schema)
