API reference
Admin
Platform administration (1fly staff).
List accounts#
Platform admins only.
Parameters
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | max length: 100 |
status | string | one of: "active", "suspended" |
limit | integer | range: 1–200default: 50 |
offset | integer | range: 0–9007199254740991default: 0 |
Code samples
curl 'https://api.1fly.uz/v1/admin/accounts' \
-b 'onefly_session=<session cookie>'const res = await fetch('https://api.1fly.uz/v1/admin/accounts', {
credentials: 'include', // session cookie
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (request ${data.error.requestId})`);import requests
resp = requests.get(
"https://api.1fly.uz/v1/admin/accounts",
cookies={"onefly_session": "<session cookie>"},
timeout=30,
)
data = resp.json()
if not resp.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")Responses
200Accounts.
{
"rows": [],
"total": 0
}401Missing or invalid credentials.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"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.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"error": {
"code": "string",
"message": "string",
"requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
"issues": [
{
"path": "passengers.0.lastName",
"code": "string",
"message": "string"
}
]
}
}Get an account#
Platform admins only. Members, keys and usage.
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Account id. pattern: ^acc_[a-f0-9]{32}$ |
Code samples
curl 'https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789' \
-b 'onefly_session=<session cookie>'const res = await fetch('https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789', {
credentials: 'include', // session cookie
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (request ${data.error.requestId})`);import requests
resp = requests.get(
"https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789",
cookies={"onefly_session": "<session cookie>"},
timeout=30,
)
data = resp.json()
if not resp.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")Responses
200Account.
{}401Missing or invalid credentials.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"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.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"error": {
"code": "string",
"message": "string",
"requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
"issues": [
{
"path": "passengers.0.lastName",
"code": "string",
"message": "string"
}
]
}
}Suspend, reactivate or change plan#
Platform admins only.
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Account id. pattern: ^acc_[a-f0-9]{32}$ |
Request body application/json required
| Field | Type | Description |
|---|---|---|
status | string | one of: "active", "suspended" |
plan | string | one of: "free", "basic", "pro" |
{
"status": "suspended"
}Code samples
curl -X PATCH 'https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789' \
-b 'onefly_session=<session cookie>' \
-H 'Content-Type: application/json' \
-d '{
"status": "suspended"
}'const res = await fetch('https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include', // session cookie
body: JSON.stringify({
"status": "suspended"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (request ${data.error.requestId})`);import requests
resp = requests.patch(
"https://api.1fly.uz/v1/admin/accounts/acc_abcdef0123456789abcdef0123456789",
cookies={"onefly_session": "<session cookie>"},
json={
"status": "suspended",
},
timeout=30,
)
data = resp.json()
if not resp.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")Responses
200Updated.
{}401Missing or invalid credentials.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"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.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"error": {
"code": "string",
"message": "string",
"requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
"issues": [
{
"path": "passengers.0.lastName",
"code": "string",
"message": "string"
}
]
}
}All request logs#
Platform admins only. Same filters as /v1/logs plus accountId.
Parameters
Query parameters
| Name | Type | Description |
|---|---|---|
keyId | string | pattern: ^key_[a-f0-9]{32}$ |
accountId | string | pattern: ^acc_[a-f0-9]{32}$ |
status | string | one of: "2xx", "4xx", "5xx" |
channel | string | one of: "api", "mcp", "web", "admin" |
method | string | one of: "GET", "POST", "PATCH", "PUT", "DELETE" |
path | string (starts_with) | pattern: ^\/.*max length: 200 |
orderId | string | pattern: ^ord_[a-f0-9]{32}$ |
from | string (date-time) | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$ |
to | string (date-time) | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$ |
limit | integer | range: 1–100default: 50 |
cursor | integer | ≤ 9007199254740991> 0 |
Code samples
curl 'https://api.1fly.uz/v1/admin/logs' \
-b 'onefly_session=<session cookie>'const res = await fetch('https://api.1fly.uz/v1/admin/logs', {
credentials: 'include', // session cookie
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (request ${data.error.requestId})`);import requests
resp = requests.get(
"https://api.1fly.uz/v1/admin/logs",
cookies={"onefly_session": "<session cookie>"},
timeout=30,
)
data = resp.json()
if not resp.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")Responses
200Logs.
{
"rows": [],
"nextCursor": null
}401Missing or invalid credentials.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"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.
| Field | Type | Description |
|---|---|---|
errorrequired | object | |
code (in error)required | string | Stable machine-readable code, e.g. VALIDATION_FAILED. |
message (in error)required | string | Human-readable explanation. |
requestId (in error)required | string | 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 |
{
"error": {
"code": "string",
"message": "string",
"requestId": "5b0c9a7e-2d1f-4e3a-9b8c-7d6e5f4a3b2c",
"issues": [
{
"path": "passengers.0.lastName",
"code": "string",
"message": "string"
}
]
}
}