> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gigstack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# gigstack Connect API Guide

> Integration guide for gigstack Connect

Access and manage resources across multiple teams within the same billing account. gigstack Connect enables authorized teams to work with resources from other teams seamlessly.

## Overview

gigstack Connect is a powerful feature that allows teams with special permissions to access and manage resources (clients, invoices, payments, etc.) across multiple teams that share the same billing account. This is ideal for franchises, multi-entity businesses, service providers managing multiple client accounts, and marketplace platforms that need to split payments between platform and merchants.

## Key Features

* **Multi-Team Access** - Access resources across teams
* **Payment Splitting** - Split marketplace payments between platform and merchants
* **Unified Management** - Manage multiple teams from one API key
* **Billing Account Scope** - Limited to teams in same billing account
* **Resource-level Availability** - Available on eligible endpoints, with exceptions below
* **Seamless Integration** - Simple query parameter addition
* **Security Controls** - Permission-based access

## How It Works

Add the `team` query parameter to an eligible resource endpoint to access another team's resources:

```bash theme={null}
# Standard request (your team)
GET /clients

# gigstack Connect request (another team)
GET /clients?team=team_xyz789
```

## Requirements

1. **gigstack Connect Enabled** - Your API key's team must be a master team (gigstack Connect enabled)
2. **Shared Billing** - Target team must share the same billing account
3. **Team Exists** - Target team must exist
4. **Plan Feature** - Your plan must include `multipleIssuerAccounts`
5. **API Key** - Use an API key. OAuth access tokens are bound to their own team; sending another team's id returns `403 Team mismatch with OAuth token`

## Choose the right RFC before you create the team

This is the single highest-cost mistake in a Connect integration, so it comes before the examples.

**One RFC ⇄ one team. Always.** A team's `rfc` is what binds it to a taxpayer, and there is no way to attach a second RFC to an existing team. If a partner manages ten merchants, that is ten teams.

**The RFC you pick at team-creation time is the RFC whose FIEL that team will be able to accept — and nothing else.** When the connected team later uploads its e-firma:

```http theme={null}
POST /v2/invoices/download/fiel?team=team_connected123
```

gigstack reads the RFC out of the `.cer` and compares it, character for character, to the `rfc` on the team named by `?team=`. Any difference is a hard `400`:

```json theme={null}
{
    "success": false,
    "message": "RFC mismatch",
    "error": "FIEL certificate RFC (…) does not match your team RFC (…). Each RFC requires its own team."
}
```

Two things about that check that trip people up:

* **It is the *connected* team that is checked, not the master team.** The `?team=` parameter selects which team the credentials are attached to and which RFC they are validated against. A FIEL uploaded without `?team=` lands on the API key's own team — usually the master — and will be rejected unless the certificate happens to be the master's own.
* **There is no override.** No flag, no support toggle. If the RFCs differ, the only remedy is a team whose `rfc` matches the certificate.

### Use the business RFC, not the legal representative's

When a partner onboards a company, the RFC that should go on the team is **the company's** — the one the company invoices under and the one its FIEL is issued to. It is easy to instead capture the RFC of whoever is filling in the onboarding form: the director, the founder, the accountant. That RFC belongs to a *persona física* and its FIEL is a personal certificate; it will never match a company certificate.

A quick sanity check that catches almost every case:

| RFC length | Taxpayer type | Certificate you will receive |
| - | - | - |
| **12 characters** | Persona moral (company) | Company FIEL |
| **13 characters** | Persona física (individual) | Personal FIEL |

If the team's RFC is 13 characters and the merchant is a company, the team is wrong. Fix it before you ask them for their FIEL.

### Why this bites late

Nothing in the earlier steps complains. Team creation accepts any RFC. Clients, payments, services, receipts and webhooks all work. The mismatch only surfaces at FIEL upload — the last step of onboarding, after the merchant has already exported their certificate and typed their e-firma password. This has cost real partners days of repeated failed uploads before anyone compared the two RFCs.

**Do this instead:**

1. Confirm with the merchant which RFC they invoice under, and confirm their FIEL is issued to that same RFC.
2. Create the connected team with that RFC. On `POST /v2/teams` the field is **`tax_id`**; on `POST /v2/auth/signup` it is **`rfc`**. Both land on the team's internal `rfc`, which is what the FIEL check compares against.
3. Read the team back (`GET /v2/teams/{id}`, where it is returned as `tax_id`) and verify it before collecting any certificate.
4. Only then request the FIEL and upload it with `?team=` pointed at that team.

See [Descarga Masiva → Step 3](/guides/descarga-masiva#step-3-—-upload-your-fiel) for the full list of upload errors.

## Usage Examples

### Accessing Clients Across Teams

```bash theme={null}
# List clients from team_abc123
curl -X GET "https://api.gigstack.io/v2/clients?team=team_abc123&limit=10" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Create client for team_xyz789
curl -X POST "https://api.gigstack.io/v2/clients?team=team_xyz789" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cross-team Client",
    "email": "client@example.com",
    "tax_id": "ABC123456789"
  }'
```

### Managing Invoices Across Teams

```bash theme={null}
# Create invoice for team_def456
curl -X POST "https://api.gigstack.io/v2/invoices/income?team=team_def456" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "automation_type": "payment",
    "client": {"id": "client_123"},
    "currency": "MXN",
    "exchange_rate": 1.0,
    "items": [{
      "description": "Service for subsidiary",
      "quantity": 1,
      "unit_price": 1000.00,
      "product_key": "80141503",
      "unit_key": "E48",
      "taxes": [{"type": "IVA", "rate": 0.16}]
    }],
    "use": "P01",
    "payment_form": "03",
    "payment_method": "PUE"
  }'

# Get invoice from team_ghi789
curl -X GET "https://api.gigstack.io/v2/invoices/income/invoice_123?team=team_ghi789" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Processing Payments for Other Teams

```bash theme={null}
# Register payment for team_jkl012
curl -X POST "https://api.gigstack.io/v2/payments/register?team=team_jkl012" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": {"id": "client_456"},
    "automation_type": "pue_invoice",
    "currency": "MXN",
    "items": [{
      "id": "service_789",
      "quantity": 1
    }],
    "paid": true
  }'

# List payments from team_mno345
curl -X GET "https://api.gigstack.io/v2/payments?team=team_mno345&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Managing Services Across Teams

```bash theme={null}
# Create service for team_pqr678
curl -X POST "https://api.gigstack.io/v2/services?team=team_pqr678" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Shared consulting service",
    "sku": "SHARED-001",
    "product_key": "80141503",
    "unit_key": "E48",
    "unit_price": 2000.00,
    "taxes": [{"type": "IVA", "rate": 0.16}]
  }'

# Update service in team_stu901
curl -X PUT "https://api.gigstack.io/v2/services/service_123?team=team_stu901" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "unit_price": 2500.00
  }'
```

### Team Settings Management

```bash theme={null}
# Update settings for team_vwx234
curl -X PUT "https://api.gigstack.io/v2/teams/team_vwx234/settings?team=team_vwx234" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_key": "80141503",
    "unit_key": "E48",
    "taxes": [{"type": "IVA", "rate": 0.16}]
  }'

# Add member to team_yz567
curl -X POST "https://api.gigstack.io/v2/teams/team_yz567/add-member?team=team_yz567" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_890",
    "role": "member"
  }'
```

## Marketplace Payment Splitting

gigstack Connect enables marketplace platforms to automatically split payments between the platform (master team) and merchants (connect teams). This feature is only available for master teams with marketplace-enabled billing accounts.

### How Payment Splitting Works

When you register a payment with `transfer_data`, the system:

1. Validates that your team has marketplace permissions
2. Calculates the split based on the master percentage or custom\_price
3. Creates two separate payments (master and connect)
4. Assigns clients according to your configuration
5. Returns both payment IDs and split details

**Important:** The `team` and `livemode` fields are automatically extracted from your authentication token - you don't need to send them.

### Basic Marketplace Payment Split

```bash theme={null}
curl -X POST https://api.gigstack.io/v2/payments/register \
  -H "Authorization: Bearer YOUR_MASTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": {
      "id": "client_1234567890"
    },
    "automation_type": "pue_invoice",
    "currency": "MXN",
    "payment_form": "03",
    "items": [{
      "description": "Marketplace transaction",
      "quantity": 1,
      "unit_price": 1000.0,
      "product_key": "80141503",
      "unit_key": "E48",
      "taxes": [{"type": "IVA", "rate": 0.16}]
    }],
    "transfer_data": {
      "master": 15,
      "connect": "ABC123456789",
      "master_to": "client",
      "connect_to": "client"
    }
  }'
```

**Response:**

```json theme={null}
{
    "message": "Split payment registered successfully",
    "data": {
        "split_reference": "split_abc123xyz",
        "master_payment_id": "payment_master_123",
        "connect_payment_id": "payment_connect_456",
        "master_amount": 174.0,
        "connect_amount": 986.0,
        "total_amount": 1160.0,
        "master_payment": {
            "id": "payment_master_123",
            "client": "client_1234567890",
            "amount": 174.0,
            "team": "team_master",
            "split_role": "master"
        },
        "connect_payment": {
            "id": "payment_connect_456",
            "client": "client_1234567890",
            "amount": 986.0,
            "team": "team_connect",
            "split_role": "connect"
        },
        "connect_team": null
    }
}
```

### Creating a New Merchant Team

If the connect team doesn't exist (by tax ID), a new team will be created automatically:

> **The `transfer_data.connect` RFC becomes the new team's RFC permanently.** Auto-creation is the easiest place to get this wrong, because the RFC arrives buried in a payment payload rather than in a team form. Send the merchant's *business* RFC here — that team will only ever accept a FIEL issued to this exact value. See [Choose the right RFC](#choose-the-right-rfc-before-you-create-the-team).

```bash theme={null}
curl -X POST https://api.gigstack.io/v2/payments/register \
  -H "Authorization: Bearer YOUR_MASTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": {"id": "client_1234567890"},
    "automation_type": "pue_invoice",
    "currency": "MXN",
    "payment_form": "03",
    "items": [{
      "description": "New merchant transaction",
      "quantity": 1,
      "unit_price": 2000.0,
      "product_key": "80141503",
      "unit_key": "E48",
      "taxes": [{"type": "IVA", "rate": 0.16}]
    }],
    "transfer_data": {
      "master": 10,
      "connect": "NEWMERCH800101ABC",
      "master_to": "client",
      "connect_to": "master"
    }
  }'
```

**Response with new team:**

```json theme={null}
{
    "message": "Split payment registered successfully",
    "data": {
        "split_reference": "split_xyz789abc",
        "master_payment_id": "payment_master_789",
        "connect_payment_id": "payment_connect_012",
        "master_amount": 232.0,
        "connect_amount": 2088.0,
        "total_amount": 2320.0,
        "master_payment": {
            "id": "payment_master_789",
            "client": "client_1234567890",
            "amount": 232.0,
            "team": "team_master",
            "split_role": "master"
        },
        "connect_payment": {
            "id": "payment_connect_012",
            "client": "client_master_as_merchant",
            "amount": 2088.0,
            "team": "team_newmerch",
            "split_role": "connect"
        },
        "connect_team": {
            "id": "team_newmerch",
            "tax_id": "NEWMERCH800101ABC",
            "legal_name": "New Merchant SA de CV",
            "is_newly_created": true,
            "onboarding_url": "https://embeded.gigstack.pro/?sessionId=otpOnboarding_7Kd2Pq&c=193847"
        }
    }
}
```

Send the `onboarding_url` to the merchant to complete their account setup.

### Custom Item Configuration for Connect Payments

Customize how items appear in the connect team's payment and invoices:

```bash theme={null}
curl -X POST https://api.gigstack.io/v2/payments/register \
  -H "Authorization: Bearer YOUR_MASTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": {"id": "client_1234567890"},
    "automation_type": "pue_invoice",
    "currency": "MXN",
    "payment_form": "03",
    "items": [{
      "description": "Platform marketplace transaction",
      "quantity": 1,
      "unit_price": 5000.0,
      "product_key": "80141503",
      "unit_key": "E48",
      "taxes": [{"type": "IVA", "rate": 0.16}]
    }],
    "transfer_data": {
      "master": 20,
      "connect": "MERCHANT800101ABC",
      "master_to": "client",
      "connect_to": "client",
      "connect_custom_config": {
        "product_key": "01010101",
        "unit_key": "E48",
        "custom_description": "Professional consulting services rendered",
        "taxes": [
          {
            "type": "IVA",
            "rate": 0.16,
            "withholding": false
          }
        ]
      }
    }
  }'
```

The connect payment will use the custom product key, unit key, description, and tax configuration instead of copying from the original items.

### Fixed Commission Pricing

Instead of percentage-based splits, charge a fixed commission fee using `custom_price`:

```bash theme={null}
curl -X POST https://api.gigstack.io/v2/payments/register \
  -H "Authorization: Bearer YOUR_MASTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": {"id": "client_1234567890"},
    "automation_type": "pue_invoice",
    "currency": "MXN",
    "payment_form": "03",
    "items": [{
      "description": "Product sale through marketplace",
      "quantity": 3,
      "unit_price": 750.0,
      "product_key": "43211500",
      "unit_key": "H87",
      "taxes": [{"type": "IVA", "rate": 0.16}]
    }],
    "transfer_data": {
      "master": 0,
      "connect": "VENDOR123ABC",
      "master_to": "connect",
      "connect_to": "client",
      "connect_custom_config": {
        "custom_price": 75.00,
        "custom_description": "Marketplace platform fee",
        "product_key": "80141600"
      }
    }
  }'
```

**Response with Fixed Commission:**

```json theme={null}
{
    "message": "Split payment registered successfully",
    "data": {
        "split_reference": "split_xyz789",
        "master_payment_id": "payment_master_456",
        "connect_payment_id": "payment_connect_789",
        "master_amount": 2535.00,
        "connect_amount": 75.00,
        "total_amount": 2610.00,
        "used_custom_price": true
    }
}
```

**Benefits of Fixed Pricing:**

* **Predictable fees**: Charge the same commission regardless of transaction size
* **Minimum guarantees**: Ensure a minimum platform fee on small transactions
* **Tiered pricing**: Implement different fixed fees for different service levels
* **Simple calculations**: Merchants know exactly what they'll pay

**Important Notes:**

* `custom_price` overrides the percentage calculation
* Connect gets the exact `custom_price` amount
* Master receives the remainder (total - custom\_price)
* The `master` percentage is ignored when using `custom_price`

### Client Assignment Strategies

**Strategy 1: Both payments to original client**

```json theme={null}
{
    "transfer_data": {
        "master": 15,
        "connect": "ABC123456789",
        "master_to": "client",
        "connect_to": "client"
    }
}
```

* Master payment: assigned to original client
* Connect payment: assigned to original client
* Use case: End customer pays both platform and merchant

**Strategy 2: Master to client, Connect to master**

```json theme={null}
{
    "transfer_data": {
        "master": 10,
        "connect": "ABC123456789",
        "master_to": "client",
        "connect_to": "master"
    }
}
```

* Master payment: assigned to original client
* Connect payment: master team becomes the client
* Use case: Platform pays merchant on behalf of customer

**Strategy 3: Master to connect, Connect to client**

```json theme={null}
{
    "transfer_data": {
        "master": 5,
        "connect": "ABC123456789",
        "master_to": "connect",
        "connect_to": "client"
    }
}
```

* Master payment: connect team becomes the client
* Connect payment: assigned to original client
* Use case: Merchant pays platform fee, customer pays merchant

**Strategy 4: Both cross-assigned**

```json theme={null}
{
    "transfer_data": {
        "master": 12,
        "connect": "ABC123456789",
        "master_to": "connect",
        "connect_to": "master"
    }
}
```

* Master payment: connect team becomes the client
* Connect payment: master team becomes the client
* Use case: Complex inter-company transactions

## Use Cases

### 1. Franchise Management

Manage multiple franchise locations from a central account:

```javascript theme={null}
// Get all clients across franchise locations
const franchises = ['team_location1', 'team_location2', 'team_location3']
const allClients = []

for (const franchise of franchises) {
    const response = await fetch(`https://api.gigstack.io/v2/clients?team=${franchise}`, {
        headers: {
            Authorization: 'Bearer YOUR_TOKEN',
        },
    })
    const data = await response.json()
    allClients.push(...data.data)
}

console.log(`Total clients across all franchises: ${allClients.length}`)
```

### 2. Multi-Entity Corporation

Handle invoicing for different business entities:

```javascript theme={null}
// Create invoices for different entities
const entities = {
    team_entity_mx: { currency: 'MXN', tax_rate: 0.16 },
    team_entity_us: { currency: 'USD', tax_rate: 0.0 },
    team_entity_ca: { currency: 'CAD', tax_rate: 0.13 },
}

for (const [teamId, config] of Object.entries(entities)) {
    await fetch(`https://api.gigstack.io/v2/invoices/income?team=${teamId}`, {
        method: 'POST',
        headers: {
            Authorization: 'Bearer YOUR_TOKEN',
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            automation_type: 'payment',
            client: { id: 'client_universal' },
            currency: config.currency,
            exchange_rate: 1.0,
            items: [
                {
                    description: 'International services',
                    quantity: 1,
                    unit_price: 1000.0,
                    product_key: '80141503',
                    unit_key: 'E48',
                    taxes: [
                        {
                            type: 'IVA',
                            rate: config.tax_rate,
                        },
                    ],
                },
            ],
            use: 'P01',
            payment_form: '03',
            payment_method: 'PUE',
        }),
    })
}
```

### 3. Accounting Service Provider

Manage multiple client companies:

```javascript theme={null}
// Generate monthly reports for all managed companies
async function generateMonthlyReports(managedTeams) {
    const reports = {}

    for (const teamId of managedTeams) {
        // Get invoices for the month
        const invoices = await fetch(`https://api.gigstack.io/v2/invoices/income?team=${teamId}&limit=100`, {
            headers: { Authorization: 'Bearer YOUR_TOKEN' },
        }).then((r) => r.json())

        // Get payments for the month
        const payments = await fetch(`https://api.gigstack.io/v2/payments?team=${teamId}&limit=100`, {
            headers: { Authorization: 'Bearer YOUR_TOKEN' },
        }).then((r) => r.json())

        reports[teamId] = {
            total_invoiced: invoices.data.reduce((sum, inv) => sum + inv.total, 0),
            total_collected: payments.data
                .filter((p) => p.status === 'succeeded')
                .reduce((sum, pay) => sum + pay.total, 0),
            invoice_count: invoices.data.length,
            payment_count: payments.data.length,
        }
    }

    return reports
}
```

### 4. Consolidated Operations

Perform bulk operations across teams:

```javascript theme={null}
// Update service prices across all teams
async function updateServicePriceGlobally(serviceId, newPrice, teams) {
    const results = []

    for (const teamId of teams) {
        try {
            const response = await fetch(`https://api.gigstack.io/v2/services/${serviceId}?team=${teamId}`, {
                method: 'PUT',
                headers: {
                    Authorization: 'Bearer YOUR_TOKEN',
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify({
                    unit_price: newPrice,
                }),
            })

            results.push({
                team: teamId,
                success: response.ok,
                status: response.status,
            })
        } catch (error) {
            results.push({
                team: teamId,
                success: false,
                error: error.message,
            })
        }
    }

    return results
}
```

### 5. Marketplace Platform

Process payments with automatic splitting between platform and merchants:

```javascript theme={null}
// Marketplace payment processing with split
async function processMarketplacePayment(
    clientData,
    items,
    merchantTaxId,
    platformFeePercentage = 10
) {
    const response = await fetch('https://api.gigstack.io/v2/payments/register', {
        method: 'POST',
        headers: {
            Authorization: 'Bearer YOUR_MASTER_TOKEN',
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            client: clientData,
            automation_type: 'pue_invoice',
            currency: 'MXN',
            payment_form: '03',
            items: items,
            transfer_data: {
                master: platformFeePercentage,
                connect: merchantTaxId,
                master_to: 'client',
                connect_to: 'client',
            },
            metadata: {
                marketplace_transaction: true,
                merchant_id: merchantTaxId,
            },
        }),
    })

    const result = await response.json()

    // Handle new merchant onboarding
    if (result.data.connect_team?.is_newly_created && result.data.connect_team?.onboarding_url) {
        console.log('New merchant created! Send onboarding link:', result.data.connect_team.onboarding_url)
    }

    return {
        splitReference: result.data.split_reference,
        platformPayment: result.data.master_payment_id,
        merchantPayment: result.data.connect_payment_id,
        platformAmount: result.data.master_amount,
        merchantAmount: result.data.connect_amount,
        needsOnboarding: result.data.connect_team?.is_newly_created || false,
        onboardingUrl: result.data.connect_team?.onboarding_url || null,
    }
}

// Example usage
const splitPayment = await processMarketplacePayment(
    { id: 'client_1234567890' },
    [
        {
            description: 'Marketplace sale',
            quantity: 1,
            unit_price: 1000.0,
            product_key: '80141503',
            unit_key: 'E48',
            taxes: [{ type: 'IVA', rate: 0.16 }],
        },
    ],
    'MERCHANT800101ABC',
    15 // 15% platform fee
)

console.log(`Platform receives: $${splitPayment.platformAmount}`)
console.log(`Merchant receives: $${splitPayment.merchantAmount}`)
```

## Security and Permissions

### Access Control

* Only teams with gigstack Connect enabled can use this feature
* Target teams must be in the same billing account
* User permissions apply to cross-team operations
* Audit logs track all cross-team actions

### Permission Requirements

API keys and OAuth access tokens represent a **team**, not the current personal role
of the person who originally created the credential. Protect them as team credentials.
The Connect team/billing/plan checks still apply, and OAuth cannot switch teams.

User-scoped credentials (such as MCP or dashboard tokens) are subject to the route's
team-role or module-permission checks. Roles are `viewer`, `editor` and `admin`;
there is no general `member` role that grants all writes. Consult each administrative
or destructive operation's requirements. A resource or team outside your scope may
be reported as `404` rather than a role error.

## Error Responses

Connect errors come from the authentication layer, before the endpoint runs. The body is a raw object with a `message` — not the standardized envelope.

### Not a Master Team (401)

```json theme={null}
{ "message": "Unauthorized, not a master team" }
```

**Solution:** Your team needs gigstack Connect enabled. Contact support.

### Team Not Found (404)

```json theme={null}
{ "message": "Team not found" }
```

**Solution:** Verify the team ID.

### No Matched Teams (401)

```json theme={null}
{ "message": "Unauthorized, no matched teams" }
```

**Solution:** The target team must share your master team's billing account.

### Plan Without Multiple Issuer Accounts (403)

```json theme={null}
{ "message": "Tu plan no incluye múltiples cuentas emisoras. Actualiza tu plan en https://app.gigstack.pro/memberships o ponte en contacto con soporte para operar sobre otros equipos." }
```

**Solution:** Move to a plan that includes `multipleIssuerAccounts`.

### OAuth Token Used for Another Team (403)

```json theme={null}
{ "message": "Team mismatch with OAuth token" }
```

**Solution:** Use an API key for cross-team requests.

## Best Practices

1. **Cache Team IDs** - Store frequently accessed team IDs
2. **Batch Operations** - Group operations by team for efficiency
3. **Error Handling** - Implement robust error handling for cross-team ops
4. **Audit Trail** - Log all cross-team operations
5. **Permission Checks** - Verify permissions before bulk operations
6. **Rate Limiting** - Be mindful of rate limits when accessing multiple teams
7. **Consistent Naming** - Use clear naming conventions for cross-team resources

## Performance Considerations

### Rate Limits

* The team credit limit is per team: documents issued for a connected team count against **that team's** `credit_limit`
* The 10-per-day manual SAT download limit is also per team
* See [Rate Limits](/guides/welcome#rate-limits) for the full list

### Optimization Tips

```javascript theme={null}
// Bad: Sequential requests
for (const team of teams) {
    await fetchTeamData(team) // Slow!
}

// Good: Parallel requests
const promises = teams.map((team) => fetchTeamData(team))
const results = await Promise.all(promises) // Fast!
```

## Complete Endpoint Support

Eligible resource endpoints accept `?team=TEAM_ID` when the credential, plan and
billing-account checks above pass. Check the operation's `team` parameter and
availability notice before building a shared client wrapper.

### Core Resources

Clients, services, income invoices, payments, teams and users document their supported
cross-team operations in the API reference. A path's resource ID must still belong
to the intended accessible team; `team` is not a bypass for resource access checks.

### Additional Operations

| Case | Scoping rule |
| - | - |
| Eligible API-key resource calls | Pass `team` to select a connected team in the same billing account |
| OAuth access token | Bound to one team; another `team` is refused |
| Platform payout runs | Act on the credential's own marketplace master team; connected-team overrides are not supported |
| Account signup | Uses a separate partner credential to provision an account, not Connect team switching |
| Public module health | Does not inspect credentials or select a fiscal team |
| Operation with an availability warning | A handler without a public gateway route cannot be enabled by adding `team` |

For [platform payouts](/guides/platform-payouts#who-can-use-it), do not attach a connected
team parameter to the run itself. Once a run issues an income invoice belonging to
a provider, retrieving **that invoice** may require its provider team parameter.

## Getting Started

### Step 1: Verify gigstack Connect Status

Confirm the master-team feature and plan with your account administrator. The public
team response does not contain `gigstack_connect_enabled`; do not wait for that flag.
Then list your accessible teams:

```bash theme={null}
curl -X GET "https://api.gigstack.io/v2/teams" \
  -H "Authorization: Bearer YOUR_TOKEN"
# Inspect the accessible team IDs; the response does not expose a Connect-enabled flag
```

### Step 2: List Available Teams

```bash theme={null}
# Your billing account teams are accessible
curl -X GET "https://api.gigstack.io/v2/teams" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Step 3: Test Cross-Team Access

```bash theme={null}
# Try accessing another team's resources
curl -X GET "https://api.gigstack.io/v2/clients?team=team_other&limit=1" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Step 4: Implement in Your Application

```javascript theme={null}
class GigstackMultiTeam {
    constructor(apiKey) {
        this.apiKey = apiKey
        this.baseUrl = 'https://api.gigstack.io/v2'
    }

    async fetchFromTeam(endpoint, teamId, options = {}) {
        const url = `${this.baseUrl}${endpoint}?team=${teamId}`
        const response = await fetch(url, {
            ...options,
            headers: {
                Authorization: `Bearer ${this.apiKey}`,
                'Content-Type': 'application/json',
                ...options.headers,
            },
        })
        return response.json()
    }

    async createForTeam(endpoint, teamId, data) {
        return this.fetchFromTeam(endpoint, teamId, {
            method: 'POST',
            body: JSON.stringify(data),
        })
    }
}

// Usage
const multiTeam = new GigstackMultiTeam('YOUR_TOKEN')
const clients = await multiTeam.fetchFromTeam('/clients', 'team_xyz789')
```

***

For additional assistance, contact [support@gigstack.io](mailto:support@gigstack.io)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.