Skip to content

Latest commit

 

History

History
317 lines (214 loc) · 9.86 KB

File metadata and controls

317 lines (214 loc) · 9.86 KB

ksapi.InvitesApi

All URIs are relative to http://localhost:8000

Method HTTP request Description
accept_invite POST /v1/invites/{invite_id}/accept Accept Invite
create_invite POST /v1/invites Create Invite
delete_invite DELETE /v1/invites/{invite_id} Delete Invite
list_invites GET /v1/invites List Invites Handler

accept_invite

AcceptInviteResponse accept_invite(invite_id, authorization=authorization, ks_uat=ks_uat)

Accept Invite

Update an invite to accepted status and create tenant user.

Example

import ksapi
from ksapi.models.accept_invite_response import AcceptInviteResponse
from ksapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = ksapi.Configuration(
    host = "http://localhost:8000"
)


# Enter a context with an instance of the API client
with ksapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ksapi.InvitesApi(api_client)
    invite_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    authorization = 'authorization_example' # str |  (optional)
    ks_uat = 'ks_uat_example' # str |  (optional)

    try:
        # Accept Invite
        api_response = api_instance.accept_invite(invite_id, authorization=authorization, ks_uat=ks_uat)
        print("The response of InvitesApi->accept_invite:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->accept_invite: %s\n" % e)

Parameters

Name Type Description Notes
invite_id UUID
authorization str [optional]
ks_uat str [optional]

Return type

AcceptInviteResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_invite

InviteResponse create_invite(invite_user_request, authorization=authorization, ks_uat=ks_uat)

Create Invite

Create an invite for a user to join a tenant (admin-only).

For external IdP tenants (idp_config is set), users are added directly if they exist. For shared IdP tenants (PASSWORD/GOOGLE), an email invite is sent that must be accepted.

Example

import ksapi
from ksapi.models.invite_response import InviteResponse
from ksapi.models.invite_user_request import InviteUserRequest
from ksapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = ksapi.Configuration(
    host = "http://localhost:8000"
)


# Enter a context with an instance of the API client
with ksapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ksapi.InvitesApi(api_client)
    invite_user_request = ksapi.InviteUserRequest() # InviteUserRequest | 
    authorization = 'authorization_example' # str |  (optional)
    ks_uat = 'ks_uat_example' # str |  (optional)

    try:
        # Create Invite
        api_response = api_instance.create_invite(invite_user_request, authorization=authorization, ks_uat=ks_uat)
        print("The response of InvitesApi->create_invite:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->create_invite: %s\n" % e)

Parameters

Name Type Description Notes
invite_user_request InviteUserRequest
authorization str [optional]
ks_uat str [optional]

Return type

InviteResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_invite

delete_invite(invite_id, authorization=authorization, ks_uat=ks_uat)

Delete Invite

Hard-delete an invite (admin/owner only).

Permanently removes the invite. The invite must belong to the caller's current tenant.

Example

import ksapi
from ksapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = ksapi.Configuration(
    host = "http://localhost:8000"
)


# Enter a context with an instance of the API client
with ksapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ksapi.InvitesApi(api_client)
    invite_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    authorization = 'authorization_example' # str |  (optional)
    ks_uat = 'ks_uat_example' # str |  (optional)

    try:
        # Delete Invite
        api_instance.delete_invite(invite_id, authorization=authorization, ks_uat=ks_uat)
    except Exception as e:
        print("Exception when calling InvitesApi->delete_invite: %s\n" % e)

Parameters

Name Type Description Notes
invite_id UUID
authorization str [optional]
ks_uat str [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_invites

PaginatedResponseInviteResponse list_invites(email=email, status=status, limit=limit, offset=offset, authorization=authorization, ks_uat=ks_uat)

List Invites Handler

List invites with pagination, filtering, and sorting.

Supports filtering by tenant_id (requires admin access), email, and status. Results can be sorted by created_at, updated_at, expires_at, or accepted_at.

Example

import ksapi
from ksapi.models.invite_status import InviteStatus
from ksapi.models.paginated_response_invite_response import PaginatedResponseInviteResponse
from ksapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = ksapi.Configuration(
    host = "http://localhost:8000"
)


# Enter a context with an instance of the API client
with ksapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ksapi.InvitesApi(api_client)
    email = 'email_example' # str | Filter by email (case-insensitive partial match) (optional)
    status = ksapi.InviteStatus() # InviteStatus | Filter by invite status (pending, accepted, expired) (optional)
    limit = 20 # int | Number of items per page (optional) (default to 20)
    offset = 0 # int | Number of items to skip (optional) (default to 0)
    authorization = 'authorization_example' # str |  (optional)
    ks_uat = 'ks_uat_example' # str |  (optional)

    try:
        # List Invites Handler
        api_response = api_instance.list_invites(email=email, status=status, limit=limit, offset=offset, authorization=authorization, ks_uat=ks_uat)
        print("The response of InvitesApi->list_invites:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->list_invites: %s\n" % e)

Parameters

Name Type Description Notes
email str Filter by email (case-insensitive partial match) [optional]
status InviteStatus Filter by invite status (pending, accepted, expired) [optional]
limit int Number of items per page [optional] [default to 20]
offset int Number of items to skip [optional] [default to 0]
authorization str [optional]
ks_uat str [optional]

Return type

PaginatedResponseInviteResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]