DocsTeamsInvitations

Team Invitations

Manage team invitations.

List Invitations

Endpoint

GET ${baseUrl}/teams/invitations

Response

interface TeamInvitationsResponse {
  success: boolean
  data: {
    name: string
    team_id: number
    status: 'INVITED'
    admin_name: string
    admin_email: string
  }[]
}

Accept Invitation

Endpoint

PUT ${baseUrl}/teams/accept-join-request

Request Body

interface AcceptJoinRequestRequest {
  teamId: number
}

Response

interface AcceptJoinRequestResponse {
  success: boolean
  message: string
}

Decline Invitation

Endpoint

PUT ${baseUrl}/teams/decline-join-request

Request Body

interface DeclineJoinRequestRequest {
  teamId: number
}

Example Requests

// List invitations
const invitations = await fetch('${baseUrl}/teams/invitations', {
  headers: {
    Authorization: 'Basic YOUR_API_KEY',
  },
})
 
// Accept invitation
const acceptInvite = await fetch('${baseUrl}/teams/accept-join-request', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    teamId: 123,
  }),
})
 
// Decline invitation
const declineInvite = await fetch('${baseUrl}/teams/decline-join-request', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    teamId: 123,
  }),
})

Error Codes

Status CodeDescription
200Success
201Invitation Created
400Invalid Request
401Unauthorized
403Forbidden
404Team or Invitation Not Found
409User Already Invited
500Server Error