POST /agent/invite
Invite a user to the current project. If the email is not registered, a new account is created automatically and a claim_url is returned. Requires admin API key.

Authentication

Bearer Token (hu_api_key)

Request Body required

application/json
email string (email) REQUIRED
name string
role string
Enum: admin, editor, viewer

Responses

200 User invited
application/json
data object
user_id string
email string
role string
is_new_account boolean
claim_url string
Only present if a new account was created
409 Already a member
curl -X POST 'https://happyuptime.com/api/v1/agent/invite' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "name": "string",  "role": "editor"}'
const response = await fetch('https://happyuptime.com/api/v1/agent/invite', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "email": "user@example.com",    "name": "string",    "role": "editor"  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://happyuptime.com/api/v1/agent/invite', headers=headers, json={  "email": "user@example.com",  "name": "string",  "role": "editor"})print(response.json())
200 Response
{  "data": {    "user_id": "<string>",    "email": "<string>",    "role": "<string>",    "is_new_account": true,    "claim_url": "<string>"  }}