---
title: "PHP — Documentation"
canonical: "https://repull.dev/docs/connect-with-php"
description: "Use the Repull API from plain PHP 8.1+: composer require repull/sdk, set your API key, and read reservations and listings."
updated: "2026-11-30T00:48:58.694Z"
commit: "18314c12fefb59a7545ef7607c0893919de20aa9"
---

# PHP

Use the Repull API from PHP with cURL.

### Step 1: Prerequisites

PHP 8.1+ and Composer installed on your machine.

You also need a Repull API key. Get one from your [dashboard](https://repull.dev/dashboard).

### Step 2: Install

```
composer require repull/sdk
```

### Step 3: Set up environment variables

Add your credentials to a `.env` file in your project root:

```
REPULL_API_KEY=sk_live_YOUR_KEY
```

There is one key type — `sk_live_` — created from [/dashboard/keys](https://repull.dev/dashboard/keys). It acts on whatever channels your workspace has connected.

### Step 4: Make your first API call

Set up the SDK with your API key, then call any endpoint. The example below lists properties and fetches reservations.

```
<?php
$ch = curl_init('https://api.repull.dev/v1/properties');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . getenv('REPULL_API_KEY'),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$properties = json_decode($response, true);

echo "Found " . count($properties['data']) . " properties\n";
curl_close($ch);
```

### Step 5: Next steps

You are all set. Explore the rest of the platform:

- [API Reference](https://repull.dev/docs/api/introduction.md): Full endpoint reference with request and response examples.
- [Webhooks](https://repull.dev/docs/webhooks/introduction.md): Get notified when reservations, messages, or syncs change.
- [MCP Server](https://repull.dev/docs/mcp-server.md): Connect Repull to AI agents via the Model Context Protocol.
- [Channel Manager](https://repull.dev/docs/channels/introduction.md): Push listings and availability to Airbnb, Booking.com, and more.
