---
title: Creating HyperPortal user via API
slug: hyper-portal/creating-hyperportal-user-via-api
docTags: 
createdAt: 2023-06-08T12:19:39.000Z
---

## Introduction

This manual covers the use case of user creation via HyperPortal API.

## Prerequisites

### Enabled API key for tenant

Go to [Api Key settings](https://daf-demo.hyperportal.org/settings/apiKey) directly and toggle API key, if not enabled, or 



1. Press on the avatar to open menu
2. Go to Settings
3. Go to API Key tab
4. Generate new or use existing API key, сheck that the key is enabled (toggle near show key button)

### Create permission for contact definition

Go to [Contact metadata](https://daf-demo.hyperportal.org/cms/contact/settings/metadata) and confirm that permissions have enabled create permission for HyperPortal integrations under custom groups.






1. Go to CMS module
2. Go to metadata settings of contact person entity
3. Add or update HyperPortal integrations create permission. Create must be enabled.
4. Save changes




### Write permissions for specific properties

Go to [Contact definition](https://daf-demo.hyperportal.org/cms/contact/settings/definition) and confirm that at least required properties have enabled write permissions for HyperPortal integrations under custom groups.




Required properties on daf-demo (relevant for 08.06.23):

- Email (work)
- First name




Also, you must enable write permissions for every property that you want to be filled through an API. (groups, domains, etc.)










1. Go to the CMS module
2. Open definition settings
3. Go to properties
4. Select desired property to modify
5. Go to permissions
6. Add or update HyperPortal Integrations write permission under custom groups
7. Save changes




### List of desired groups

Go to [groups management page](https://daf-demo.hyperportal.org/groups), select entityId of desired groups for new user, you will use list of entityId on the user creation API request under groups property. Check if the group has all necessary permissions.






1. Click on the CRM module
2. Select Groups
3. Select desired group
4. Expand system properties section
5. Check permissions of the group, if necessary
6. Copy entityId of the group. It will be used in the array of the groups for a new user

## API request for user creation

General information 

You can use integration API to create users.

The JSON body of the request must contain an object with propertyId as keys and desired data in the property as value.




Request must contains at least two headers 

- X-tenant-id, for example, daf-demo
- X-api-key, api key from api key settings tab, for daf-demo api key is MGdFAnAb7S2O5guDuFZGF9nqABzE3f4g8JIS2LaX




More details on [our swagger](https://daf-demo.hyperportal.org/swagger/)

cURL example


curl --location 'https\://daf-demo.hyperportal.org/v2-integrations/definitions/contact' \\

\--header 'x-tenant-id: daf-demo' \\

\--header 'x-api-key: MGdFAnAb7S2O5guDuFZGF9nqABzE3f4g8JIS2LaX' \\

\--header 'Content-Type: application/json' \\

\--data-raw '\{

   "firstName": "Test",

   "emailWork": "test\@test.test",

   "groups": \["hyperUsers"]

}'




Postman collection example
