Skip to main content

Organizations

List organizations

Retrieve a paginated list of organizations.
await avala.organizations.list(options?)
options
object
Optional parameters for pagination.
limit
number
Maximum number of organizations to return per page.
cursor
string
Cursor for pagination to fetch the next page of results.
items
Organization[]
Array of organization objects.
uid
string
Unique identifier for the organization.
name
string
Name of the organization.
slug
string
URL-friendly slug for the organization.
handle
string | null
Public handle for the organization.
description
string | null
Description of the organization.
URL to the organization’s logo.
website
string | null
Organization’s website URL.
industry
string | null
Industry the organization operates in.
visibility
string | null
Visibility setting for the organization.
memberCount
number | null
Number of members in the organization.
teamCount
number | null
Number of teams in the organization.
role
string | null
Current user’s role in the organization.
nextCursor
string | null
Cursor for the next page of results.
previousCursor
string | null
Cursor for the previous page of results.
hasMore
boolean
Whether there are more results available.

Get organization

Retrieve a specific organization by its slug.
await avala.organizations.get(slug)
slug
string
required
The slug of the organization to retrieve.

Create organization

Create a new organization.
await avala.organizations.create(options)
options
object
required
name
string
required
Name of the organization.
description
string
Description of the organization.
logo
string
URL to the organization’s logo.
website
string
Organization’s website URL.
industry
string
Industry the organization operates in.
email
string
Contact email for the organization.
phone
string
Contact phone number for the organization.
visibility
string
Visibility setting for the organization.

Update organization

Update an existing organization.
await avala.organizations.update(slug, options)
slug
string
required
The slug of the organization to update.
options
object
required
name
string
Name of the organization.
description
string
Description of the organization.
logo
string
URL to the organization’s logo.
website
string
Organization’s website URL.
handle
string
Public handle for the organization.
industry
string
Industry the organization operates in.
email
string
Contact email for the organization.
phone
string
Contact phone number for the organization.
visibility
string
Visibility setting for the organization.

Delete organization

Delete an organization.
await avala.organizations.delete(slug)
slug
string
required
The slug of the organization to delete.

Get industry choices

Retrieve available industry choices for organizations.
await avala.organizations.industryChoices()
Returns a record of available industry options.

Members

List members

Retrieve a paginated list of organization members.
await avala.organizations.listMembers(slug, options?)
slug
string
required
The slug of the organization.
options
object
Search query to filter members.
role
string
Filter members by role.
limit
number
Maximum number of members to return per page.
cursor
string
Cursor for pagination.
items
OrganizationMember[]
Array of organization member objects.
userUid
string
Unique identifier for the user.
username
string | null
Username of the member.
email
string | null
Email address of the member.
fullName
string | null
Full name of the member.
picture
string | null
URL to the member’s profile picture.
role
string | null
Member’s role in the organization.
createdAt
string | null
Timestamp when the member joined.

Remove member

Remove a member from an organization.
await avala.organizations.removeMember(slug, userUid)
slug
string
required
The slug of the organization.
userUid
string
required
The unique identifier of the user to remove.

Update member role

Update a member’s role in an organization.
await avala.organizations.updateMemberRole(slug, userUid, options)
slug
string
required
The slug of the organization.
userUid
string
required
The unique identifier of the user.
options
object
required
role
string
required
New role for the member.

Leave organization

Leave an organization as the current user.
await avala.organizations.leave(slug)
slug
string
required
The slug of the organization to leave.

Transfer ownership

Transfer ownership of an organization to another member.
await avala.organizations.transferOwnership(slug, options)
slug
string
required
The slug of the organization.
options
object
required
newOwnerUid
string
required
The unique identifier of the new owner.

Invitations

List invitations

Retrieve all invitations for an organization.
await avala.organizations.listInvitations(slug)
slug
string
required
The slug of the organization.
invitations
Invitation[]
Array of invitation objects.
uid
string
Unique identifier for the invitation.
invitedEmail
string
Email address of the invited user.
invitedByUsername
string | null
Username of the user who sent the invitation.
role
string | null
Role assigned to the invitation.
status
string | null
Current status of the invitation.
expiresAt
string | null
Expiration timestamp for the invitation.
isExpired
boolean | null
Whether the invitation has expired.
acceptUrl
string | null
URL to accept the invitation.

Create invitation

Create a new invitation to join an organization.
await avala.organizations.createInvitation(slug, options)
slug
string
required
The slug of the organization.
options
object
required
email
string
required
Email address of the user to invite.
role
string
Role to assign to the invited user.

Resend invitation

Resend an existing invitation.
await avala.organizations.resendInvitation(slug, invitationUid)
slug
string
required
The slug of the organization.
invitationUid
string
required
The unique identifier of the invitation to resend.

Cancel invitation

Cancel a pending invitation.
await avala.organizations.cancelInvitation(slug, invitationUid)
slug
string
required
The slug of the organization.
invitationUid
string
required
The unique identifier of the invitation to cancel.

Teams

List teams

Retrieve all teams in an organization.
await avala.organizations.listTeams(slug)
slug
string
required
The slug of the organization.
teams
Team[]
Array of team objects.
uid
string
Unique identifier for the team.
name
string
Name of the team.
slug
string | null
URL-friendly slug for the team.
description
string | null
Description of the team.
color
string | null
Color associated with the team.
memberCount
number | null
Number of members in the team.

Create team

Create a new team in an organization.
await avala.organizations.createTeam(slug, options)
slug
string
required
The slug of the organization.
options
object
required
name
string
required
Name of the team.
description
string
Description of the team.
color
string
Color code for the team.

Get team

Retrieve a specific team by its slug.
await avala.organizations.getTeam(slug, teamSlug)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team to retrieve.

Update team

Update an existing team.
await avala.organizations.updateTeam(slug, teamSlug, options)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team to update.
options
object
required
name
string
Name of the team.
description
string
Description of the team.
color
string
Color code for the team.

Delete team

Delete a team from an organization.
await avala.organizations.deleteTeam(slug, teamSlug)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team to delete.

Team members

List team members

Retrieve all members of a team.
await avala.organizations.listTeamMembers(slug, teamSlug)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team.
members
TeamMember[]
Array of team member objects.
userUid
string
Unique identifier for the user.
username
string | null
Username of the member.
email
string | null
Email address of the member.
fullName
string | null
Full name of the member.
role
string | null
Member’s role in the team.

Add team member

Add a member to a team.
await avala.organizations.addTeamMember(slug, teamSlug, options)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team.
options
object
required
userUid
string
required
Unique identifier of the user to add.
role
string
Role to assign to the team member.

Remove team member

Remove a member from a team.
await avala.organizations.removeTeamMember(slug, teamSlug, userUid)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team.
userUid
string
required
The unique identifier of the user to remove.

Update team member role

Update a team member’s role.
await avala.organizations.updateTeamMemberRole(slug, teamSlug, userUid, options)
slug
string
required
The slug of the organization.
teamSlug
string
required
The slug of the team.
userUid
string
required
The unique identifier of the user.
options
object
required
role
string
required
New role for the team member.

Build docs developers (and LLMs) love