Skip to main content

createInvitationLink

InvitationLinkWrapper createInvitationLink(InvitationLinkCreateRequestDto)

POST /api/2.0/portal/users/invitationlink

Create an invitation link

Creates the portal's invitation link for one role and returns it together with the URL to share. A portal keeps at most one link per role, so a call for a role that already has one is refused - read the existing link with GET api/2.0/portal/users/invitationlink/{employeeType} and change it with PUT api/2.0/portal/users/invitationlink instead. Inviting members has to be enabled for the portal (GET api/2.0/settings/invitationsettings), employeeType has to be DocSpaceAdmin, RoomAdmin or User, and expiration, when given, has to lie in the future and is read in the portal time zone. The caller needs the right to add users of that role, only the portal owner may create the DocSpace administrator link, and a link for a paying role is refused while the portal payment is overdue or the portal quota has no free paid seat left. The call is mutating and not idempotent. The answer carries the id needed to update or delete the link, the shortened url, maxUseCount and currentUseCount, expiration in the portal time zone - empty for a link that never expires - and isExpired.

Parameters​

NameInTypeDescriptionNotes
InvitationLinkCreateRequestDtobodyInvitationLinkCreateRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The invitation link as it was created, with the id to address it later and the url to shareInvitationLinkWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, the role is not DocSpaceAdmin, RoomAdmin or User, the use limit is outside 1-1000, the deadline is in the past, or the role already has a link--
402The link is for a paying role, and the portal payment is overdue or the portal quota has no free paid seat left--
403Inviting members is disabled for the portal, the caller has no right to add users of that role, or a non-owner asks for the DocSpace administrator link--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

InvitationLinkWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json