Save Invites
PUT//localhost:58231/user-svc/invites
Invite a list of users by contact ID to acquire a role. Works on future or current users. A user can only invite an other user to a role if the user owns that role.
A user "owns" a role in the following cases:
- A static role where the role ID is prefixed with the caller's slug.
- Any dynamic or static role where the caller is an admin.
Examples:
- A user with the slug "joe-doe" owns roles like "joe-doe:any-custom-role".
- A user with any slug who has the role "my-service:admin" owns "my-service:user".
- A user with any slug who has the role "user-svc:org:{%orgId}:admin" owns "user-svc:org:{%orgId}:user".
Request
- application/json
Bodyrequired
Save Invites Request
invites object[]required
Responses
- 200
- 400
- 401
- 500
Invites saved successfully
- application/json
- Schema
- Example (auto)
Schema
invites object[]required
{
"invites": [
{
"appliedAt": "string",
"contactId": "string",
"createdAt": "string",
"deletedAt": "string",
"expiresAt": "string",
"id": "inv_fIYPbMHIcI",
"ownerIds": [
"string"
],
"roleId": "string",
"updatedAt": "string"
}
]
}
Invalid JSON
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Internal Server Error
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Authorization: Authorization
name: Authorizationtype: apiKeydescription: Type "Bearer" followed by a space and token acquired from the User Svc Login endpoint.in: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "//localhost:58231/user-svc/invites");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "<Authorization>");
var content = new StringContent("{\n \"invites\": [\n {\n \"contactId\": \"string\",\n \"id\": \"inv_fIYPbMHIcI\",\n \"roleId\": \"string\"\n }\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear