Teams API
Manage teams, members, invitations, whitelist domains, usage, and team stats over the REST API.
Authenticated endpoints for teams, members, invitations, whitelist domains, usage, and team statistics.
All endpoints use https://a.firaform.com/api and a Sanctum bearer token. See the API Reference for authentication, the full role matrix, pagination, and error shapes.
Teams
GET /api/teams
Paginated teams the caller belongs to.
{
"data": [
{
"id": 3,
"name": "Acme",
"slug": "acme",
"owner": { "id": 12, "name": "Alex" },
"role": "owner",
"members_count": 4,
"forms_count": 8,
"created_at": "2026-01-01T08:00:00.000000Z"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}
GET /api/teams/{team}
Returns one team using the same shape. Returns 403 if the caller is not a member.
POST /api/teams
{ "name": "New Team" }
Creates a team owned by the caller, within the caller’s plan limit. Returns 201 with the team resource. Returns 422 when the plan’s team limit is reached.
PATCH /api/teams/{team}
Owner or admin only.
{ "name": "Renamed Team", "slug": "renamed-team" }
Returns the updated team resource.
DELETE /api/teams/{team}
Owner only. Returns 422 while other members exist.
{ "message": "Team 'Acme' deleted successfully." }
POST /api/teams/{team}/switch
Any member. Sets current_team_id for UI context.
{ "message": "Switched to team 'Acme'.", "current_team_id": 3 }
POST /api/teams/{team}/leave
Any non-owner member. Owners get 422.
{ "message": "You have left the team 'Acme'." }
Team members
GET /api/teams/{team}/members
Any member. Paginated.
{
"data": [
{
"id": 12,
"name": "Alex",
"email": "[email protected]",
"role": "owner",
"joined_at": "2026-01-01 08:00:00"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}
PATCH /api/teams/{team}/members/{member}
{ "role": "manager" }
Role must be admin, manager, or member.
- Owner can change anyone except the owner.
- Admin can change managers/members but cannot grant or change
admin. - Nobody can change the owner’s role.
{ "message": "Updated Sam's role to manager." }
DELETE /api/teams/{team}/members/{member}
Owner or admin, according to the same role rules. The caller cannot remove themselves; use leave.
{ "message": "Sam has been removed from the team." }
POST /api/teams/{team}/transfer-ownership
Owner only. The new owner must already be a member. The previous owner becomes admin.
{ "new_owner_id": 44 }
{ "message": "Team ownership transferred to Sam." }
Invitations
GET /api/teams/{team}/invitations
Owner or admin only. Returns paginated invitations. The invitation token is never returned.
{
"data": [
{
"id": 9,
"email": "[email protected]",
"role": "manager",
"status": "pending",
"expires_at": "2026-03-01T10:00:00.000000Z",
"team": { "id": 3, "name": "Acme" },
"invited_by": { "id": 12, "name": "Alex" }
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}
POST /api/teams/{team}/invitations
Owner or admin. Admins cannot invite as admin. The invitation email is queued.
{ "email": "[email protected]", "role": "manager" }
Returns 201 with the invitation resource. Duplicate pending invitations, existing members, and member-limit overruns return 422.
DELETE /api/teams/{team}/invitations/{invitation}
Cancels a pending invitation.
POST /api/teams/{team}/invitations/{invitation}/resend
Resends the invitation and extends its expiry.
GET /api/invitations
Pending, non-expired invitations addressed to the caller’s email.
POST /api/invitations/{invitation}/accept
The invitation must belong to the caller’s email; otherwise 404. Expired or already-processed invitations return 422. A full team returns 422.
{ "message": "Welcome to Acme!" }
POST /api/invitations/{invitation}/reject
{ "message": "Invitation declined." }
Whitelist domains
GET /api/teams/{team}/domains
Any member. Paginated.
{
"data": [
{
"id": 4,
"domain": "example.com",
"form": { "uuid": "V1StGXR8_Z5jdHi6B-myT", "name": "Contact Form" },
"created_at": "2026-02-01T10:00:00.000000Z"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}
form is null for a team-wide domain.
POST /api/teams/{team}/domains
Owner, admin, or manager.
{
"domain": "https://Example.com:8080/path",
"form_uuid": "V1StGXR8_Z5jdHi6B-myT"
}
The domain is normalized to example.com. form_uuid is optional and must belong to the team. Duplicates return 422; * is allowed.
DELETE /api/teams/{team}/domains/{domain}
Owner, admin, or manager. A domain from another team returns 404.
Usage and stats
GET /api/teams/{team}/usage
Any member. All values use the team owner’s plan.
{
"data": {
"plan": "starter",
"forms": { "used": 2, "limit": 10 },
"submissions_this_month": { "used": 120, "limit": 5000 },
"storage_bytes": { "used": 1048576, "limit": 524288000 },
"team_members": { "used": 3, "limit": 5 },
"features": {
"can_use_redirects": true,
"can_use_webhooks": true,
"can_use_auto_reply": true,
"can_use_payments": true
}
}
}
null means unlimited.
GET /api/teams/{team}/stats
Any member.
{
"data": {
"submissions": { "today": 5, "this_week": 22, "this_month": 90, "total": 1200 },
"collections": {
"live": [{ "currency": "USD", "total": 120.5, "payments": 4 }],
"sandbox": [{ "currency": "MYR", "total": 25, "payments": 1 }]
}
}
}