Source: https://fleetkeep.co.uk/developers
Documentation index: https://fleetkeep.co.uk/llms.txt

[Home](https://fleetkeep.co.uk/) › Developers Developer docs · v0.7

# Fleetkeep API

OAuth 2.1 with PKCE · scoped operations · OpenAPI 3.1

[Read as Markdown](https://fleetkeep.co.uk/developers.md) [Documentation index](https://fleetkeep.co.uk/llms.txt)

Build authorised workflows across vehicles, maintenance, defects, daily checks, documents,
costs and connected tracking. The fleet operator grants narrow access through a standard OAuth
authorisation-code flow. Consequential operations keep confirmation, permission and audit
controls on the Fleetkeep side.

OAuth 2.1

Authorisation

Authorisation Code + PKCE

OpenAPI 3.1

Published contract

Explicit schemas · errors · operation IDs

Scoped

Scopes

Read and write authority stays separate

60 rpm

Rate limit

Per access token

## Access

Use the Fleetkeep CLI and supported agent connections with your Business account through OAuth sign-in.
Building a separate integration? Client registration is managed by Fleetkeep. [Tell us about your integration](https://fleetkeep.co.uk/contact) to request access.

## What you can do

Each Fleetkeep user has a list of vehicles. Each vehicle has a registration plate, a label,
operational status, assigned driver notes, and four compliance dates: MOT, road tax, insurance
renewal, and last service. The API lets your client read those records and write to them on
behalf of the user, once they've consented through the OAuth flow.

## Agent and CLI spreadsheet imports

Fleetkeep exposes one spreadsheet path to the dashboard, API and first-party CLI. An agent
first calls `POST /api/v1/imports/vehicles/preview` with CSV or XLSX content. The
response includes row counts and a SHA-256 digest, without changing fleet records. Applying
the import requires the identical file, that digest and a stable idempotency key at `POST /api/v1/imports/vehicles/apply` .

## Record servicing with operator confirmation

An authorised agent can turn “BD15 KFG had a service today at 48,212 miles” into a proposed
service record. Fleetkeep matches the exact registration and returns the details for review.
The first request makes no change. The operator must confirm the same payload before it is
saved.

```
fleetkeep service record "BD15 KFG" \
  --date 2026-09-27 \
  --mileage 48212 \
  --work "Scheduled service"
```

The command uses the `maintenance:write` scope, a short-lived server confirmation and
a stable idempotency key. Safe retries return the original record. The saved record keeps source
provenance and an audit entry. The public ChatGPT connector remains read-only.

```
fleetkeep import preview vehicles.xlsx
fleetkeep import apply vehicles.xlsx --confirm DIGEST_FROM_PREVIEW
```

The CLI signs in through Fleetkeep using a public OAuth client, S256 PKCE and a local loopback
callback. Tokens are kept in an owner-only local file and are never accepted as command-line
arguments. `FLEETKEEP_ACCESS_TOKEN` remains available as an explicit environment override
for unattended automation. Package publication remains separate from API access.

## Common vehicle and servicing endpoints

GET `/api/v1/vehicles`

List every vehicle on the authorised user's account.

requires `vehicles:read`

GET `/api/v1/vehicles/{id}`

Fetch a single vehicle including MOT, tax, insurance and service due dates.

requires `vehicles:read`

POST `/api/v1/vehicles`

Add a vehicle by registration. Triggers DVLA + DVSA auto-fill server-side.

requires `vehicles:write`

PATCH `/api/v1/vehicles/{id}`

Update mutable fields (label, insurance date, service date, service interval).

requires `vehicles:write`

DELETE `/api/v1/vehicles/{id}`

Remove a vehicle from the user's account.

requires `vehicles:write`

POST `/api/v1/vehicles/bulk`

Add up to 50 registrations in a single request.

requires `vehicles:write`

GET `/api/v1/vehicles/{id}/service-records`

List recorded servicing with source provenance and bounded pagination.

requires `maintenance:read`

POST `/api/v1/vehicles/{id}/service-records`

Record servicing after explicit operator confirmation.

requires `maintenance:write`

Full request and response schemas, error codes and example payloads are in the [OpenAPI 3.1 specification](https://fleetkeep.co.uk/openapi.json) . All dates are ISO 8601 ( `YYYY-MM-DD` ). Vehicle plates are normalised server-side
to upper-case with no spaces.

## Authorisation

Fleetkeep is an OAuth 2.1 authorisation server. The flow is the standard authorisation-code
grant with PKCE. There are no implicit, device, or password grants. Here is the request you
make and what comes back at each step:

- Discover the metadata

Once at integration time. Cache the response.

```
GET https://fleetkeep.co.uk/.well-known/oauth-authorization-server
```

- Send the user to /auth/oauth2/authorize

Browser redirect. Includes `client_id` , `redirect_uri` , `code_challenge` (SHA-256), `code_challenge_method=S256` , `scope` (any combination of `vehicles:read` , `vehicles:write` , `maintenance:read` , `maintenance:write` and `offline_access` )
and a CSRF `state` . Include `offline_access` in the scope list if you
want a refresh token returned at step 4.

```
https://fleetkeep.co.uk/auth/oauth2/authorize?
  response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https://yourapp.example/oauth/callback
  &scope=vehicles:read vehicles:write offline_access
  &code_challenge=...
  &code_challenge_method=S256
  &state=...
```

- User sees the consent screen

They review the scopes and your client name. They approve or deny.

- Exchange the code for tokens

Server-to-server. `code_verifier` proves you started the flow. The authorisation
code expires after 10 minutes and is single-use.

```
POST https://fleetkeep.co.uk/auth/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code=...
&redirect_uri=https://yourapp.example/oauth/callback
&client_id=YOUR_CLIENT_ID
&code_verifier=...
```

Returns an `access_token` (1 hour). If `offline_access` was in the
requested scope, also returns a `refresh_token` (30 days).

- Call the API with the access token

```
GET https://fleetkeep.co.uk/api/v1/vehicles
Authorization: Bearer ACCESS_TOKEN
Accept: application/json
```

- Refresh before the access token expires

A successful refresh returns a new access token and a new refresh token; the old refresh
token is invalidated immediately.

```
POST https://fleetkeep.co.uk/auth/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token
&refresh_token=...
&client_id=YOUR_CLIENT_ID
```

## Quick start with curl

Once you have an access token, listing a user's vehicles is one request:

```
curl https://fleetkeep.co.uk/api/v1/vehicles \
  -H "Authorization: Bearer $FLEETKEEP_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

Adding a vehicle by registration triggers a DVLA + DVSA lookup server-side, so the response
includes the make, model, MOT due date and tax due date populated automatically:

```
curl -X POST https://fleetkeep.co.uk/api/v1/vehicles \
  -H "Authorization: Bearer $FLEETKEEP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
    "registration": "BD15KFG",
    "label": "Transit white",
    "insuranceDueDate": "2026-08-22",
    "serviceIntervalDays": 42
  }'
```

## Rate limits

Each access token gets 60 requests per minute , sliding window. The bulk-add
endpoint counts as one request regardless of payload size. When you breach the limit you'll
get an `HTTP 429` with `Retry-After` header in seconds. Backoff and retry;
do not loop.

If your integration is hitting the cap with a real partner workflow we can lift it; [tell us](https://fleetkeep.co.uk/contact) . We don't lift it for testing.

## Token lifetimes

- Authorisation code: 10 minutes. Single-use. Bound to the PKCE code verifier.
- Access token: 1 hour. Bearer-scoped.
- Refresh token: 30 days. Single-use; each refresh issues
a new token and invalidates the previous one. Returned only when the requested scopes
include `offline_access` .

Custom refresh windows. If your integration has a use case for a longer
refresh window (up to 365 days), tell us when we set up your client. We do not currently issue
tokens with no expiry; refresh-token rotation is the kill-switch when something leaks.
Per-client configurable TTL is on the roadmap and depends on upstream support in [@better-auth/oauth-provider](https://github.com/better-auth/better-auth) .

## Discovery and metadata URLs

Standards-compliant discovery: every URL below is publicly served and cacheable.

- [/.well-known/oauth-authorization-server](https://fleetkeep.co.uk/.well-known/oauth-authorization-server) , RFC 8414 OAuth metadata.
- [/.well-known/oauth-protected-resource](https://fleetkeep.co.uk/.well-known/oauth-protected-resource) :
RFC 9728 resource server descriptor.
- [/.well-known/api-catalog](https://fleetkeep.co.uk/.well-known/api-catalog) : RFC 9727 API catalogue
(linkset format).
- [/.well-known/agent-skills/index.json](https://fleetkeep.co.uk/.well-known/agent-skills/index.json) :
Cloudflare Agent Skills descriptor.
- [/openapi.json](https://fleetkeep.co.uk/openapi.json) : OpenAPI 3.1 specification.
- [/llms-full.txt](https://fleetkeep.co.uk/llms-full.txt) : full-text bundle for LLM ingestion.

## Errors

Error responses are JSON with an `error` field. The HTTP status conveys the class:

- 400 : invalid request shape (missing required field, malformed body).
- 401 : missing, expired or revoked Bearer token. If you hold a refresh token,
refresh first; otherwise re-run the authorisation flow from step 2.
- 403 : token is valid but its scopes don't cover the operation.
- 404 : vehicle ID doesn't exist or doesn't belong to the authorised user.
- 409 : registration already on the user's account (POST `/vehicles` ).
- 429 : rate-limited. Honour `Retry-After` .
- 5xx : server fault. Retry with backoff.

Bulk endpoint: `POST /api/v1/vehicles/bulk` returns `200` with separate `created` and `errors` arrays so partial successes
are explicit.

## Current boundaries

Three things are deliberately out of scope right now:

- Webhooks for compliance status changes. If you need pushed updates when a vehicle's
MOT expires or a tax renewal posts, polling once a day is the current pattern. Compliance webhooks are not currently available.
- Multi-partner / dynamic client registration. Partner clients are issued manually.
RFC 7591 dynamic client registration isn't enabled.
- Driver, contact or audit-log read endpoints. The API is vehicle-scoped; user
contact details and the consent ledger stay with the Fleetkeep app for now.

### Building on Fleetkeep?

Drop us a note describing the integration and we'll set up sandbox credentials within a
working day.

[Get in touch →](https://fleetkeep.co.uk/contact)

## Standards we follow

- [OAuth 2.1 (draft)](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1) , Authorisation Code with PKCE only.
- [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636) , PKCE for OAuth.
- [RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414) , OAuth 2.0 Authorization Server Metadata.
- [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728) , OAuth 2.0 Protected Resource Metadata.
- [RFC 9727](https://datatracker.ietf.org/doc/html/rfc9727) , API Catalog.
- [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0) , specification format.

Fleetkeep is not affiliated with the IETF, the OpenAPI Initiative, DVLA or DVSA.

## Related

[How Fleetkeep works Product overview for end users.](https://fleetkeep.co.uk/how-it-works) [Data sources and privacy Where vehicle data comes from, where it goes.](https://fleetkeep.co.uk/data-sources-and-privacy) [Contact Get sandbox credentials, ask anything.](https://fleetkeep.co.uk/contact)
