AviMiles / Docs
Documentation / Developer API
Developer API

API reference

Authenticate requests and explore the public airline API.

Authentication and first request

  1. Open Developer in your airline dashboard. Enter a key name such as Main airport game and click Generate key.
  2. Copy the key immediately; it is shown only once. Store it in trusted server-side code, never a LocalScript or public repository.
  3. Use https://avitech.tech/api/v1 as the base URL. Send Authorization: Bearer YOUR_API_KEY and Content-Type: application/json for JSON bodies.
  4. Test your key with the airline identity endpoint before integrating other features.
curl -H "Authorization: Bearer YOUR_API_KEY" https://avitech.tech/api/v1/airline

Keys are airline-scoped. The limit is 600 requests per minute per key. Revoke a compromised key in Developer.

Endpoint index

MethodEndpoint
GET/airline
GET/airline/settings
GET/stats
GET/flights
GET/flights/{flight_id}
GET/checkin/open
POST/flights/{flight_id}/checkin
POST/flights/{flight_id}/checkin/batch
GET/flights/{flight_id}/attendance
POST/flights/{flight_id}/presence
GET/passengers/{roblox_id}/balance
GET/passengers/{roblox_id}/profile
GET/passengers/{roblox_id}/transactions
GET/loyalty/tiers
GET/loyalty/members/{roblox_id}
GET/loyalty/passengers/{roblox_id}
PUT/loyalty/passengers/{roblox_id}/tier
POST/miles/award
POST/miles/deduct
POST/miles/set-balance
POST/miles/reverse

Errors and safe requests

HTTP statusAction
400Check input values and query parameters.
401Check the API key; replace revoked keys.
403Check airline access and permissions.
404Check the resource ID and airline.
409Check flight status, balance or conflicting request data.
422Check required JSON fields and types.
429Wait for Retry-After before retrying.

Roblox IDs are digit strings up to 20 characters. Mileage mutation reasons are 3–160 characters; idempotency keys are 8–100 characters. Reuse a key only for the same operation. Example IDs and response values below are illustrative.

GET /airline

Identify the airline associated with your key.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/airline"

Response

{"id":1,"name":"Example Airways","code":"EX"}

GET /airline/settings

Read airline profile settings.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/airline/settings"

Response

{"id":1,"name":"Example Airways","code":"EX","description":"Example","discord_invite":"","website":"","directory_visible":1}

GET /stats

Read totals for the airline.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/stats"

Response

{"flights":5,"passengers_with_balances":12,"miles_awarded":2400}

GET /flights

List up to 200 flights, newest ID first. Optional status: scheduled, boarding, checkin_closed, completed, cancelled.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/flights?status=boarding"

Response

Array of flight objects with id, flight_number, origin, destination, departure, status, classes and total_capacity.

GET /flights/{flight_id}

Retrieve a single flight using its numeric ID.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/flights/42"

Response

Flight object, including classes (id, code, name, capacity) and total_capacity.

GET /checkin/open

Find the flight accepting check-ins.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/checkin/open"

Response

{"open":false,"flight":null}

POST /flights/{flight_id}/checkin

Check in one passenger while boarding. Repeated check-ins are safe.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789"}' "https://avitech.tech/api/v1/flights/42/checkin"

Response

{"ok":true,"already_checked_in":false,"flight_id":42,"roblox_id":"123456789"}

POST /flights/{flight_id}/checkin/batch

Check in 1–300 Roblox IDs; duplicates are counted once.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_ids":["123456789","987654321"]}' "https://avitech.tech/api/v1/flights/42/checkin/batch"

Response

{"ok":true,"flight_id":42,"received":2,"added":2,"already_checked_in":0}

GET /flights/{flight_id}/attendance

Read up to 1,000 checked-in passengers.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/flights/42/attendance"

Response

{"flight_id":42,"status":"boarding","passengers":[{"roblox_id":"123456789","checked_in_at":"2026-11-27T08:00:00Z"}]}

POST /flights/{flight_id}/presence

Record joined, left or rejoined for an already checked-in passenger while boarding.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789","event":"joined"}' "https://avitech.tech/api/v1/flights/42/presence"

Response

{"ok":true}

GET /passengers/{roblox_id}/balance

Read the miles balance; unknown balances return zero.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/passengers/123456789/balance"

Response

{"roblox_id":"123456789","miles":200}

GET /passengers/{roblox_id}/profile

Read balance and attendance/transaction counts.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/passengers/123456789/profile"

Response

{"roblox_id":"123456789","miles":200,"flights_attended":1,"transactions":1}

GET /passengers/{roblox_id}/transactions

Read newest mileage transactions. Limit 1–100, default 50.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/passengers/123456789/transactions?limit=10"

Response

Array of objects containing id, delta, reason and created_at.

GET /loyalty/tiers

List configured loyalty tiers.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/loyalty/tiers"

Response

Array of tier objects including id, name, min_miles, perks, benefits, multiplier and bonus; card configuration when set.

GET /loyalty/members/{roblox_id}

Check membership, tier and perks.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/loyalty/members/123456789"

Response

Membership object: is_member, tier_id, membership_number, perk_ids, miles_multiplier, roblox_id, miles, tier, automatic_tier, manual_override, next_tier, tiers.

GET /loyalty/passengers/{roblox_id}

Alternative membership lookup; same response as /loyalty/members.

curl -X GET -H "Authorization: Bearer YOUR_API_KEY" "https://avitech.tech/api/v1/loyalty/passengers/123456789"

Response

Same membership object.

PUT /loyalty/passengers/{roblox_id}/tier

Assign a numeric tier ID belonging to your airline; use null to clear. Roblox ID must match the path.

curl -X PUT -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789","tier_id":12}' "https://avitech.tech/api/v1/loyalty/passengers/123456789/tier"

Response

Updated membership object.

POST /miles/award

Award 1–10,000 miles.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789","miles":200,"reason":"Test award","idempotency_key":"award-test-001"}' "https://avitech.tech/api/v1/miles/award"

Response

{"ok":true,"duplicate":false,"transaction_id":42}

POST /miles/deduct

Deduct 1–1,000,000 miles; cannot make balance negative.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789","miles":50,"reason":"Test deduction","idempotency_key":"deduct-test-001"}' "https://avitech.tech/api/v1/miles/deduct"

Response

Success includes ok, duplicate, transaction_id; new mutations also return delta and balance.

POST /miles/set-balance

Set balance to 0–1,000,000,000.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"roblox_id":"123456789","balance":500,"reason":"Test correction","idempotency_key":"balance-test-001"}' "https://avitech.tech/api/v1/miles/set-balance"

Response

Success includes ok, duplicate, transaction_id; new mutations also return delta and balance.

POST /miles/reverse

Reverse a mileage transaction using its numeric ID.

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"transaction_id":42,"reason":"Correct test award"}' "https://avitech.tech/api/v1/miles/reverse"

Response

Success identifies the compensating transaction.

Public discovery data

These read-only routes use https://avitech.tech as their base and do not require an airline API key. They expose publicly visible content only.

GET pathPurpose
/api/public/flightsUpcoming public flights; q search, limit 1–200 (default 100).
/api/public/flights/{flight_id}Public flight details.
/api/public/airlines/{code}Public airline profile.
/api/public/airlines/{code}/calendarPublic airline flight calendar.
/api/public/applications/{slug}Open public application form.

Application submission and submission status require a signed-in applicant; use the public application page to submit responses.