Teams
Collaborate with team members on extractions and share API access.
Endpoints
Create Team
Create a new team.
POST /api/teams
Request Body:
{
"name": "Design System Team",
"description": "Monitoring our component library"
}
Response:
{
"id": "team_abc123",
"name": "Design System Team",
"description": "Monitoring our component library",
"owner_id": "user_xyz789",
"created_at": "2024-01-15T10:30:00Z"
}
List Teams
Get all teams you belong to.
GET /api/teams
Response:
{
"data": [
{
"id": "team_abc123",
"name": "Design System Team",
"role": "owner",
"member_count": 5,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "team_def456",
"name": "Marketing Site",
"role": "member",
"member_count": 3,
"created_at": "2024-01-10T10:30:00Z"
}
]
}
Add Team Member
Invite a user to your team.
POST /api/teams/:id/members
Request Body:
{
"email": "teammate@example.com",
"role": "member"
}
| Role | Permissions |
|---|---|
owner | Full access, can delete team |
admin | Manage members, create extractions |
member | View and create extractions |
Response:
{
"id": "member_abc123",
"user_id": "user_xyz789",
"email": "teammate@example.com",
"role": "member",
"status": "pending",
"invited_at": "2024-01-15T10:30:00Z"
}
Remove Team Member
Remove a user from the team.
DELETE /api/teams/:id/members/:user_id
Response:
{
"success": true
}
Team Resources
When you create a resource (extraction, webhook, etc.) within a team context, it’s shared with all team members.
Creating Team Resources
Include the team_id header:
curl -X POST https://api.stylegrab.dev/api/extractions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Team-ID: team_abc123" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Listing Team Resources
Filter by team:
curl "https://api.stylegrab.dev/api/extractions?team_id=team_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Billing
Teams share a single subscription. The team owner manages billing.
- Free: 1 team, 3 members max
- Pro: Unlimited teams, 10 members each
- Enterprise: Unlimited teams and members
See Payments for subscription details.
Error Responses
| Status | Code | Description |
|---|---|---|
| 403 | not_team_member | You’re not a member of this team |
| 403 | insufficient_role | Your role doesn’t allow this action |
| 404 | team_not_found | Team doesn’t exist |
| 409 | already_member | User is already a team member |