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

# Endpoints

> Events API—upcoming and past events, and text list signup

<Note>
  You will receive the base URL when you get an API key. The examples below use `BASE_ENDPOINT` as a placeholder for that URL.
</Note>

## POST /v1/events/upcoming

Returns a user's **upcoming** events.

### Request

Send a JSON body with the user ID and your API key:

| Field | Type   | Description   |
| ----- | ------ | ------------- |
| `_id` | string | The user ID.  |
| `key` | string | Your API key. |

```json theme={null}
{
  "_id": "userId",
  "key": "apikey"
}
```

### Response

Each event in the response includes:

| Field           | Description                                              |
| --------------- | -------------------------------------------------------- |
| `eventId`       | Document ID (`doc.id`).                                  |
| `url`           | Event URL, e.g. `https://peerpop.io/events/{specialId}`. |
| `flyer`         | Flyer image URL.                                         |
| `title`         | Event title.                                             |
| `date`          | Event date.                                              |
| `time`          | Event time.                                              |
| `address`       | Event address.                                           |
| `venue`         | Venue name, or `false` if not set.                       |
| `organizer`     | Organizer (self or main co-host).                        |
| `live`          | Whether the event is live.                               |
| `description`   | Event description.                                       |
| `startingPrice` | Cheapest ticket price as a string, e.g. `10.00`.         |
| `tags`          | Array of tags assigned to the event.                     |

### Example

```bash theme={null}
curl -X POST "BASE_ENDPOINT/v1/events/upcoming" \
  -H "Content-Type: application/json" \
  -d '{"_id": "userId", "key": "apikey"}'
```

***

## POST /v1/events/past

Returns a user's **past** events.

### Request

Same as upcoming: send a JSON body with the user ID and your API key:

| Field | Type   | Description   |
| ----- | ------ | ------------- |
| `_id` | string | The user ID.  |
| `key` | string | Your API key. |

```json theme={null}
{
  "_id": "userId",
  "key": "apikey"
}
```

### Response

Same shape as upcoming events:

| Field           | Description                                              |
| --------------- | -------------------------------------------------------- |
| `eventId`       | Document ID (`doc.id`).                                  |
| `url`           | Event URL, e.g. `https://peerpop.io/events/{specialId}`. |
| `flyer`         | Flyer image URL.                                         |
| `title`         | Event title.                                             |
| `date`          | Event date.                                              |
| `time`          | Event time.                                              |
| `address`       | Event address.                                           |
| `venue`         | Venue name, or `false` if not set.                       |
| `organizer`     | Organizer (self or main co-host).                        |
| `live`          | Whether the event is live.                               |
| `description`   | Event description.                                       |
| `startingPrice` | Cheapest ticket price as a string, e.g. `10.00`.         |
| `tags`          | Array of tags assigned to the event.                     |

### Example

```bash theme={null}
curl -X POST "BASE_ENDPOINT/v1/events/past" \
  -H "Content-Type: application/json" \
  -d '{"_id": "userId", "key": "apikey"}'
```

***

## POST /v1/update\_text\_list

Adds a phone number to your **Website Text List** contact group.

### Request

Send a JSON body with your user ID, the subscriber's phone number, and your API key:

| Field   | Type   | Description                                                                                   |
| ------- | ------ | --------------------------------------------------------------------------------------------- |
| `_id`   | string | Your user ID.                                                                                 |
| `phone` | string | Phone number formatted exactly as 10 digits with no spaces or punctuation, e.g. `6780001234`. |
| `key`   | string | Your API key.                                                                                 |

```json theme={null}
{
  "_id": "userId",
  "phone": "6780001234",
  "key": "apikey"
}
```

### Example

```bash theme={null}
curl -X POST "BASE_ENDPOINT/v1/update_text_list" \
  -H "Content-Type: application/json" \
  -d '{"_id": "userId", "phone": "6780001234", "key": "apikey"}'
```
