For the complete documentation index, see llms.txt. This page is also available as Markdown.

Users

List users

get

Returns active users in the tenant, paginated. Excludes hard-deleted and soft-deleted users. Each entry carries id, first_name, last_name, a convenience full_name (first_name + " " + last_name), and email.

Query

  • search — optional case-insensitive substring match on the concatenated full name (CONCAT(first_name, ' ', last_name)).

  • page / limit — defaults page = 1, limit = 25, max limit = 100.

Authorizations
x-api-keystringRequired
Query parameters
searchstring · max: 100Optional

Case-insensitive substring match on first_name last_name.

pagenumber · min: 1OptionalDefault: 1
limitnumber · min: 1 · max: 100OptionalDefault: 25
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Responses
200Success
application/json
get/api/v1/public/users
GET /api/v1/public/users HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "id": "text",
      "first_name": "text",
      "last_name": "text",
      "full_name": "text",
      "email": "text"
    }
  ],
  "meta": {
    "total": 1,
    "lastPage": 1,
    "currentPage": 1,
    "perPage": 1,
    "prev": 1,
    "next": 1
  }
}

Create a single user

post

Creates a new user.

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
external_user_idstringRequired

External identifier for the user (e.g., UUID)

Example: 550e8400-e29b-41d4-a716-446655440000
emailstring · emailRequired

The user's email address

Example: example@gmail.com
first_namestring · min: 1 · max: 10Required

The user's first name

Example: Vova
last_namestring · min: 1 · max: 100Required

The user's last name

Example: Smith
phonestring · max: 50Optional

The user's phone number

Example: 38000
statusstring · enumOptional

Current status of the user account

Default: ActiveExample: ActivePossible values:
Responses
201Success
application/json
idstringRequired

Unique internal identifier of the user

Example: 550e8400-e29b-41d4-a716-446655440000
emailstring · emailRequired

The user's email address

Example: example@gmail.com
avatar_idstring · nullableRequired

URL to the user's avatar image

Example: https://example.com/avatar.jpg
first_namestringRequired

The user's first name

Example: Vova
last_namestringRequired

The user's last name

Example: Smith
external_user_idstring · nullableRequired

External identifier for the user assigned by third-party system

Example: ext_user_123456
full_namestringOptional

The user's full name (first name + last name)

Example: Vova Smith
phonestring · nullableOptional

The user's phone number

Example: +1234567890
statusstring · enumOptional

Current status of the user account

Example: ActivePossible values:
created_atstring · date-timeRequired

Timestamp when the user was created

Example: 2024-09-02T21:00:00.000Z
post/api/v1/public/users
POST /api/v1/public/users HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "external_user_id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "example@gmail.com",
  "first_name": "Vova",
  "last_name": "Smith",
  "phone": "38000",
  "status": "Active"
}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "example@gmail.com",
  "avatar_id": "https://example.com/avatar.jpg",
  "first_name": "Vova",
  "last_name": "Smith",
  "external_user_id": "ext_user_123456",
  "full_name": "Vova Smith",
  "phone": "+1234567890",
  "status": "Active",
  "created_at": "2024-09-02T21:00:00.000Z",
  "userVacations": [
    {
      "start_at": "2026-01-01T00:00:00.000Z",
      "end_at": "2026-01-01T00:00:00.000Z",
      "type": "day_off"
    }
  ]
}

Update a single user

put

Updates an existing user matched by external_user_id. All fields except external_user_id are optional — only provided fields are updated.

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
external_user_idstringRequired

External identifier for the user (used to match the user)

Example: 550e8400-e29b-41d4-a716-446655440000
emailstring · emailOptional

The user's email address

Example: example@gmail.com
first_namestring · min: 1 · max: 100Optional

The user's first name

Example: Vova
last_namestring · min: 1 · max: 100Optional

The user's last name

Example: Smith
phonestring · max: 50Optional

The user's phone number

Example: 38000
Responses
200Success
application/json
idstringRequired

Unique internal identifier of the user

Example: 550e8400-e29b-41d4-a716-446655440000
emailstring · emailRequired

The user's email address

Example: example@gmail.com
avatar_idstring · nullableRequired

URL to the user's avatar image

Example: https://example.com/avatar.jpg
first_namestringRequired

The user's first name

Example: Vova
last_namestringRequired

The user's last name

Example: Smith
external_user_idstring · nullableRequired

External identifier for the user assigned by third-party system

Example: ext_user_123456
full_namestringOptional

The user's full name (first name + last name)

Example: Vova Smith
phonestring · nullableOptional

The user's phone number

Example: +1234567890
statusstring · enumOptional

Current status of the user account

Example: ActivePossible values:
created_atstring · date-timeRequired

Timestamp when the user was created

Example: 2024-09-02T21:00:00.000Z
put/api/v1/public/users
PUT /api/v1/public/users HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 143

{
  "external_user_id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "example@gmail.com",
  "first_name": "Vova",
  "last_name": "Smith",
  "phone": "38000"
}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "example@gmail.com",
  "avatar_id": "https://example.com/avatar.jpg",
  "first_name": "Vova",
  "last_name": "Smith",
  "external_user_id": "ext_user_123456",
  "full_name": "Vova Smith",
  "phone": "+1234567890",
  "status": "Active",
  "created_at": "2024-09-02T21:00:00.000Z",
  "userVacations": [
    {
      "start_at": "2026-01-01T00:00:00.000Z",
      "end_at": "2026-01-01T00:00:00.000Z",
      "type": "day_off"
    }
  ]
}

Create users in batch

post

Creates multiple users in a single request. Skips users that already exist (matched by email or phone).

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
usersstring[]Required

An array containing user objects with the following fields: external_user_id, email, first_name, last_name, and phone

Responses
201Success
application/json
idstringRequired

Unique internal identifier of the user

Example: 550e8400-e29b-41d4-a716-446655440000
emailstring · emailRequired

The user's email address

Example: example@gmail.com
avatar_idstring · nullableRequired

URL to the user's avatar image

Example: https://example.com/avatar.jpg
first_namestringRequired

The user's first name

Example: Vova
last_namestringRequired

The user's last name

Example: Smith
external_user_idstring · nullableRequired

External identifier for the user assigned by third-party system

Example: ext_user_123456
full_namestringOptional

The user's full name (first name + last name)

Example: Vova Smith
phonestring · nullableOptional

The user's phone number

Example: +1234567890
statusstring · enumOptional

Current status of the user account

Example: ActivePossible values:
created_atstring · date-timeRequired

Timestamp when the user was created

Example: 2024-09-02T21:00:00.000Z
post/api/v1/public/users/batch
POST /api/v1/public/users/batch HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "users": [
    "text"
  ]
}
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "example@gmail.com",
    "avatar_id": "https://example.com/avatar.jpg",
    "first_name": "Vova",
    "last_name": "Smith",
    "external_user_id": "ext_user_123456",
    "full_name": "Vova Smith",
    "phone": "+1234567890",
    "status": "Active",
    "created_at": "2024-09-02T21:00:00.000Z",
    "userVacations": [
      {
        "start_at": "2026-01-01T00:00:00.000Z",
        "end_at": "2026-01-01T00:00:00.000Z",
        "type": "day_off"
      }
    ]
  }
]

Disable a user by external_user_id

patch

Sets the user status to Inactive.

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
external_user_idstringRequired

External identifier of the user to disable

Example: 550e8400-e29b-41d4-a716-446655440000
Responses
200Success
application/json
messagestringRequired

Message returned from API confirming the operation

Example: The operation was done successfully
patch/api/v1/public/users/disable
PATCH /api/v1/public/users/disable HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 59

{
  "external_user_id": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "message": "The operation was done successfully"
}

Set a user avatar from a url

post

Matches the user by external_user_id, then downloads the image at url and sets it as the user's avatar. Downloading happens asynchronously in the background — a 200 response means the update was scheduled, not that it has completed yet.

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
external_user_idstringRequired

External identifier of the user whose avatar is being set

Example: 550e8400-e29b-41d4-a716-446655440000
urlstringRequired

Url of the avatar image to download

Example: https://example.com/photos/user-avatar.jpg
Responses
201Success
application/json
messagestringRequired

Message returned from API confirming the operation

Example: The operation was done successfully
post/api/v1/public/users/avatar
POST /api/v1/public/users/avatar HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 110

{
  "external_user_id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com/photos/user-avatar.jpg"
}
{
  "message": "The operation was done successfully"
}

Remove a user avatar

delete

Matches the user by external_user_id and clears their avatar. Idempotent — if the user has no avatar set, this is a no-op. The underlying file is deleted from storage only if nothing else references it.

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
external_user_idstringRequired

External identifier of the user whose avatar is being removed

Example: 550e8400-e29b-41d4-a716-446655440000
Responses
200Success
application/json
messagestringRequired

Message returned from API confirming the operation

Example: The operation was done successfully
delete/api/v1/public/users/avatar
DELETE /api/v1/public/users/avatar HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 59

{
  "external_user_id": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "message": "The operation was done successfully"
}

Bulk-sync user avatars from a list of urls, with a report

post

Takes a list of { external_user_id, avatar_url } rows (e.g. from a one-off import file) and, for each one, downloads the image and sets it as that user's avatar — synchronously, so the outcome of every row is in the response.

A row is skipped (never overwrites anything) when:

  • user_not_found — no user in Hesh has this external_user_id.

  • duplicate_external_user_id — more than one Hesh user has this external_user_id; details lists the matched internal user ids for manual review.

  • user_inactive — the matched user's status is not Active.

  • avatar_already_set — the user already has an avatar; existing avatars are never replaced.

  • url_unreachable — the url could not be downloaded (unreachable, too large, or not an image); details carries the error.

Runs synchronously (not queued), so a large list will take proportionally longer to respond — keep batches reasonably sized (max 1000 rows per request).

Authorizations
x-api-keystringRequired
Header parameters
x-tenant-idstring · uuidOptional

Tenant id (uuid v4)

Body
Responses
200Success
application/json
totalnumberRequired

Number of input rows processed

updatednumberRequired

Number of users whose avatar was actually updated

post/api/v1/public/users/avatars/sync
POST /api/v1/public/users/avatars/sync HTTP/1.1
Host: api-stage.hesh.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 129

{
  "items": [
    {
      "external_user_id": "550e8400-e29b-41d4-a716-446655440000",
      "avatar_url": "https://example.com/photos/user-avatar.jpg"
    }
  ]
}
{
  "total": 1,
  "updated": 1,
  "skipped": [
    {
      "external_user_id": "text",
      "avatar_url": "text",
      "reason": "user_not_found",
      "details": "text"
    }
  ]
}

Last updated