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

# Snag API

> Integrate Snag's REST API into your Web3 app. Authenticate with API keys, configure custom hostnames, and access loyalty, minting, and rewards endpoints.

<head>
  <script type="application/ld+json">
    {JSON.stringify({
            "@context": "https://schema.org",
            "@graph": [
              {
                "@type": "TechArticle",
                "headline": "Snag API",
                "description": "Integrate Snag's REST API into your Web3 app. Authenticate with API keys, configure custom hostnames, and access loyalty, minting, and rewards endpoints.",
                "author": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/"},
                "publisher": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/", "logo": {"@type": "ImageObject", "url": "https://assets.snagsolutions.io/public/docs/snag-logo-dark-no-bg.svg"}},
                "mainEntityOfPage": "https://docs.snagsolutions.io/api-reference/introduction"
              },
              {
                "@type": "BreadcrumbList",
                "itemListElement": [
                  {"@type": "ListItem", "position": 1, "name": "Home", "item": "https://docs.snagsolutions.io/welcome"},
                  {"@type": "ListItem", "position": 2, "name": "API Reference", "item": "https://docs.snagsolutions.io/api-reference/introduction"},
                  {"@type": "ListItem", "position": 3, "name": "Introduction"}
                ]
              }
            ]
          })}
  </script>
</head>

<Frame>
  ![Snag API documentation overview showing authentication and endpoint details](https://assets.snagsolutions.io/public/docs/api-overview.webp)
</Frame>

<Tip>
  **Using an AI coding assistant?** Connect Cursor, Claude, or Copilot to Snag Docs for context-aware help. [Learn how](/ai-coding-assistant).
</Tip>

<Note>
  Please only use the endpoints specified in this document. Using any other
  endpoints will cause issues with your client.
</Note>

## What You Need

Retrieve your API Key, Currency ID, and Organization ID from the admin dashboard.

## Authentication

All API endpoints require authentication using an API key, which must be included in the request headers.

Include your API key in the x-api-key header as shown below:

```http theme={null}
x-api-key: <YOUR_API_KEY>
```

## Base URL

For development and testing purposes, you can use the following base URL:

```http theme={null}
https://admin.snagsolutions.io
```

<Warning>
  The development base URL has rate limiting restrictions. For production environments, it's recommended to configure a custom hostname to get better rate limits and improved performance.
</Warning>

### Custom Hostname Configuration

You have two options for configuring your production API base URL:

<Tabs>
  <Tab title="Your Own Domain">
    Configure a subdomain on your own domain (e.g., `api.yourwebsite.com` or `loyalty.yourwebsite.com`):

    1. Choose your desired subdomain
    2. Add a CNAME record pointing to your Snag platform
    3. Configure the hostname in the admin dashboard

    <Card title="Learn more about custom domain setup" icon="globe" href="/setup/hostname">
      Detailed instructions for configuring CNAME records and hostname setup.
    </Card>
  </Tab>

  <Tab title="Snag-Hosted Domain">
    Use a subdomain of `snag-render.com` unique to your website/instance (e.g., `yourbrand.snag-render.com`):

    * This option is available directly from the hostname configuration page in admin
    * Provides a professional, branded URL without requiring your own domain
    * Includes the same benefits as custom hostname configuration
  </Tab>
</Tabs>

<Tip>
  Both custom hostname options provide better rate limits and performance compared to the development base URL. Choose the option that best fits your branding and infrastructure requirements.
</Tip>

<Card title="Rate Limits & Hostname Configuration" icon="clock" href="/api-reference/rate-limits">
  Learn about rate limits for different hostname configurations and best practices for avoiding rate limit issues.
</Card>

Here’s an example of an HTTP request with the API key:

```http theme={null}
GET /api/v1/your-endpoint HTTP/1.1
Host: api.snag.com
x-api-key: <YOUR_API_KEY>
Content-Type: application/json

{ /* Request body if applicable */ }
```

## Related pages

<CardGroup cols={2}>
  <Card title="SDK Reference" icon="box-open" href="/api-reference/sdk">
    TypeScript SDK for type-safe access to Snag APIs.
  </Card>

  <Card title="Rate Limits" icon="clock" href="/api-reference/rate-limits">
    Understand rate limiting and hostname-based limits.
  </Card>

  <Card title="Loyalty Overview" icon="stars" href="/loyalty/loyalty-overview">
    Configure reward programs and automate incentives.
  </Card>

  <Card title="User Authentication" icon="user" href="/user-auth/auth-overview">
    Set up wallet, email, and social login for your platform.
  </Card>
</CardGroup>
