Teams
Create team workspaces, invite members, and share inboxes across your organization. Available on the Business plan.
/api/teamsCreate Team
Create a new team workspace. Only available for Business plan users.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Team name (1-100 characters) |
{
"name": "Engineering Team"
}Response 201
| Field | Type | Description |
|---|---|---|
id | string | Unique team identifier |
name | string | Team name |
ownerId | string | User ID of the team owner |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |
{
"id": "team_abc123",
"name": "Engineering Team",
"ownerId": "user_xyz789",
"createdAt": "2025-01-30T12:00:00.000Z",
"updatedAt": "2025-01-30T12:00:00.000Z"
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | Teams are available on the Business plan |
| 403 | You've reached the maximum of 5 teams |
Rate Limits
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.
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Team ID |
name | string | Team name |
ownerId | string | Owner user ID |
memberRole | string | Your role in the team (owner, admin, member) |
memberCount | number | Total number of team members |
createdAt | string | ISO 8601 creation timestamp |
[
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
Rate Limits
Code Examples
curl https://destroy.network/api/teams \
-H "Authorization: Bearer sk_live_your_api_key"/api/teams/{id}Get Team
Get detailed information about a team including members and pending invites.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Team ID |
name | string | Team name |
ownerId | string | Owner user ID |
memberRole | string | Your role in the team |
members | array | List of team members |
invites | array | Pending invitations (only visible to owners/admins) |
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Team not found |
Rate Limits
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.
/api/teams/{id}Update Team
Update the team name. Only owners and admins can update the team.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New team name |
{
"name": "Product Engineering"
}Response 200
{
"success": true,
"name": "Product Engineering"
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Team not found |
Rate Limits
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"}'/api/teams/{id}Delete Team
Permanently delete a team. Only the team owner can delete the team.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Response 200
{
"success": true
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | Only the team owner can delete the team |
| 404 | Team not found |
Rate Limits
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.
/api/teams/{id}/inviteInvite Member
Invite a user to join the team by email. The user must have an existing account.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address of the user to invite |
{
"email": "colleague@example.com"
}Response 201
| Field | Type | Description |
|---|---|---|
id | string | Invite ID |
email | string | Invited email address |
expiresAt | string | When the invite expires (7 days) |
message | string | Confirmation message |
{
"id": "invite_abc123",
"email": "colleague@example.com",
"expiresAt": "2025-02-06T12:00:00.000Z",
"message": "Invitation sent to colleague@example.com"
}Errors
| Status | Message |
|---|---|
| 400 | No account found with this email. The user must create an account first. |
| 401 | Unauthorized |
| 403 | This team has reached the maximum of 25 members |
| 404 | Team not found |
| 409 | This user is already a team member |
| 409 | This user has already been invited |
Rate Limits
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.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
email | string | Yes | Email of the pending invite to cancel |
Response 200
{
"success": true
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Team not found |
| 404 | Invite not found |
Rate Limits
Code Examples
curl -X DELETE "https://destroy.network/api/teams/team_abc123/invite/colleague%40example.com" \
-H "Authorization: Bearer sk_live_your_api_key"/api/teams/{id}/members/{userId}Remove Member
Remove a member from the team. Users can also remove themselves (leave team).
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
userId | string | Yes | User ID of the member to remove |
Response 200
{
"success": true
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | The team owner cannot be removed |
| 403 | Only owners and admins can remove members |
| 404 | Member not found |
Rate Limits
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.
/api/teams/{id}/members/{userId}Update Member Role
Change a team member's role. Only the team owner can change roles.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
userId | string | Yes | User ID of the member |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
role | string | Yes | New role: 'admin' or 'member' |
{
"role": "admin"
}Response 200
{
"success": true,
"role": "admin"
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | Only the team owner can change member roles |
| 403 | Cannot change the owner's role |
| 404 | Member not found |
Rate Limits
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'
/api/teams/{id}/inboxesShare Inbox
Share one of your inboxes with the team. All team members will be able to access it.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
inboxId | string | Yes | ID of your inbox to share |
{
"inboxId": "inbox_abc123"
}Response 201
| Field | Type | Description |
|---|---|---|
id | string | Share record ID |
teamId | string | Team ID |
inboxId | string | Inbox ID |
sharedAt | string | ISO 8601 timestamp |
message | string | Confirmation message |
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Team not found |
| 404 | Inbox not found or you don't own this inbox |
| 409 | This inbox is already shared with this team |
Rate Limits
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.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Share record ID |
inboxId | string | Inbox ID |
address | string | Inbox email address |
domain | string | Inbox domain |
expiresAt | string | Inbox expiration timestamp |
sharedBy | string | User ID who shared it |
sharedByEmail | string | Email of user who shared it |
sharedAt | string | When it was shared |
[
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Team not found |
Rate Limits
Code Examples
curl https://destroy.network/api/teams/team_abc123/inboxes \
-H "Authorization: Bearer sk_live_your_api_key"/api/teams/{id}/inboxes/{inboxId}Unshare Inbox
Remove an inbox from the team. The person who shared it or team admins can unshare.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Team ID |
inboxId | string | Yes | Inbox ID to unshare |
Response 200
{
"success": true
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | Only the person who shared the inbox or team admins can unshare it |
| 404 | Shared inbox not found |
Rate Limits
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.
/api/user/invitesList My Invites
Get all pending team invitations for the current user.
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Invite ID |
teamId | string | Team ID |
teamName | string | Team name |
invitedByEmail | string | Email of the person who invited you |
expiresAt | string | Invite expiration timestamp |
createdAt | string | When the invite was sent |
[
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
Rate Limits
Code Examples
curl https://destroy.network/api/user/invites \
-H "Authorization: Bearer sk_live_your_api_key"/api/user/invites/{id}/acceptAccept Invite
Accept a team invitation and join the team.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Invite ID |
Response 200
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the operation succeeded |
teamId | string | The team you joined |
teamName | string | Name of the team |
message | string | Confirmation message |
{
"success": true,
"teamId": "team_xyz789",
"teamName": "Engineering Team",
"message": "You have joined the team \"Engineering Team\""
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 403 | This team has reached its maximum member limit |
| 404 | Invite not found or expired |
| 409 | You are already a member of this team |
Rate Limits
Code Examples
curl -X POST https://destroy.network/api/user/invites/invite_abc123/accept \
-H "Authorization: Bearer sk_live_your_api_key"Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Invite ID |
Response 200
{
"success": true
}Errors
| Status | Message |
|---|---|
| 401 | Unauthorized |
| 404 | Invite not found |
Rate Limits
Code Examples
curl -X DELETE https://destroy.network/api/user/invites/invite_abc123 \
-H "Authorization: Bearer sk_live_your_api_key"/api/user/shared-inboxesList Shared Inboxes
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
| Field | Type | Description |
|---|---|---|
id | string | Inbox ID |
address | string | Inbox email address |
domain | string | Inbox domain |
expiresAt | string | Inbox expiration timestamp |
createdAt | string | When the inbox was created |
teamId | string | Team ID that shared the inbox |
teamName | string | Name of the team |
ownerEmail | string | Email of the inbox owner |
[
{
"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
| Status | Message |
|---|---|
| 401 | Unauthorized |
Rate Limits
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.
