# Return a booking

> **GET** `https://api.us.nylas.com/v3/scheduling/bookings/{booking_id}`

Source: https://developer.nylas.com/docs/reference/api/bookings/get-bookings-id/

Returns the specified Booking object.

Nylas validates the provided session ID and uses it to retrieve the related
[Configuration object](/docs/reference/api/configurations/). If you created a public
Configuration, you don't need to include the `Authorization` request header with a session ID, but
you do need to pass the Configuration object ID as a query parameter.

**Authentication:** SCHEDULER_SESSION_TOKEN

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `booking_id` | string | Yes | The ID of the booking object to access. |

### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `configuration_id` | string | No | The ID of the Configuration object used for calculating availability. If you're using session authentication (`requires_session_auth: true`), the `configuration_id` isn't required. |
| `slug` | string | No | The Configuration object slug. You can use this with the `client_id` instead of using the `configuration_id`. If you're using session authentication (`requires_session_auth: true`) or using the `configuration_id`, `slug` isn't required. |
| `client_id` | string | No | The client ID that was used to create the Configuration object. Required only if you're using `slug`. |

## Responses

### 200 - Create a new booking

- `request_id` (string) - The request ID.
- `data` (object)
  - `booking_id` (string) **(required)** - The unique ID of the booking.
  - `event_id` (string) **(required)** - The unique ID of the event object associated with the booking.
  - `title` (string) **(required)** - The title of the event.
  - `organizer` (object) **(required)** - The participant that is designated as the organizer of the event.
    - `email` (string) - The organizer's email address.
    - `name` (string) - The organizer's name.
  - `status` (string) **(required)** - The current status of the booking.
  - `description` (string) - The description of the event.

### 400 - Bad Request

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 401 - Unauthorized

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 404 - Not Found

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The raw error from the provider, if available
    - `code` (string)
    - `message` (string)

### 429 - Rate Limit

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.

### 504 - Provider Failure

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.

## Code samples

### cURL (Public)

```bash
curl --compressed --request GET \
  --url 'https://api.us.nylas.com/v3/scheduling/bookings/<BOOKING_ID>?configuration_id=<SCHEDULER_CONFIG_ID>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json'
```

### cURL (Private)

```bash
curl --compressed --request GET \
  --url 'https://api.us.nylas.com/v3/scheduling/bookings/<BOOKING_ID>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <SCHEDULER_SESSION_ID>' \
  --header 'Content-Type: application/json'
```

### Node.js SDK (Public)

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

async function fetchBookingById() {
  try {
    const booking = await nylas.scheduler.bookings.find({
      queryParams: {
        configurationId: "<SCHEDULER_CONFIG_ID>",
      },
      bookingId: "<BOOKING_ID>",
    });
    console.log("Booking", booking);
  } catch (error) {
    console.error("Error fetching booking", error);
  }
}

fetchBookingById();

```

### Python SDK

```python
from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>",
)

booking = nylas.scheduler.bookings.find(
    booking_id="<BOOKING_ID>",
    query_params={
        "configuration_id": "<SCHEDULER_CONFIG_ID>",
    },
)

print("Booking:", booking)

```

### Node.js SDK (Private)

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<SCHEDULER_SESSION_ID>",
  apiUri: "<NYLAS_API_URI>",
});

async function fetchBookingById() {
  try {
    const booking = await nylas.scheduler.bookings.find({
      bookingId: "<BOOKING_ID>",
    });
    console.log("Booking", booking);
  } catch (error) {
    console.error("Error fetching booking", error);
  }
}

fetchBookingById();

```

### Ruby SDK (Public)

```ruby
# Load gems
require 'nylas'

# Initialize Nylas client
nylas = Nylas::Client.new(
  api_key: "<NYLAS_API_KEY>"
)

booking, _request_ids = nylas.scheduler.bookings.find(booking_id: "<SCHEDULER_BOOKING_ID>", query_params: { configuration_id: "<SCHEDULER_CONFIG_ID>" })

puts booking
```

### Ruby SDK (Private)

```ruby
# Load gems
require 'nylas'

# Initialize Nylas client
nylas = Nylas::Client.new(
  api_key: "<SCHEDULER_SESSION_ID>"
)

booking, _request_ids = nylas.scheduler.bookings.find(booking_id: "<SCHEDULER_BOOKING_ID>")

puts booking
```

### Java SDK (Public)

```java
import com.nylas.NylasClient;
import com.nylas.models.Booking;
import com.nylas.models.FindBookingQueryParams;
import com.nylas.models.NylasApiError;
import com.nylas.models.NylasSdkTimeoutError;
import com.nylas.models.Response;

public class FindBookingPublic {
  public static void main(String[] args) throws NylasSdkTimeoutError, NylasApiError {
    NylasClient nylas = new NylasClient.Builder("<NYLAS_API_KEY>").build();

    FindBookingQueryParams queryParams = new FindBookingQueryParams.Builder()
        .configurationId("<SCHEDULER_CONFIG_ID>")
        .build();

    Response<Booking> booking = nylas.scheduler().bookings().find("<BOOKING_ID>", queryParams);

    System.out.println("Booking: " + booking.getData());
  }
}

```

### Java SDK (Private)

```java
import com.nylas.NylasClient;
import com.nylas.models.Booking;
import com.nylas.models.NylasApiError;
import com.nylas.models.NylasSdkTimeoutError;
import com.nylas.models.Response;

public class FindBooking {
  public static void main(String[] args) throws NylasSdkTimeoutError, NylasApiError {
    NylasClient nylas = new NylasClient.Builder("<SCHEDULER_SESSION_ID>").build();

    Response<Booking> booking = nylas.scheduler().bookings().find("<BOOKING_ID>");

    System.out.println("Booking: " + booking.getData());
  }
}

```

### Kotlin SDK (Public)

```kotlin
import com.nylas.NylasClient
import com.nylas.models.FindBookingQueryParams

fun main() {
  val nylas = NylasClient.Builder("<NYLAS_API_KEY>").build()

  val queryParams = FindBookingQueryParams.Builder()
      .configurationId("<SCHEDULER_CONFIG_ID>")
      .build()

  val booking = nylas.scheduler().bookings().find("<BOOKING_ID>", queryParams)

  println("Booking: ${booking.data}")
}

```

### Kotlin SDK (Private)

```kotlin
import com.nylas.NylasClient

fun main() {
  val nylas = NylasClient.Builder("<SCHEDULER_SESSION_ID>").build()

  val booking = nylas.scheduler().bookings().find("<BOOKING_ID>")

  println("Booking: ${booking.data}")
}

```
