Wocha Docs

Organisation invite API

POST /v1/organisations/{id}/invites — find or create an identity, add membership, and issue a first-password or sign-in URL

Invite a member by email. The identity is found or created, organisation membership is written, and the response always includes action_url for the invitee.

MethodPOST
Path/v1/organisations/{id}/invites
Scopeorganisations:write
Success201 Created

{id} is the organisation UUID or slug.

For the product flow, hosted /invite behaviour, and send: false, see Organisation invites.


Request

POST /v1/organisations/{id}/invites
Authorization: Bearer wocha_mgmt_...
Content-Type: application/json
{
  "email": "alex@acme.com",
  "role": "member",
  "name": { "first": "Alex", "last": "Cole" },
  "return_to": "https://app.example.com/api/auth/login",
  "send": false,
  "require_mfa": true,
  "inviter_name": "Jordan"
}
FieldTypeDefaultDescription
emailstringrequiredInvitee email (stored lower-case)
roleowner | admin | membermemberOrganisation role
name.firststringGiven name on a newly created identity
name.laststringFamily name on a newly created identity
return_tohttps URIAllowlisted URL after password / sign-in. Prefer your OAuth start URL
sendbooleantrueWhen false, do not send Wocha mail; still return action_url
require_mfabooleantrueRequire TOTP enrolment on the hosted /invite flow
inviter_namestringOptional name shown in the Wocha invite email
branding_org_idstringId or slug of another organisation in your tenant whose email template, logo/colours, sender and hosted invite page brand this invite. Membership stays on the path organisation; the invitee's later auth mail keeps the brand

Response 201

{
  "identity_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "organisation_id": "11111111-2222-3333-4444-555555555555",
  "role": "member",
  "created": true,
  "emailed": false,
  "action_url": "https://id.wocha.ai/invite?flow=…&token=…&return_to=…&org_id=acme&require_mfa=true",
  "expires_at": "2026-08-22T12:00:00.000Z",
  "return_to": "https://app.example.com/api/auth/login"
}
FieldTypeDescription
identity_iduuidInvitee identity
organisation_iduuidReal organisation UUID (not the slug you may have passed)
rolestringRole that was assigned
createdbooleantrue when this call created the identity
emailedbooleantrue only when Wocha mail was accepted by the provider
action_urluriHosted /invite magic link, or /login if they already have a password
expires_atdate-timePresent when a first-password link was issued (typically 24 hours)
providerstringEmail provider when emailed is true
return_touriEcho of the allowlisted return_to

action_url is always returned, including when send is false and when Wocha mail fails after the member already exists.


Behaviour

ConditionResult
Unknown emailIdentity created (quota / MAU checked), then invited
Email exists in this tenantExisting identity is reused; created is false
Email exists in another tenant409 conflict
Identity has no passwordaction_url is /invite with flow, token, org_id, require_mfa
Identity already has a passwordaction_url is /login?org_id=&return_to=
send: true and Resend succeedsemailed: true
send: true and Resend fails201 with emailed: false and action_url
send: falseNo Wocha email; emailed: false

This endpoint does not send the recovery / forgot-password template.


SDKs

await wocha.organisations.invite(orgId, {
  email: "alex@example.com",
  role: "member",
  send: false,
  return_to: "https://app.example.com/api/auth/login",
});
client.organisations.invite(
    org_id,
    email="alex@example.com",
    role="member",
    send=False,
    return_to="https://app.example.com/api/auth/login",
)
client.Organisations.Invite(ctx, orgID, &wocha.OrgMemberInviteParams{
    Email:    "alex@example.com",
    Role:     "member",
    ReturnTo: "https://app.example.com/api/auth/login",
})
Loading playground…

Errors

StatusCodeWhen
400invalid_requestBody is not JSON
400validation_errorMissing email, invalid role, or return_to not allowlisted
401unauthorizedMissing or invalid credentials
403forbiddenMissing organisations:write
404not_foundOrganisation not found
409conflictEmail belongs to another tenant
502upstream_errorIdentity service could not create the user or link
503service_unavailableIdentity service is not configured

See also

On this page