Skip to main content

API Permissions Reference

This guide provides a comprehensive reference of all Endatix API endpoints and their required permissions. Use this as a quick lookup when integrating with the API or troubleshooting authorization issues.

Overview

Endatix uses a permission-based authorization system where each API endpoint requires specific permissions. Permissions follow the pattern: {category}.{action}.{scope}

Understanding Endpoint Permissions

In the endpoint tables below, the Permission column shows:

  • Public - No authentication required (accessible anonymously)
  • Authenticated - Requires authentication but no specific permission
  • Specific permission (e.g., forms.create) - Requires authentication and the specified permission
Quick Links

Permission Categories

Access-Level Permissions

PermissionDescription
access.authenticatedUser is authenticated (signed in)
access.apps.hubUser has access to Endatix Hub application

Platform-Level Permissions

Platform-wide management permissions (typically for PlatformAdmin role):

PermissionDescription
platform.tenants.manageManage tenants
platform.settings.manageManage platform settings
platform.integrations.manageManage platform integrations
platform.users.impersonateImpersonate users
platform.metrics.viewView platform metrics
platform.logs.viewView platform logs
platform.usage.viewView platform usage statistics

Tenant-Level Permissions

Tenant-specific management permissions:

PermissionDescription
tenant.users.inviteInvite users to the tenant
tenant.users.viewView tenant users
tenant.users.manageManage tenant users
tenant.roles.viewView tenant roles
tenant.roles.manageManage tenant roles
tenant.settings.viewView tenant settings
tenant.settings.manageManage tenant settings
tenant.usage.viewView tenant usage statistics

Resource Permissions

Forms

PermissionDescription
forms.viewView forms
forms.createCreate new forms
forms.editEdit existing forms
forms.deleteDelete forms

Templates

PermissionDescription
templates.viewView form templates
templates.createCreate new templates
templates.editEdit existing templates
templates.deleteDelete templates

Themes

PermissionDescription
themes.viewView themes
themes.createCreate new themes
themes.editEdit existing themes
themes.deleteDelete themes

Submissions

PermissionDescription
submissions.viewView submissions
submissions.createCreate submissions (authenticated)
submissions.create.onbehalfCreate submissions on behalf of other users (for prefilling)
submissions.editEdit submissions
submissions.deleteDelete any submission
submissions.delete.ownedDelete own submissions (ownership-based)
submissions.exportExport submissions to CSV or other formats

Questions

PermissionDescription
questions.viewView custom questions
questions.createCreate custom questions
questions.editEdit custom questions
questions.deleteDelete custom questions

Endpoints by Category

This section provides the complete reference of all API endpoints with information about permissions and short descriptions.

Public vs Authenticated Endpoints
  • Public endpoints do not require authentication and are accessible anonymously
  • Public submission endpoints use ReCAPTCHA validation to prevent abuse
  • Access token endpoints require a valid signed token for security

Authentication & Account Management

Authentication Endpoints

MethodRoutePermissionDescription
POST/auth/loginPublicAuthenticate user and return JWT tokens
POST/auth/registerPublicRegister a new user account
POST/auth/refresh-tokenPublicRefresh access token using refresh token
POST/auth/logoutAuthenticatedLog out authenticated user
GET/auth/meAuthenticatedGet current user info, roles, and permissions
POST/auth/verify-emailPublicVerify user's email address using verification token
POST/auth/send-verification-emailPublicSend verification email to specified email address

Account Management

MethodRoutePermissionDescription
POST/account/forgot-passwordPublicSend password reset email
POST/account/reset-passwordPublicReset password with reset code
POST/my-account/change-passwordAuthenticatedChange authenticated user's password

Forms Management

MethodRoutePermissionDescription
POST/formsforms.createCreate a new form with active definition
GET/formsforms.viewList all forms with pagination
GET/forms/{formId}forms.viewGet form by ID
PUT/forms/{formId}forms.editUpdate a form
PATCH/forms/{formId}forms.editPartially update a form
DELETE/forms/{formId}forms.deleteDelete form and all its definitions/submissions
Cascading Delete

Deleting a form will delete all associated form definitions and submissions.

Form Definitions

MethodRoutePermissionDescription
POST/forms/{formId}/definitionsforms.editCreate new form definition
GET/forms/{formId}/definitionsforms.viewList all form definitions for a form
GET/forms/{formId}/definitionPublicGet active form definition (for rendering)
GET/forms/{formId}/definitions/{definitionId}forms.viewGet specific form definition by ID
PUT/forms/{formId}/definitions/{definitionId}forms.editUpdate form definition
PATCH/forms/{formId}/definitions/{definitionId}forms.editPartially update form definition
PUT/forms/{formId}/definitionforms.editUpdate the active form definition
PATCH/forms/{formId}/definitionforms.editPartially update the active definition
Active Definition

The /definition endpoint (singular) always returns or updates the currently active form definition, while /definitions (plural) works with all versions.

Submissions

Authenticated Submission Endpoints

MethodRoutePermissionDescription
GET/forms/{formId}/submissionssubmissions.viewList submissions for a form
GET/forms/{formId}/submissions/{submissionId}submissions.viewGet submission by ID
PUT/forms/{formId}/submissions/{submissionId}submissions.editUpdate submission
PATCH/forms/{formId}/submissions/{submissionId}submissions.editPartially update submission
POST/forms/{formId}/submissions/{submissionId}/statussubmissions.editUpdate submission status
DELETE/forms/{formId}/submissions/{submissionId}submissions.delete OR submissions.delete.ownedDelete submission (see note below)
POST/forms/{formId}/submissions/exportsubmissions.exportExport submissions (CSV or custom formats)
POST/forms/{formId}/submissions/{submissionId}/filessubmissions.viewDownload submission files as ZIP
Ownership-Based Deletion

The delete endpoint accepts either submissions.delete (delete any submission) OR submissions.delete.owned (delete only own submissions). This allows users to manage their own submissions without full delete permissions.

Public Submission Endpoints

MethodRoutePermissionDescription
POST/forms/{formId}/submissionsPublicCreate submission (anonymous form submission)
GET/forms/{formId}/submissions/by-token/{submissionToken}PublicGet submission by token (for partial submissions)
PATCH/forms/{formId}/submissions/by-token/{submissionToken}PublicUpdate submission by token (for partial submissions)

Special Submission Endpoints

MethodRoutePermissionDescription
POST/forms/{formId}/submissions/onbehalfsubmissions.create.onbehalfCreate submission on behalf of another user (for prefilling)
POST/forms/{formId}/submissions/{submissionId}/access-tokensubmissions.view OR submissions.edit OR submissions.exportGenerate short-lived access token for sharing
GET/forms/{formId}/submissions/by-access-token/{token}PublicGet submission using access token
PATCH/forms/{formId}/submissions/by-access-token/{token}PublicUpdate submission using access token
Access Token Permissions

When generating an access token, you can specify which permission (view, edit, or export) the token should grant. The token is short-lived and scoped to that specific permission.

Form Templates

MethodRoutePermissionDescription
POST/form-templatestemplates.createCreate new form template
GET/form-templatestemplates.viewList all form templates
GET/form-templates/{formTemplateId}templates.viewGet form template by ID
PATCH/form-templates/{formTemplateId}templates.editPartially update form template
DELETE/form-templates/{formTemplateId}templates.deleteDelete form template

Themes

MethodRoutePermissionDescription
POST/themesthemes.createCreate new theme
GET/themesthemes.viewList all themes
GET/themes/{themeId}themes.viewGet theme by ID
PUT/themes/{themeId}themes.editUpdate theme
PATCH/themes/{themeId}themes.editPartially update theme
DELETE/themes/{themeId}themes.deleteDelete theme

Custom Questions

MethodRoutePermissionDescription
POST/questionsquestions.createCreate custom question
GET/questionsquestions.viewList custom questions for tenant

User & Role Management

User Management

MethodRoutePermissionDescription
GET/users/{userId}/rolestenant.users.viewGet roles assigned to a user
POST/users/{userId}/rolestenant.users.manageAssign role to user
DELETE/users/{userId}/roles/{roleName}tenant.users.manageRemove role from user

Role Management

MethodRoutePermissionDescription
POST/rolestenant.roles.manageCreate new role with permissions
DELETE/roles/{roleName}tenant.roles.manageDelete role

Tenant Settings

MethodRoutePermissionDescription
GET/tenant-settingstenant.settings.viewGet tenant settings (sensitive data masked)

Special Permission Patterns

Multiple Permission Support

Some endpoints accept multiple permissions, where the user needs at least one of them:

// Example: Delete submission endpoint
Permissions(Actions.Submissions.Delete, Actions.Submissions.DeleteOwned);
// User needs EITHER Delete OR DeleteOwned permission

Ownership-Based Permissions

Permissions ending with .owned are ownership-based:

  • submissions.delete.owned - User can only delete their own submissions

This pattern allows fine-grained control where users can manage their own resources without full permissions.

Access Token Scoping

When generating access tokens for submission sharing, you can specify the permission level:

{
"submissionId": "123",
"permission": "export",
"expiresInMinutes": 60
}

The generated token will only grant the specified permission (view, edit, or export).

Admin Override

Important

Users with the Admin or PlatformAdmin roles will pass any permission check automatically. To restrict access to platform-level features to PlatformAdmins only, use role policies instead of permissions.

Role to Permission Mapping

Here's a quick reference of which permissions each default role has:

RoleKey Permissions
AdminFull tenant access - all forms, submissions, templates, themes, tenant users/roles/settings
PlatformAdminFull platform access - all tenant capabilities plus platform.* permissions
Creatorforms.*, templates.*, themes.*, submissions.view, submissions.export
Authenticatedaccess.authenticated (basic authenticated access)
PublicNo permissions (anonymous access)
Custom Roles

You can create custom roles with any combination of permissions to suit your specific needs. See Authorization for details.

Troubleshooting Permission Errors

401 Unauthorized

  • User is not authenticated
  • Token is expired or invalid
  • Check that the Authorization header is set correctly

403 Forbidden

  • User is authenticated but lacks the required permission
  • Check the user's assigned roles
  • Verify the role has the required permission
  • For ownership-based permissions, verify the user owns the resource

Common Issues

  1. "I have the role but still get 403"

    • Verify the role includes the specific permission
    • Check if you're accessing resources in the correct tenant
  2. "Public endpoint returns 401"

    • Verify the endpoint is documented as public
    • Check that AllowAnonymous is correctly configured
    • For access token endpoints, ensure the token is valid
  3. "Can't delete my own submission"

    • You need either submissions.delete OR submissions.delete.owned
    • Verify the submission actually belongs to your user account

Next Steps

Additional Resources

  • Actions Class: src/Endatix.Core/Abstractions/Authorization/Actions.cs - Permission constants
  • Endpoints: src/Endatix.Api/Endpoints/ - Endpoint implementations
  • FastEndpoints Docs: Security documentation - Framework reference