Skip to Content
DocsAPIInvite Users

User Creation & Invitation

Invite a new or existing user to join your organization on HeyPeers. If a pending invitation already exists, the API returns the existing invitation URL so you can resend it.

Endpoint

  • POST: /organizations/:id/invite_user

Request

FieldLocationRequiredDescription
AuthorizationHeaderBearer <token> from the Authentication endpoint.
emailBodyEmail address of the invitee.
first_nameBodyFirst name of the invitee.
last_nameBodyLast name of the invitee.
curl -X POST "https://heypeers.com/api/v2/organizations/{ORG_ID}/invite_user" \ -H "Authorization: Bearer {TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "first_name": "John", "last_name": "Doe" }'

Responses

StatusBody
200 OKjson\n{\n "success": "User invited successfully.",\n "user": {\n "id": "[UUID]",\n "email": "[email]",\n "first_name": "[first_name]",\n "last_name": "[last_name]",\n "invitation_url": "[invitation_url]"\n }\n}\n
400 Bad Request{ "error": "[Error Message]" }

Common validation errors: duplicate email for another organization, malformed email, or missing required fields. Use the returned invitation_url to deep-link the user to their onboarding experience.***

Last updated on