Skip to main content
POST
/
api
/
public
/
v1
/
team
/
invites
curl -sS -X POST https://app.opentrain.ai/api/public/v1/team/invites \
  -H "Authorization: Bearer $OT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email": "newhire@example.com"}'
{
  "ok": true,
  "status": "invite_created",
  "email": "newhire@example.com",
  "team": {
    "organization": {
      "id": "<ORGANIZATION_ID>",
      "name": "Acme Research",
      "ownerUserId": "<OWNER_USER_ID>",
      "ownerName": "Dana Owner"
    },
    "members": [
      {
        "userId": "<OWNER_USER_ID>",
        "role": "OWNER",
        "name": "Dana Owner",
        "email": "dana@example.com",
        "joinedAt": "2026-05-01T09:00:00.000Z"
      }
    ],
    "invites": [
      {
        "id": "<INVITE_ID>",
        "email": "newhire@example.com",
        "createdAt": "2026-06-12T10:00:00.000Z",
        "expiresAt": "2026-06-19T10:00:00.000Z"
      }
    ]
  }
}
Invites a human to the employer team by email, giving them shared access to the account’s jobs and team inbox once they accept. This sends the same invitation email as the in-app flow. The outcome depends on the email:
statusWhat happened
invite_createdAn invitation email was sent; the invite appears in GET /team until accepted
member_addedThe email belongs to an existing OpenTrain account — they were added to the team directly, no email round-trip
already_memberAlready on the team; nothing changed
Requirements: team:write scope + the public_api_team feature + a claimed account (unclaimed accounts get 403 with details.reason: "account_claim_required" and a claimUrl).

Request

email
string
required
Email address to invite. Must be a valid email.

Response

ok
boolean
true on success.
status
string
invite_created, member_added, or already_member (see the table above).
email
string
The email that was invited.
team
object
The refreshed team record — same shape as GET /team — so you can confirm the new member or pending invite without a second call.

Errors

StatuscodeMeaning
400BAD_REQUESTBody missing/not valid JSON, email invalid (details.issues), or the invite was rejected by validation (details.email)
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing team:write, public_api_team disabled, employer teams not enabled (details.reason: "teams_not_enabled"), or account not claimed (details.reason: "account_claim_required", details.claimUrl)
409CONFLICTThe invitation email could not be sent (details.reason: "invite_email_send_failed") — retry later
curl -sS -X POST https://app.opentrain.ai/api/public/v1/team/invites \
  -H "Authorization: Bearer $OT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email": "newhire@example.com"}'
{
  "ok": true,
  "status": "invite_created",
  "email": "newhire@example.com",
  "team": {
    "organization": {
      "id": "<ORGANIZATION_ID>",
      "name": "Acme Research",
      "ownerUserId": "<OWNER_USER_ID>",
      "ownerName": "Dana Owner"
    },
    "members": [
      {
        "userId": "<OWNER_USER_ID>",
        "role": "OWNER",
        "name": "Dana Owner",
        "email": "dana@example.com",
        "joinedAt": "2026-05-01T09:00:00.000Z"
      }
    ],
    "invites": [
      {
        "id": "<INVITE_ID>",
        "email": "newhire@example.com",
        "createdAt": "2026-06-12T10:00:00.000Z",
        "expiresAt": "2026-06-19T10:00:00.000Z"
      }
    ]
  }
}