Company membership

Bulk-invite a member across companies

Invites the same email (with one role) to multiple companies at once, sharing a single invitation token and sending a single email.

The invitation is partial: companies where the email cannot be invited are skipped and the rest are processed. Each skipped company comes back in skipped with a stable reason:

  • already_member: the email already belongs to a member of that company.
  • owner_invitation: the email has a pending owner invitation there and the caller is not an owner of that company, so it cannot be moved.
  • role_not_found: the company does not define the requested role.
  • already_invited: another invitation for that company was created at the same time.

A pending invitation for the same email in one of the selected companies is not skipped: it is moved to the new token with the new role and returned in reinvited. Pending invitations in companies that were not selected keep their previous link.

Permissions are not skipped: the caller needs members_management in every target company, and assigning the owner role requires the caller to be an owner of each one; otherwise the whole request is rejected with 403.

At most 200 companies per request: larger lists are rejected with 422 (too_many_companies) and nothing is processed, so split them into batches of up to 200.

Every 403, 412 and 422 carries a stable code (forbidden, owner_only, parameter_missing, too_many_companies, invalid_companies, nothing_to_invite); branch on it instead of on the English message.

post/v1/company_memberships/create_many

Request

  • Base URL
    https://api.cardda.com
  • URL
    https://api.cardda.com/v1/company_memberships/create_many
  • Auth
    HTTP bearer

Parameters

#/paths/~1v1~1users/get/parameters/0 (unresolved $ref)

Request body

emailstring email required
rolestring required
company_idsstring[] required

Company UUIDs to invite the email into. At most 200 per request.

Example request

{
  "role": "member"
}

Response

At least one company was processed.

OR

Example response

{
  "created": [
    {
      "role": "member",
      "status": "active"
    }
  ],
  "reinvited": [
    {
      "previous_role": "member"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.