company logo

Help center

Go to Komunily
All collectionsAdminAPITenant API Documentation

Tenant API Documentation

Using the API

Komunily API

Tenant API Documentation

Base URL: https://api.komunily.com/v1/{tenantId}

Notes

  • All endpoints require a valid tenant ID in the URL path.

  • The API key must be provided in the X-API-Key header for all requests.

  • POST requests must have a Content-Type: application/json header.

  • Error responses may include more detailed error messages in some cases.

Endpoints

Get User

Retrieves user information by email or user ID.

  • URL: /get-user

  • Method: GET

  • Query Parameters:

user: User identifier (email or user ID)

  • Success Response:

Code: 200
Content: JSON object containing user data

  • Error Responses:

Code: 400

  • Content: "Missing or invalid user identifier"

Code: 404

  • Content: "User not found"

Code: 500

  • Content: "Internal Server Error"

Add User Access

Adds access rights to a user.

  • URL: /add-access

  • Method: POST

  • Body: JSON

{
"userId": "userId",
"access": ["accessId"]
}

  • Success Response:

Code: 200


Content: "Access added successfully"

  • Error Responses:

Code: 400

  • Content: "Invalid or missing user ID. Email addresses are not allowed."

  • Content: "Invalid or missing access array"

Code: 404

  • Content: "User not found"

Code: 500

  • Content: "Internal Server Error"

Add User

Creates a new user for the tenant.

  • URL: /add-user

  • Method: POST

  • Body: JSON

{
"email": "string",
"firstName": "string",
"lastName": "string",
"role": {"collaborator": true, "courses": 1}, (optional)
"access": ["string"] (optional)
}

  • Success Response:

Code: 201
Content: JSON
{
"id": "string",
"message": "User added successfully"
}
Email will be sent to the user from /templates/email/account/userInvite
Email Params include email, password, firstName

  • Error Responses:

Code: 400

  • Content: "Missing required fields: [field1, field2, ...]"

Code: 500

  • Content: "Internal Server Error"


Add Access Email


Adds access based on email, creating a new user (if the email does not exist) and adds access for the specified email.

  • URL: /add-access-email

  • Method: POST

  • Body: JSON

{
"email": "string",
"firstName": "string",
"lastName": "string",
"access": ["string"]
}


  • Success Response:

Code: 200
Content: JSON
{
"message": "Access added successfully",
"userId": "string"
}


If a new user is created, an email will be sent to the user from /templates/email/account/userInvite
Email Params include email, password, firstName

  • Error Responses:

Code: 400

  • Content: "Missing or invalid required fields"

Code: 500

  • Content: "Internal Server Error"

Notes:

  • This endpoint combines user creation (if needed) and access assignment in a single operation.

  • If the user already exists, it will only add the specified access.

  • The access array must contain at least one item.


Access Webhook

Adds or revokes access for a user based on their email. If the user doesn't exist, it creates a new user before adding access.

URL

/access-webhook

Method

POST

  • Success Response:

Code: 200
Content: JSON
{
"message": "Access added successfully",
"userId": "string"

"accessId": "string"
"accessName": "string"
"accessDescription: "string"
}


Query Parameters

  • validation: Webhook validation key (required)

  • accessId: The ID of the access to add or revoke (required)

  • revoke: Set to 'true' to revoke access, omit or set to any other value to add access (optional)

Headers

  • Content-Type: application/json

Body

JSON

Notes:

  • Must include "email" in the body

  • optionally including firstName and lastName for account creation


Komunily POST Notifications

/admin/settings/api

Notes

  • All notifications are processed as a POST request

  • All notifications will have Content-Type: application/json

1. New User


Notifies the system about a newly created user.

Request Body

{
    "userId": "string",
    "userEmail": "string"
}

Field | Type | Description

userId | string | The unique identifier of the newly created user
userEmail | string | The email address of the newly created user

Did this answer your question?
😞
😐
😁