Manage Organizations in Wacht
fetchOrganizations(options?: ListOrganizationsOptions)
options
(optional): An object containing pagination and filtering options.
page
(number): The page number to retrieve.per_page
(number): The number of items per page.search
(string): Search term for organizations.Promise<OrganizationListResponse>
: A promise that resolves to a list of organizations and pagination information.
createOrganization(request: CreateOrganizationRequest)
request
(CreateOrganizationRequest): The request body containing the details of the new organization.Promise<Organization>
: A promise that resolves to the newly created organization object.
fetchOrganization(organizationId: string)
organizationId
(string): The unique identifier of the organization.Promise<Organization>
: A promise that resolves to the organization object.
updateOrganization(organizationId: string, request: UpdateOrganizationRequest)
organizationId
(string): The unique identifier of the organization to update.request
(UpdateOrganizationRequest): The request body containing the updated details of the organization.Promise<Organization>
: A promise that resolves to the updated organization object.
deleteOrganization(organizationId: string)
organizationId
(string): The unique identifier of the organization to delete.Promise<void>
: A promise that resolves when the organization is successfully deleted.
addOrganizationMember(organizationId: string, request: AddOrganizationMemberRequest)
organizationId
(string): The unique identifier of the organization.request
(AddOrganizationMemberRequest): The request body containing the member details.Promise<OrganizationMember>
: A promise that resolves to the newly added organization member object.
updateOrganizationMember(organizationId: string, membershipId: string, request: UpdateOrganizationMemberRequest)
organizationId
(string): The unique identifier of the organization.membershipId
(string): The unique identifier of the membership to update.request
(UpdateOrganizationMemberRequest): The request body containing the updated member details.Promise<OrganizationMember>
: A promise that resolves to the updated organization member object.
removeOrganizationMember(organizationId: string, membershipId: string)
organizationId
(string): The unique identifier of the organization.membershipId
(string): The unique identifier of the membership to remove.Promise<void>
: A promise that resolves when the member is successfully removed.
fetchOrganizationRoles()
Promise<OrganizationRoleListResponse>
: A promise that resolves to a list of organization roles.
createOrganizationRole(organizationId: string, request: CreateRoleRequest)
organizationId
(string): The unique identifier of the organization.request
(CreateRoleRequest): The request body containing the details of the new role.Promise<OrganizationRole>
: A promise that resolves to the newly created organization role object.
updateOrganizationRole(organizationId: string, roleId: string, request: UpdateRoleRequest)
organizationId
(string): The unique identifier of the organization.roleId
(string): The unique identifier of the role to update.request
(UpdateRoleRequest): The request body containing the updated details of the role.Promise<OrganizationRole>
: A promise that resolves to the updated organization role object.
deleteOrganizationRole(organizationId: string, roleId: string)
organizationId
(string): The unique identifier of the organization.roleId
(string): The unique identifier of the role to delete.Promise<void>
: A promise that resolves when the role is successfully deleted.