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

# Quickstart

> Go from zero to your first API call in 5 minutes

This guide walks you through setting up your Mufi account, creating an organization and project, getting your API key, and making your first API calls. By the end, you'll have created a user with a wallet, set up an event, and issued a product.

## Prerequisites

* A [Mufi Dashboard](https://my.mufi.app) account (email [connect@mufi.app](mailto:connect@mufi.app) if you need access)
* A tool to make HTTP requests (cURL, Postman, or any HTTP client)

## Step 1: Get Your API Key

<Steps>
  <Step title="Log in to the Mufi Dashboard">
    Go to [my.mufi.app](https://my.mufi.app) and sign in with your email. You'll receive a one-time code to authenticate.
  </Step>

  <Step title="Create an organization">
    Once logged in, create a new organization. Organizations are the top-level entity that groups your projects, team members, and fans.
  </Step>

  <Step title="Create a project">
    Inside your organization, create a new project. Each project has its own set of users, events, products, and API keys.
  </Step>

  <Step title="Generate an API key">
    Navigate to the API Keys section in your project settings and generate a new key. Copy it — you'll need it for all API requests.
  </Step>
</Steps>

<Warning>
  Your API key does not expire automatically. Store it securely in an environment variable — never hardcode it in your application or commit it to version control.
</Warning>

## Step 2: Set Up Your Environment

Store your API key as an environment variable:

```bash theme={null}
export MUFI_API_KEY="your-api-key-here"
```

Verify your connection by checking the API version:

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer $MUFI_API_KEY" \
    https://api.mufi.app/v1/version
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.mufi.app/v1/version', {
    headers: { 'Authorization': `Bearer ${process.env.MUFI_API_KEY}` }
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.get('https://api.mufi.app/v1/version', headers={
      'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}'
  })
  print(response.json())
  ```
</CodeGroup>

```json Response theme={null}
{ "version": "2.72.0" }
```

<Tip>
  **Using the staging environment?** Replace `api.mufi.app` with `dev.api.mufi.app` for testing. All API Playground examples in these docs point to the staging URL.
</Tip>

## Step 3: Create Your First User

Create a user — Mufi automatically provisions a custodial Polkadot wallet for them in the background.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mufi.app/v1/users/create \
    -H "Authorization: Bearer $MUFI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '[{
      "email": "fan@example.com",
      "firstName": "Alex",
      "lastName": "Rivera",
      "referenceId": "your-internal-id-123"
    }]'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.mufi.app/v1/users/create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MUFI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify([{
      email: 'fan@example.com',
      firstName: 'Alex',
      lastName: 'Rivera',
      referenceId: 'your-internal-id-123'
    }])
  });
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.post('https://api.mufi.app/v1/users/create',
      headers={
          'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}',
          'Content-Type': 'application/json'
      },
      json=[{
          'email': 'fan@example.com',
          'firstName': 'Alex',
          'lastName': 'Rivera',
          'referenceId': 'your-internal-id-123'
      }]
  )
  ```
</CodeGroup>

```json Response theme={null}
{ "message": "Created" }
```

<Info>
  **Batch creation:** You can create up to 1,500 users in a single request by adding more objects to the array. Wallets are provisioned asynchronously — users are available immediately while wallets generate in the background.
</Info>

## Step 4: Activate the User

Users must be activated before they can hold assets, redeem products, or attend events.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mufi.app/v1/users/activate \
    -H "Authorization: Bearer $MUFI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "email": "fan@example.com" }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.mufi.app/v1/users/activate', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MUFI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ email: 'fan@example.com' })
  });
  ```

  ```python Python theme={null}
  response = requests.post('https://api.mufi.app/v1/users/activate',
      headers={
          'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}',
          'Content-Type': 'application/json'
      },
      json={'email': 'fan@example.com'}
  )
  ```
</CodeGroup>

```json Response theme={null}
{
  "isActivated": true,
  "activatedOn": "2025-03-17T12:00:00.000Z"
}
```

## Step 5: Create an Event

Events are the parent entity for products. Create one to start issuing tickets, vouchers, and perks.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mufi.app/v1/events/create \
    -H "Authorization: Bearer $MUFI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Summer Music Festival",
      "description": "An unforgettable weekend of live music",
      "location": "Miami, FL",
      "address": "123 Ocean Drive, Miami, FL 33139",
      "start_date": 1756684800,
      "end_date": 1756857600,
      "reference_id": "festival-2025"
    }'
  ```

  ```javascript JavaScript theme={null}
  const event = await fetch('https://api.mufi.app/v1/events/create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MUFI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Summer Music Festival',
      description: 'An unforgettable weekend of live music',
      location: 'Miami, FL',
      address: '123 Ocean Drive, Miami, FL 33139',
      start_date: 1756684800,
      end_date: 1756857600,
      reference_id: 'festival-2025'
    })
  }).then(r => r.json());
  ```

  ```python Python theme={null}
  event = requests.post('https://api.mufi.app/v1/events/create',
      headers={
          'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'Summer Music Festival',
          'description': 'An unforgettable weekend of live music',
          'location': 'Miami, FL',
          'address': '123 Ocean Drive, Miami, FL 33139',
          'start_date': 1756684800,
          'end_date': 1756857600,
          'reference_id': 'festival-2025'
      }
  ).json()
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": "event-uuid",
  "name": "Summer Music Festival",
  "description": "An unforgettable weekend of live music",
  "reference_id": "festival-2025",
  "location": "Miami, FL",
  "address": "123 Ocean Drive, Miami, FL 33139",
  "start_date": 1756684800,
  "end_date": 1756857600
}
```

## Step 6: Create a Product and Issue Items

Create a ticket product for your event, then issue it to your user.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mufi.app/v1/products \
    -H "Authorization: Bearer $MUFI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "admission",
      "name": "General Admission",
      "description": "2-day festival access",
      "price": "49.99",
      "stock": 500,
      "max_per_account": 2,
      "is_transferable": true,
      "event_id": "EVENT_ID_FROM_STEP_5"
    }'
  ```

  ```javascript JavaScript theme={null}
  const product = await fetch('https://api.mufi.app/v1/products', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MUFI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      type: 'admission',
      name: 'General Admission',
      description: '2-day festival access',
      price: '49.99',
      stock: 500,
      max_per_account: 2,
      is_transferable: true,
      event_id: event.id
    })
  }).then(r => r.json());
  ```

  ```python Python theme={null}
  product = requests.post('https://api.mufi.app/v1/products',
      headers={
          'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}',
          'Content-Type': 'application/json'
      },
      json={
          'type': 'admission',
          'name': 'General Admission',
          'description': '2-day festival access',
          'price': '49.99',
          'stock': 500,
          'max_per_account': 2,
          'is_transferable': True,
          'event_id': event['id']
      }
  ).json()
  ```
</CodeGroup>

Then issue the ticket to your user:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mufi.app/v1/products/PRODUCT_ID/items \
    -H "Authorization: Bearer $MUFI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "product_id": "PRODUCT_ID",
      "emails": ["fan@example.com"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const items = await fetch(`https://api.mufi.app/v1/products/${product.id}/items`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MUFI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      product_id: product.id,
      emails: ['fan@example.com']
    })
  }).then(r => r.json());
  ```

  ```python Python theme={null}
  items = requests.post(f'https://api.mufi.app/v1/products/{product["id"]}/items',
      headers={
          'Authorization': f'Bearer {os.getenv("MUFI_API_KEY")}',
          'Content-Type': 'application/json'
      },
      json={
          'product_id': product['id'],
          'emails': ['fan@example.com']
      }
  ).json()
  ```
</CodeGroup>

```json Response theme={null}
{
  "items": [{
    "id": "item-uuid",
    "created_at": "2025-03-17T12:05:00.000Z",
    "updated_at": "2025-03-17T12:05:00.000Z",
    "product_id": "product-uuid",
    "item_id": 1,
    "redemption_count": 0,
    "redemption_quantity": 1,
    "is_fully_redeemed": false,
    "redeemed_at": null,
    "user": {
      "id": "user-uuid",
      "email": "fan@example.com",
      "first_name": "Alex",
      "last_name": "Rivera"
    },
    "product": {
      "id": "product-uuid",
      "name": "General Admission",
      "type": "admission",
      "redemption_quantity": 1
    }
  }]
}
```

## What You've Built

In just a few steps, you've completed the core Mufi integration flow:

1. **Set up your organization and project** with an API key
2. **Created a user** with an automatic custodial Polkadot wallet
3. **Activated them** for full platform access
4. **Created an event** with location and dates
5. **Created a product** (admission ticket) linked to your event
6. **Issued the ticket** to your user

From here, you can:

* [Redeem items](/docs/endpoint/engagement/redeem-product-item) at event check-in
* [Transfer items](/docs/endpoint/engagement/transfer-product-item) between users
* [Register attendees](/docs/endpoint/engagement/event-attendee-registration) and track check-ins
* [Mint NFTs](/docs/products/introduction#nft-minting) for collectible products
* [Check wallet balances](/docs/endpoint/wallets/get-wallet-balances) on-chain

## Next Steps

<CardGroup cols={2}>
  <Card title="Users API" icon="users" href="/docs/users/introduction">
    Deep dive into user management, batch operations, and wallet provisioning.
  </Card>

  <Card title="Events API" icon="calendar" href="/docs/events/introduction">
    Learn about the full event lifecycle and attendee management.
  </Card>

  <Card title="Products API" icon="box" href="/docs/products/introduction">
    Explore product types, NFT minting, redemptions, and transfers.
  </Card>

  <Card title="Security" icon="shield-halved" href="/docs/wallet-api/security">
    Understand how Mufi protects wallet secrets at scale.
  </Card>
</CardGroup>
