Teams
sfp server API reference for Teams: 7 endpoints.
/sfp/api/teamsRetrieves all user-facing teams in the organization. For each team, returns: - Team details (ID, name, slug, description) - Number of visible members (hidden system users are not counted) - The requesting user's role in the team (owner, member, or null when not a member)
This is the authoritative team listing: it includes teams that have no visible members yet, such as teams freshly created by the managing admin. The hidden admin team is never returned.Authorization
access-token In: header
Response Body
application/json
curl -X GET "https://example.com/sfp/api/teams"{ "teams": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Engineering Team", "slug": "engineering-team", "description": "Team responsible for product engineering", "memberCount": 5, "userRole": "owner", "created_at": "2025-05-04T07:36:07Z" } ], "total": 4}/sfp/api/teamsCreates a new team within the organization. Teams are used to: - Group users for collaborative access to resources - Manage permissions at a team level - Organize repositories, environments, and other resources
The team slug must be unique and URL-friendly. The creating user automatically becomes a team owner. Only users with owner role can create new teams.Authorization
access-token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/sfp/api/teams" \ -H "Content-Type: application/json" \ -d '{ "name": "Engineering Team", "slug": "engineering-team" }'{ "success": true, "team": { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Engineering Team", "slug": "engineering-team", "description": "Team responsible for product engineering", "primary_owner_user_id": "123e4567-e89b-12d3-a456-426614174000", "email": "team@example.com", "created_at": "2025-05-04T07:36:07Z" }, "error": "Team with this slug already exists"}/sfp/api/teams/{slug}/membersRetrieves a paginated list of members belonging to a specific team. Returns detailed information about each member including: - User details (ID, email, name) - Role within the team (owner or member) - Join date and last activity
Supports filtering by role and pagination via limit/offset. All authenticated users can view team member lists for teams they have access to. Team membership is verified based on the requesting user's permissions.Authorization
access-token In: header
Path Parameters
Team slug
Query Parameters
Maximum number of members to return
Offset for pagination
Filter by role
Value in
- "owner"
- "member"
Response Body
application/json
curl -X GET "https://example.com/sfp/api/teams/string/members"{ "members": [ { "user_id": "123e4567-e89b-12d3-a456-426614174000", "account_id": "123e4567-e89b-12d3-a456-426614174000", "email": "user@example.com", "first_name": "Jane", "last_name": "Doe", "role": "member", "created_at": "2025-05-04T07:36:07Z" } ], "total": 20}/sfp/api/teams/{slug}/membersAdds a new member to an existing team with the specified role. This endpoint: - Creates team membership if user exists in the system - Assigns the specified role (owner or member) - Grants access to team resources based on role - Sends notification to the new member
The user must already have an account in the system. Use the users endpoint to create new users first. Only team owners can add new members.Authorization
access-token In: header
Path Parameters
Team slug
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/sfp/api/teams/string/members" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "role": "member" }'{ "success": true, "membership": { "user_id": "123e4567-e89b-12d3-a456-426614174000", "account_id": "123e4567-e89b-12d3-a456-426614174000", "email": "user@example.com", "first_name": "Jane", "last_name": "Doe", "role": "member", "created_at": "2025-05-04T07:36:07Z" }, "error": "User not found"}/sfp/api/teams/{slug}Permanently deletes a team and all its associations. This action: - Removes all team memberships - Disassociates team from repositories and resources - Removes team-specific permissions and access - Cannot be undone
All team resources must be reassigned or deleted before team deletion. Only users with owner role can delete teams. The last team in an organization cannot be deleted.Authorization
access-token In: header
Path Parameters
Team slug
Response Body
application/json
curl -X DELETE "https://example.com/sfp/api/teams/string"{ "success": true, "error": "Team not found"}/sfp/api/teams/{slug}/members/{email}Removes a member from a team, revoking their access to team resources. This action: - Removes team membership immediately - Revokes access to all team repositories and resources - Removes team-specific permissions - Does not delete the user account
Team must maintain at least one owner. Users cannot remove themselves if they are the last owner. Only team owners can remove members.Authorization
access-token In: header
Path Parameters
Team slug
Member email
Response Body
application/json
curl -X DELETE "https://example.com/sfp/api/teams/string/members/string"{ "success": true, "error": "User not found in team"}/sfp/api/teams/{slug}/members/{email}/roleChanges the role of an existing team member. Available roles: - owner: Full team management permissions, can add/remove members - member: Access to team resources but no management permissions
Role changes take effect immediately. Teams must maintain at least one owner. Users cannot demote themselves if they are the last owner. Only team owners can change member roles.Authorization
access-token In: header
Path Parameters
Team slug
Member email
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "https://example.com/sfp/api/teams/string/members/string/role" \ -H "Content-Type: application/json" \ -d '{ "role": "owner" }'{ "success": true, "membership": { "user_id": "123e4567-e89b-12d3-a456-426614174000", "account_id": "123e4567-e89b-12d3-a456-426614174000", "email": "user@example.com", "first_name": "Jane", "last_name": "Doe", "role": "member", "created_at": "2025-05-04T07:36:07Z" }, "error": "User not found"}