API reference

Account

Plan, usage and API keys.

Plan and usage#

GET/v1/account

Account, plan limits and usage for the current month. Any valid key or session of the account may read it; no scope needed.

Auth
API key (Authorization: Bearer 1fly_test_… or 1fly_live_…)Session (Cookie onefly_session)(any one)
Operation id
get_account

Code samples

curl 'https://api.1fly.uz/v1/account' \
  -H "Authorization: Bearer $ONEFLY_API_KEY"

Responses

200Account overview.
Example response
{
  "account": {
    "id": "acc_…",
    "name": "Sky Travel",
    "type": "agency",
    "plan": "basic",
    "status": "active"
  },
  "plan": {
    "id": "basic",
    "name": "Basic",
    "ordersPerMonth": 1000,
    "requestsPerMinute": 300,
    "liveKeys": true
  },
  "usage": {
    "periodStart": "2026-11-01T00:00:00.000Z",
    "ordersThisPeriod": 312,
    "requestsThisPeriod": 18420,
    "mcpCallsThisPeriod": 960,
    "errorsLast24h": 14,
    "requestsLast24h": 1210
  }
}
401Missing or invalid credentials.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
403The key lacks a required scope, or the account is suspended.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
500Unexpected error on our side; quote the requestId.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}

List API keys#

GET/v1/api-keys

Dashboard session only. Secrets are never returned after creation.

Auth
Session (Cookie onefly_session)
Operation id
get_api_keys

Code samples

curl 'https://api.1fly.uz/v1/api-keys' \
  -b 'onefly_session=<session cookie>'

Responses

200Keys.
Example response
{
  "keys": []
}
401Missing or invalid credentials.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
500Unexpected error on our side; quote the requestId.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}

Create an API key#

POST/v1/api-keys

Dashboard session only (owner, admin or developer). The secret is returned once; store it safely. Live keys need a paid plan.

Auth
Session (Cookie onefly_session)
Operation id
post_api_keys

Request body application/json required

FieldTypeDescription
namerequiredstring
length: 1–60
moderequiredstring
one of: "test", "live"
scopesrequiredarray<string>
items: 1–4
expiresInDaysrequiredconst 30 | const 90 | const 365 | null
Example request body
{
  "name": "Booking server",
  "mode": "test",
  "scopes": [
    "orders:read",
    "orders:write"
  ],
  "expiresInDays": 90
}

Code samples

curl -X POST 'https://api.1fly.uz/v1/api-keys' \
  -b 'onefly_session=<session cookie>' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Booking server",
  "mode": "test",
  "scopes": [
    "orders:read",
    "orders:write"
  ],
  "expiresInDays": 90
}'

Responses

201Key created.
Example response
{
  "key": {
    "id": "key_…",
    "name": "Booking server",
    "prefix": "1fly_test_a1b2",
    "mode": "test",
    "scopes": [
      "orders:read",
      "orders:write"
    ]
  },
  "secret": "1fly_test_a1b2…"
}
401Missing or invalid credentials.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
500Unexpected error on our side; quote the requestId.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}

Revoke an API key#

POST/v1/api-keys/{id}/revoke

Takes effect immediately.

Auth
Session (Cookie onefly_session)
Operation id
post_api_keys_id_revoke

Parameters

Path parameters

NameTypeDescription
idrequiredstring

Key id.

pattern: ^key_[a-f0-9]{32}$

Code samples

curl -X POST 'https://api.1fly.uz/v1/api-keys/key_abcdef0123456789abcdef0123456789/revoke' \
  -b 'onefly_session=<session cookie>'

Responses

200Revoked key.
Example response
{
  "key": {
    "id": "key_…",
    "revokedAt": "2026-11-17T10:00:00.000Z"
  }
}
401Missing or invalid credentials.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
500Unexpected error on our side; quote the requestId.
FieldTypeDescription
errorrequiredobject
code (in error)requiredstring

Stable machine-readable code, e.g. VALIDATION_FAILED.

message (in error)requiredstring

Human-readable explanation.

requestId (in error)requiredstring

Quote this to support; also in the x-request-id header and the request log.

issues (in error)array<object>

Present for VALIDATION_FAILED: one entry per problem.

path (in error.issues)string
Example: passengers.0.lastName
code (in error.issues)string
message (in error.issues)string
Response (generated from schema)
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
    "issues": [
      {
        "path": "passengers.0.lastName",
        "code": "string",
        "message": "string"
      }
    ]
  }
}
API version v0.0.1 · Spec generated from source on 2026-11-22Changelog · Prices in so‘m (UZS)