POST/api/v1/users

Invite a user to the org

Sends an invitation email with a signed, single-use join link (HMAC-SHA256, 7-day expiry — see ADR-0016 for the verification pattern). Idempotent per Idempotency-Key (ADR-0024) so retrying the invite doesn't create duplicate pending rows.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.

Request body required

Example

{
  "email": "user@example.com",
  "role": "admin"
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "email",
        "role"
      ],
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "role": {
          "type": "string",
          "enum": [
            "admin",
            "member",
            "viewer"
          ]
        }
      }
    }
  }
}

Response

200 example

{
  "success": true
}

All status codes

200Invitation sent.
400(no description)
401(no description)
403Forbidden — insufficient role for this operation.
429(no description)

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/users \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "user@example.com", "role": "admin" }'

TypeScript

import { EvalGuard } from "@evalguard/sdk";

const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });

const response = await client.request({
  method: "POST",
  path: "/api/v1/users",
  body: {
    "email": "user@example.com",
    "role": "admin"
  },
});
console.log(response);

Python

from evalguard import EvalGuard
import os

client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])

response = client.request(
    method="POST",
    path="/api/v1/users",
    body={
    "email": "user@example.com",
    "role": "admin"
},
)
print(response)

Go

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/evalguard/evalguard-go"
)

func main() {
	client := evalguard.NewClient(os.Getenv("EVALGUARD_API_KEY"))
	resp, err := client.Request(context.Background(), "POST", "/api/v1/users", map[string]any{"email": "user@example.com", "role": "admin"})
	if err != nil { panic(err) }
	fmt.Println(resp)
}

Errors

400401403429

Other Admin endpoints