NEW

Create team workspaces, invite members, and share inboxes across your organization. Available on the Business plan.

POST/api/teams
Auth Required

Create a new team workspace. Only available for Business plan users.

Request Body

FieldTypeRequiredDescription
namestringYesTeam name (1-100 characters)
Example Requestjson
{
  "name": "Engineering Team"
}

Response 201

FieldTypeDescription
idstringUnique team identifier
namestringTeam name
ownerIdstringUser ID of the team owner
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
Example Responsejson
{
  "id": "team_abc123",
  "name": "Engineering Team",
  "ownerId": "user_xyz789",
  "createdAt": "2025-01-30T12:00:00.000Z",
  "updatedAt": "2025-01-30T12:00:00.000Z"
}

Errors

StatusMessage
401Unauthorized
403Teams are available on the Business plan
403You've reached the maximum of 5 teams

Rate Limits

FreeNot available
ProNot available
Business5 teams max

Code Examples

curl -X POST https://destroy.network/api/teams \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Engineering Team"}'

Only Business plan users can create teams.

Maximum 5 teams per account.

The creator is automatically added as the team owner.

GET/api/teams
Auth Required

Get all teams the authenticated user is a member of.

Response 200

FieldTypeDescription
idstringTeam ID
namestringTeam name
ownerIdstringOwner user ID
memberRolestringYour role in the team (owner, admin, member)
memberCountnumberTotal number of team members
createdAtstringISO 8601 creation timestamp
Example Responsejson
[
  {
    "id": "team_abc123",
    "name": "Engineering Team",
    "ownerId": "user_xyz789",
    "memberRole": "owner",
    "memberCount": 5,
    "createdAt": "2025-01-30T12:00:00.000Z",
    "updatedAt": "2025-01-30T12:00:00.000Z"
  },
  {
    "id": "team_def456",
    "name": "Marketing Team",
    "ownerId": "user_abc123",
    "memberRole": "member",
    "memberCount": 3,
    "createdAt": "2025-01-29T10:00:00.000Z",
    "updatedAt": "2025-01-29T10:00:00.000Z"
  }
]

Errors

StatusMessage
401Unauthorized

Rate Limits

FreeNot available
ProNot available
Business60 req/min

Code Examples

curl https://destroy.network/api/teams \
  -H "Authorization: Bearer sk_live_your_api_key"
GET/api/teams/{id}
Auth Required

Get detailed information about a team including members and pending invites.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Response 200

FieldTypeDescription
idstringTeam ID
namestringTeam name
ownerIdstringOwner user ID
memberRolestringYour role in the team
membersarrayList of team members
invitesarrayPending invitations (only visible to owners/admins)
Example Responsejson
{
  "id": "team_abc123",
  "name": "Engineering Team",
  "ownerId": "user_xyz789",
  "memberRole": "owner",
  "createdAt": "2025-01-30T12:00:00.000Z",
  "updatedAt": "2025-01-30T12:00:00.000Z",
  "members": [
    {
      "id": "member_123",
      "userId": "user_xyz789",
      "email": "owner@example.com",
      "role": "owner",
      "joinedAt": "2025-01-30T12:00:00.000Z"
    },
    {
      "id": "member_456",
      "userId": "user_abc123",
      "email": "member@example.com",
      "role": "member",
      "joinedAt": "2025-01-30T14:00:00.000Z"
    }
  ],
  "invites": [
    {
      "id": "invite_789",
      "email": "newmember@example.com",
      "expiresAt": "2025-02-06T12:00:00.000Z",
      "createdAt": "2025-01-30T12:00:00.000Z"
    }
  ]
}

Errors

StatusMessage
401Unauthorized
404Team not found

Rate Limits

FreeNot available
ProNot available
Business60 req/min

Code Examples

curl https://destroy.network/api/teams/team_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"

You must be a member of the team to view it.

Pending invites are only visible to owners and admins.

PATCH/api/teams/{id}
Auth Required

Update the team name. Only owners and admins can update the team.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Request Body

FieldTypeRequiredDescription
namestringYesNew team name
Example Requestjson
{
  "name": "Product Engineering"
}

Response 200

Example Responsejson
{
  "success": true,
  "name": "Product Engineering"
}

Errors

StatusMessage
401Unauthorized
404Team not found

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X PATCH https://destroy.network/api/teams/team_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Product Engineering"}'
DELETE/api/teams/{id}
Auth Required

Permanently delete a team. Only the team owner can delete the team.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
401Unauthorized
403Only the team owner can delete the team
404Team not found

Rate Limits

FreeNot available
ProNot available
Business10 req/min

Code Examples

curl -X DELETE https://destroy.network/api/teams/team_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"

Only the team owner can delete the team.

This will remove all members and shared inbox links.

Inboxes themselves are not deleted, just the sharing links.

POST/api/teams/{id}/invite
Auth Required

Invite a user to join the team by email. The user must have an existing account.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address of the user to invite
Example Requestjson
{
  "email": "colleague@example.com"
}

Response 201

FieldTypeDescription
idstringInvite ID
emailstringInvited email address
expiresAtstringWhen the invite expires (7 days)
messagestringConfirmation message
Example Responsejson
{
  "id": "invite_abc123",
  "email": "colleague@example.com",
  "expiresAt": "2025-02-06T12:00:00.000Z",
  "message": "Invitation sent to colleague@example.com"
}

Errors

StatusMessage
400No account found with this email. The user must create an account first.
401Unauthorized
403This team has reached the maximum of 25 members
404Team not found
409This user is already a team member
409This user has already been invited

Rate Limits

FreeNot available
ProNot available
Business25 members/team

Code Examples

curl -X POST https://destroy.network/api/teams/team_abc123/invite \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"email": "colleague@example.com"}'

Only owners and admins can invite members.

The invited user must have an existing account.

Invites expire after 7 days.

Maximum 25 members per team.

DELETE/api/teams/{id}/invite/{email}
Auth Required

Cancel a pending invitation.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID
emailstringYesEmail of the pending invite to cancel

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
401Unauthorized
404Team not found
404Invite not found

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X DELETE "https://destroy.network/api/teams/team_abc123/invite/colleague%40example.com" \
  -H "Authorization: Bearer sk_live_your_api_key"
DELETE/api/teams/{id}/members/{userId}
Auth Required

Remove a member from the team. Users can also remove themselves (leave team).

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID
userIdstringYesUser ID of the member to remove

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
401Unauthorized
403The team owner cannot be removed
403Only owners and admins can remove members
404Member not found

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X DELETE https://destroy.network/api/teams/team_abc123/members/user_xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key"

Owners and admins can remove other members.

Any member can remove themselves (leave the team).

The team owner cannot be removed.

PATCH/api/teams/{id}/members/{userId}
Auth Required

Change a team member's role. Only the team owner can change roles.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID
userIdstringYesUser ID of the member

Request Body

FieldTypeRequiredDescription
rolestringYesNew role: 'admin' or 'member'
Example Requestjson
{
  "role": "admin"
}

Response 200

Example Responsejson
{
  "success": true,
  "role": "admin"
}

Errors

StatusMessage
401Unauthorized
403Only the team owner can change member roles
403Cannot change the owner's role
404Member not found

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X PATCH https://destroy.network/api/teams/team_abc123/members/user_xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"role": "admin"}'

Only the team owner can change roles.

Cannot change the owner's role.

Valid roles: 'admin', 'member'

POST/api/teams/{id}/inboxes
Auth Required

Share one of your inboxes with the team. All team members will be able to access it.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Request Body

FieldTypeRequiredDescription
inboxIdstringYesID of your inbox to share
Example Requestjson
{
  "inboxId": "inbox_abc123"
}

Response 201

FieldTypeDescription
idstringShare record ID
teamIdstringTeam ID
inboxIdstringInbox ID
sharedAtstringISO 8601 timestamp
messagestringConfirmation message
Example Responsejson
{
  "id": "share_abc123",
  "teamId": "team_abc123",
  "inboxId": "inbox_xyz789",
  "sharedBy": "user_abc123",
  "sharedAt": "2025-01-30T12:00:00.000Z",
  "message": "Inbox tmp_8hf2@destroy.network shared with the team."
}

Errors

StatusMessage
401Unauthorized
404Team not found
404Inbox not found or you don't own this inbox
409This inbox is already shared with this team

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X POST https://destroy.network/api/teams/team_abc123/inboxes \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"inboxId": "inbox_xyz789"}'

You can only share inboxes that you own.

Any team member can share their inboxes.

All team members will be able to view the shared inbox and its messages.

GET/api/teams/{id}/inboxes
Auth Required

Get all inboxes shared with the team.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID

Response 200

FieldTypeDescription
idstringShare record ID
inboxIdstringInbox ID
addressstringInbox email address
domainstringInbox domain
expiresAtstringInbox expiration timestamp
sharedBystringUser ID who shared it
sharedByEmailstringEmail of user who shared it
sharedAtstringWhen it was shared
Example Responsejson
[
  {
    "id": "share_abc123",
    "inboxId": "inbox_xyz789",
    "address": "tmp_8hf2@destroy.network",
    "domain": "destroy.network",
    "expiresAt": "2025-01-30T18:00:00.000Z",
    "inboxCreatedAt": "2025-01-30T12:00:00.000Z",
    "sharedBy": "user_abc123",
    "sharedByEmail": "owner@example.com",
    "sharedAt": "2025-01-30T12:30:00.000Z"
  }
]

Errors

StatusMessage
401Unauthorized
404Team not found

Rate Limits

FreeNot available
ProNot available
Business60 req/min

Code Examples

curl https://destroy.network/api/teams/team_abc123/inboxes \
  -H "Authorization: Bearer sk_live_your_api_key"
DELETE/api/teams/{id}/inboxes/{inboxId}
Auth Required

Remove an inbox from the team. The person who shared it or team admins can unshare.

Path Parameters

NameTypeRequiredDescription
idstringYesTeam ID
inboxIdstringYesInbox ID to unshare

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
401Unauthorized
403Only the person who shared the inbox or team admins can unshare it
404Shared inbox not found

Rate Limits

FreeNot available
ProNot available
Business30 req/min

Code Examples

curl -X DELETE https://destroy.network/api/teams/team_abc123/inboxes/inbox_xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key"

The person who shared it or team owners/admins can unshare.

Unsharing does not delete the inbox, just removes team access.

GET/api/user/invites
Auth Required

Get all pending team invitations for the current user.

Response 200

FieldTypeDescription
idstringInvite ID
teamIdstringTeam ID
teamNamestringTeam name
invitedByEmailstringEmail of the person who invited you
expiresAtstringInvite expiration timestamp
createdAtstringWhen the invite was sent
Example Responsejson
[
  {
    "id": "invite_abc123",
    "teamId": "team_xyz789",
    "teamName": "Engineering Team",
    "invitedByEmail": "owner@example.com",
    "expiresAt": "2025-02-06T12:00:00.000Z",
    "createdAt": "2025-01-30T12:00:00.000Z"
  }
]

Errors

StatusMessage
401Unauthorized

Rate Limits

Free60 req/min
Pro60 req/min
Business60 req/min

Code Examples

curl https://destroy.network/api/user/invites \
  -H "Authorization: Bearer sk_live_your_api_key"
POST/api/user/invites/{id}/accept
Auth Required

Accept a team invitation and join the team.

Path Parameters

NameTypeRequiredDescription
idstringYesInvite ID

Response 200

FieldTypeDescription
successbooleanWhether the operation succeeded
teamIdstringThe team you joined
teamNamestringName of the team
messagestringConfirmation message
Example Responsejson
{
  "success": true,
  "teamId": "team_xyz789",
  "teamName": "Engineering Team",
  "message": "You have joined the team \"Engineering Team\""
}

Errors

StatusMessage
401Unauthorized
403This team has reached its maximum member limit
404Invite not found or expired
409You are already a member of this team

Rate Limits

Free10 req/min
Pro10 req/min
Business10 req/min

Code Examples

curl -X POST https://destroy.network/api/user/invites/invite_abc123/accept \
  -H "Authorization: Bearer sk_live_your_api_key"
DELETE/api/user/invites/{id}
Auth Required

Decline a team invitation.

Path Parameters

NameTypeRequiredDescription
idstringYesInvite ID

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
401Unauthorized
404Invite not found

Rate Limits

Free10 req/min
Pro10 req/min
Business10 req/min

Code Examples

curl -X DELETE https://destroy.network/api/user/invites/invite_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"
GET/api/user/shared-inboxes
Auth Required

Get all inboxes shared with you through team memberships. These are inboxes owned by other users that you have access to as a team member.

Response 200

FieldTypeDescription
idstringInbox ID
addressstringInbox email address
domainstringInbox domain
expiresAtstringInbox expiration timestamp
createdAtstringWhen the inbox was created
teamIdstringTeam ID that shared the inbox
teamNamestringName of the team
ownerEmailstringEmail of the inbox owner
Example Responsejson
[
  {
    "id": "inbox_abc123",
    "address": "support@destroy.network",
    "domain": "destroy.network",
    "expiresAt": "2025-01-30T18:00:00.000Z",
    "createdAt": "2025-01-30T12:00:00.000Z",
    "teamId": "team_xyz789",
    "teamName": "Engineering Team",
    "ownerEmail": "owner@example.com"
  },
  {
    "id": "inbox_def456",
    "address": "billing@destroy.network",
    "domain": "destroy.network",
    "expiresAt": "2025-01-30T20:00:00.000Z",
    "createdAt": "2025-01-30T14:00:00.000Z",
    "teamId": "team_abc123",
    "teamName": "Sales Team",
    "ownerEmail": "sales@example.com"
  }
]

Errors

StatusMessage
401Unauthorized

Rate Limits

FreeNot available
ProNot available
Business60 req/min

Code Examples

curl https://destroy.network/api/user/shared-inboxes \
  -H "Authorization: Bearer sk_live_your_api_key"

Returns inboxes from all teams you are a member of.

Only shows active (non-expired) inboxes.

Does not include inboxes you own (use /api/user/inboxes for your own).

You can access these inboxes to view messages but cannot modify settings like forwarding or aliases.