# HTTP Source


The HTTP source lets you send events to RudderStack using standard HTTP REST API requests.

This guide will help you set up and use the HTTP source in RudderStack.

## Overview

The HTTP source is helpful for server-to-server data ingestion, making it ideal for backend services, microservices, and serverless functions that need to send event data to RudderStack.

You can also use this source from constrained clients — for example, HTML/CSS-only UIs that cannot load the JavaScript SDK. In those cases, send events with the [Pixel API]({{< ref "api/pixel-api.md" >}}) via `GET` requests or a 1×1 tracking `<img>` tag.

Some key features of this source integration are listed below:

- **Zero configuration**: No source-specific settings required — this integration works out of the box
- **Server-side processing**: Events are processed by RudderStack's cloud infrastructure
- **Standard HTTP API**: Uses standard REST API endpoints for event ingestion
- **Universal compatibility**: Works with any application that can make HTTP requests
- **Full event support**: Supports all standard RudderStack event types (track, identify, page, screen, group, alias)

## Get started

1. Go to your [RudderStack dashboard](https://app.rudderstack.com/) and click **Add Source**. 
2. From the list of **Event Streams** sources, select **HTTP**.
3. Assign a name to your source and click **Continue**. Your HTTP source is now configured. 

{{< success>}}
The HTTP source requires no additional setup — it is ready to use immediately.
{{< /success >}}

4. Go to the **Settings** tab of the source and copy your source {{< glossary_tooltip "write-key" >}}.
5. Go to the **Connections** tab and copy the  {{< glossary_tooltip "data-plane-url" >}}.

{{< image src="images/rs-cloud/data-plane-url.webp" alt="Data Plane URL" >}}

## Supported events

The HTTP source supports all standard RudderStack event types.

You can send events by making HTTP `POST` requests to the RudderStack API endpoint:

```http
POST https://<DATA_PLANE_URL>/v1/<EVENT_TYPE>
```

The HTTP source supports the following endpoints:

| Endpoint | Use case |
| :--------| :--------|
| `/v1/track` | Track user actions and events |
| `/v1/identify` | Update user traits and attributes |
| `/v1/page` | Track page views |
| `/v1/screen` | Track screen views (mobile apps) |
| `/v1/group` | Associate users with groups |
| `/v1/alias` | Merge user identities |
| `/v1/batch` | Send multiple events in a single request |

### API reference

See the [RudderStack HTTP API documentation]({{< ref "api/http-api" >}}) for more information on API authentication, endpoints, request/response format, response codes, and error handling.

### Pixel API (client-side `GET`)

When the client cannot send `POST` requests (for example HTML/CSS-only environments or email HTML), use the [Pixel API]({{< ref "api/pixel-api.md" >}}) to send [`page`]({{< ref "event-spec/standard-events/page.md" >}}) and [`track`]({{< ref "event-spec/standard-events/track.md" >}}) events via `GET`.

{{< info >}}
Unlike the standard HTTP API endpoints listed above, Pixel API requests use separate `/pixel/v1/*` endpoints and are not part of the `/v1/*` endpoint table.
{{< /info >}}

```http
GET https://<DATA_PLANE_URL>/pixel/v1/track?writeKey=<WRITE_KEY>&anonymousId=<ANONYMOUS_ID>&event=<EVENT_NAME>
```

See [Track with an image pixel]({{< ref "api/pixel-api.md#track-with-an-image-pixel" >}}) for an HTML example.

### Request size limits

RudderStack allows messages with a maximum size of `32KB` per call. 

The [`/v1/batch` endpoint](#batch-events) accepts a maximum call size of `4MB` per batch and `32KB` per call.

For event JSON nesting depth limits, see [Maximum allowed JSON nesting depth]({{< ref "api/http-api.md#maximum-allowed-json-nesting-depth" >}}).

### Examples

This section provides examples of how to use the HTTP source to send events to RudderStack.

#### Track event example

```bash
curl -u <WRITE_KEY>: -X POST <DATA_PLANE_URL>/v1/track \
  -H "Content-Type: application/json" \
  -d '{
    "event": "Product Purchased",
    "userId": "user123",
    "properties": {
      "productId": "prod-456",
      "price": 29.99,
      "currency": "USD"
    }
  }'
```

#### Identify event example

```bash
curl -u <WRITE_KEY>: -X POST <DATA_PLANE_URL>/v1/identify \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user123",
    "traits": {
      "email": "user@example.com",
      "name": "John Doe",
      "plan": "premium"
    }
  }'
```

#### Batch events

You can send multiple events in a single request using the batch endpoint:

```bash
curl -u <WRITE_KEY>: -X POST <DATA_PLANE_URL>/v1/batch \
  -H "Content-Type: application/json" \
  -d '{
    "batch": [
      {
        "type": "track",
        "event": "Product Purchased",
        "userId": "user123",
        "properties": {
          "productId": "prod-456"
        }
      },
      {
        "type": "identify",
        "userId": "user123",
        "traits": {
          "email": "user@example.com"
        }
      }
    ]
  }'
```

## FAQ

#### When should I use the HTTP source?

Use the HTTP source when you need to:

- Send events from server-side applications (backend services, APIs, microservices)
- Integrate with systems that do not support RudderStack SDKs
- Send events from serverless functions or cloud functions
- Build custom integrations that require direct HTTP access
- Send events from environments where SDK installation is not feasible
- Track impressions or other events from HTML/CSS-only clients using the [Pixel API]({{< ref "api/pixel-api.md" >}})

#### Can I track events without JavaScript?

Yes. If the client can load images but cannot run JavaScript, embed a Pixel API URL in a `<img>` tag. 

If the client can send `POST` requests with JSON, use the [HTTP API]({{< ref "api/http-api.md" >}}) instead — you do not need the Pixel API in that case.

See [Track with an image pixel]({{< ref "api/pixel-api.md#track-with-an-image-pixel" >}}) and the [Pixel API reference]({{< ref "api/pixel-api.md" >}}).

#### What is the difference between the HTTP source and the SDK sources?

The following table highlights the key differences between the HTTP source and the SDK sources:

| Feature | HTTP Source | SDK Sources (Web, iOS, Android) |
| :--------| :--------| :--------|
| **Installation** | No installation needed | Requires SDK installation |
| **Processing** | Server-side (cloud) | Can be client-side or cloud |
| **Use case** | Backend services, APIs | Client applications, websites |
| **Configuration** | None required | SDK-specific settings |

