Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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"
}
RolePermissions
ownerFull access, can delete team
adminManage members, create extractions
memberView 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

StatusCodeDescription
403not_team_memberYou’re not a member of this team
403insufficient_roleYour role doesn’t allow this action
404team_not_foundTeam doesn’t exist
409already_memberUser is already a team member