---
title: "Invite user"
method: POST
path: "/resources/users/v2"
tags: ["User management"]
---

# Invite user

`POST /resources/users/v2`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/users/v2`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/users/v2/post.ts> (a function with typed inputs; its response is checked against the schema)

This route creates a user for a specific tenant. Send the tenant’s ID in the **`frontegg-tenant-id`** header to declare to what tenant this user is assigned. Send the user's information in the POST body. The user's email and metadata are required. The metadata can be empty, like `{}`.

## Headers

- `frontegg-tenant-id` string, required

## Request body

- CreateUserDto
  - `email` string, email, required
  - `name` string
  - `profilePictureUrl` string
  - `password` string
  - `phoneNumber` string
  - `provider` 'local' | 'saml' | 'google' | 'github' | 'facebook' | 'microsoft' | 'scim2' | 'slack' | 'apple'
  - `metadata` string: Stringified JSON object
  - `skipInviteEmail` boolean
  - `roleIds` string[]
  - `emailMetadata` object
  - `expirationInSeconds` number: Temporary user expiration in seconds

## Response `201`

- UserCreatedResponse
  - `id` string
  - `email` string
  - `verified` boolean
  - `name` string
  - `profilePictureUrl` string
  - `roles` string[]
  - `permissions` string[]
  - `metadata` string
  - `createdAt` string, date-time
  - `lastLogin` string, date-time
  - `activatedForTenant` boolean
  - `temporaryExpirationDate` string, date-time

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
