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

# Quickstart

> Get an access token and make your first read-only request.

This guide checks your API access without creating or changing an appointment.

## Prerequisites

You need:

* A Spark API client ID and client secret.
* The `dealerships:read` scope granted to your client, and access to at least one dealership.
* A server-side Bash shell with cURL 7.76 or later and [jq](https://jqlang.org/).

Contact [support@sparkserv.com](mailto:support@sparkserv.com) for credentials and access questions.

## 1. Get an access token

Set your credentials in your server environment. Do not commit them or put them in browser code.

```bash theme={null}
export SPARK_CLIENT_ID='your-client-id'
export SPARK_CLIENT_SECRET='your-client-secret'
export SPARK_API_URL='https://api.sparkserv.com'

curl --fail-with-body --silent --show-error \
  'https://auth.sparkserv.com/oauth/token' \
  --header 'Content-Type: application/json' \
  --data "$(jq -n \
    --arg client_id "$SPARK_CLIENT_ID" \
    --arg client_secret "$SPARK_CLIENT_SECRET" \
    '{grant_type: "client_credentials", client_id: $client_id,
      client_secret: $client_secret, audience: "https://api.sparkserv.com/public",
      scope: "dealerships:read"}')"
```

On success, take `access_token` from the response and set it for subsequent requests:

```bash theme={null}
export SPARK_ACCESS_TOKEN='your-access-token'
```

See [Authentication](https://docs.sparkserv.com/authentication.md) for the scopes needed to discover availability or book appointments.

## 2. List your dealerships

Use the [dealership discovery endpoint](https://docs.sparkserv.com/api-reference/dealerships/list-the-dealerships-this-client-can-access.md):

```bash theme={null}
curl --fail-with-body --silent --show-error \
  "$SPARK_API_URL/public/v1/dealerships" \
  --header "Authorization: Bearer $SPARK_ACCESS_TOKEN"
```

The response is an array. This illustrative response uses synthetic data:

```json theme={null}
[
  {
    "id": "37c078c5-a87a-4af5-a41d-b234c314e60d",
    "name": "Example Motors",
    "timezone": "America/New_York"
  }
]
```

Choose an ID from **your** response, not the example:

```bash theme={null}
export DEALERSHIP_ID='dealership-uuid-from-your-response'
```

Use the returned timezone when choosing scheduling dates. The dealership-list request does not need a `Dealership-Id` header.

## Next steps

Continue to [Book an appointment](https://docs.sparkserv.com/guides/book-an-appointment.md). Request the additional scopes first, then use the selected dealership ID on discovery and booking requests.

If access fails, check [Authentication](https://docs.sparkserv.com/authentication.md) and [Errors and safe retries](https://docs.sparkserv.com/guides/errors-and-retries.md). An empty dealership list means there is no dealership to select; contact support to check your access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.