Users - Invites

To add a new user to a tenant, a current user with the tenant administrator role must send an invite to the user. This applies both for existing users of another tenant or entirely new users. After being invited, users then have the ability to accept or decline invites. If a user accepts the invitation, the user is automatically added to the tenant.

ArgumentExampleDescription
created_by
string
"[email protected]"(read only) The email of the user who sent the invite.
invited_user_email
string
"[email protected]"(read only) The email of the invites user.
invitation_status
string
"pending", "accepted", "declined"The status of the invite. can be "pending", "accepted", or "declined".
tenant_name
string
"My Tenant"(read only) The name of the tenant the invite is for.
tenant_id
string
"d3s1hwewhrhr"(read only) The id of the tenant the invite is for.
resend_counter
integer
3(read only) The number of time the invitation was resent.
last_resend_by
string
"[email protected]"(read only) The email of the user who last resent the invite.
last_resend_at
float
1508432670(read only) The date the invite was the last resent.
created_at
float
1508432670(read only) The date the invite was created.
accepted_at
float
1508432670(read only) The date the invite was accepted.

Get User Invites

The Get User Invites endpoint returns "pending" user invites.

GET /1/users/{user_id}/invites
Host: https://api.cogniac.io

Example: Get All Pending User Invites

curl -X GET https://api.cogniac.io/1/users/current/invites \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz"
import requests

my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}

res = requests.get("https://api.cogniac.io/1/users/current/invites",
                   headers=my_headers)
[
  {
    "last_resend_at": 1508432670, 
    "accepted_at": null, 
    "tenant_id": "d3s1hwewhrhr", 
    "created_at": 1508432670, 
    "last_resend_by": "[email protected]", 
    "created_by": "[email protected]", 
    "resend_counter": 3, 
    "tenant_name": "My Organization Tenant", 
    "invited_user_email": "[email protected]", 
    "invitation_status": "pending"
  }
]

Update User Invite

tenant_id and invitation_status are required fields. invitation_status must equal "accepted" or "declined".

POST /1/users/{user_id}/invites
Host: https://api.cogniac.io
{
  "invitation_status": "accepted",
  "tenant_id": "d3s7hwewhttr"
}
{
  "last_resend_at": 1508432670, 
  "accepted_at": 1508432670, 
  "tenant_id": "d3s7hwewhttr", 
  "created_at": 1508432670, 
  "last_resend_by": "[email protected]", 
  "created_by": "[email protected]", 
  "resend_counter": 3, 
  "tenant_name": "My Organization Tenant", 
  "invited_user_email": "[email protected]", 
  "invitation_status": "accepted"
}