MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Looking for a narrative integration guide instead? See the [Frontend Guide](/docs).

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Admin — audit izi

Audit izi ro'yxati

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/audit-log" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/audit-log"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "status": "error",
    "message": "Autentifikatsiyadan o‘tilmagan.",
    "data": [],
    "errors": null,
    "meta": null
}
 

Request      

GET api/v1/admin/audit-log

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Admin — autentifikatsiya

Admin panelga kirish (cookie sessiyasi)

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "gbailey@example.net",
    "password": "|]|{+-"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/admin/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

validation.email validation.max. Example: gbailey@example.net

password   string     

Example: |]|{+-

Sessiyani yopish

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/admin/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Kirgan adminning profili va ruxsatlari

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/me" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/me"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "status": "error",
    "message": "Autentifikatsiyadan o‘tilmagan.",
    "data": [],
    "errors": null,
    "meta": null
}
 

Request      

GET api/v1/admin/me

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Admin — bosh sahifa

Bosh sahifa ko'rsatkichlari

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/dashboard/summary" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/dashboard/summary"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Success",
    "data": {
        "stats": {
            "users": 3,
            "published_posts": 210,
            "post_views": 15320,
            "assistant_sessions": 41
        },
        "trend": [
            {
                "month": "2026-04",
                "published_posts": 6
            },
            {
                "month": "2026-05",
                "published_posts": 9
            },
            {
                "month": "2026-06",
                "published_posts": 4
            },
            {
                "month": "2026-07",
                "published_posts": 11
            },
            {
                "month": "2026-08",
                "published_posts": 7
            },
            {
                "month": "2026-09",
                "published_posts": 2
            }
        ]
    },
    "errors": null,
    "meta": null
}
 

Request      

GET api/v1/admin/dashboard/summary

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Admin — murojaatlar

Murojaatlar ro'yxati

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/appeals?filter%5Bsearch%5D=2026%2F09&filter%5Bstatus%5D=received&filter%5Btype%5D=complaint&filter%5Bis_anonymous%5D=&filter%5Bopen%5D=1&sort=-created_at&per_page=20" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/appeals"
);

const params = {
    "filter[search]": "2026/09",
    "filter[status]": "received",
    "filter[type]": "complaint",
    "filter[is_anonymous]": "0",
    "filter[open]": "1",
    "sort": "-created_at",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 37,
            "tracking_number": "2026/09-0333",
            "type": "application",
            "status": "received",
            "is_anonymous": false,
            "applicant_name": "Prof. Ashtyn O'Connell",
            "applicant_phone": "+998908980089",
            "applicant_email": "pagac.skylar@example.org",
            "applicant_region": "Toshkent shahri",
            "subject": "Laboriosam est alias.",
            "locale": "uz",
            "deadline_at": "2026-09-27T13:16:35+00:00",
            "is_overdue": false,
            "status_changed_at": "2026-09-12T13:16:35+00:00",
            "responded_at": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        },
        {
            "id": 38,
            "tracking_number": "2026/09-5250",
            "type": "application",
            "status": "received",
            "is_anonymous": false,
            "applicant_name": "Prof. Lydia Brekke V",
            "applicant_phone": "+998909938658",
            "applicant_email": "buster.bauch@example.com",
            "applicant_region": "Toshkent shahri",
            "subject": "Et error neque recusandae.",
            "locale": "uz",
            "deadline_at": "2026-09-27T13:16:35+00:00",
            "is_overdue": false,
            "status_changed_at": "2026-09-12T13:16:35+00:00",
            "responded_at": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        }
    ]
}
 

Request      

GET api/v1/admin/appeals

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[search]   string  optional    

Raqam, mavzu, ism, telefon yoki email bo'yicha. Example: 2026/09

filter[status]   string  optional    

received, in_review, info_requested, answered, rejected. Example: received

filter[type]   string  optional    

application, complaint, proposal, corruption, conflict_of_interest. Example: complaint

filter[is_anonymous]   boolean  optional    

Example: false

filter[open]   boolean  optional    

Faqat yakunlanmaganlar. Example: true

sort   string  optional    

created_at, status_changed_at, status, type yoki id; - teskari. Example: -created_at

per_page   integer  optional    

Example: 20

Bitta murojaat, tarixi bilan

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/appeals/564" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/appeals/564"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 39,
        "tracking_number": "2026/09-6775",
        "type": "application",
        "status": "received",
        "is_anonymous": false,
        "applicant_name": "Jermaine Tillman",
        "applicant_phone": "+998902631582",
        "applicant_email": "aschuster@example.com",
        "applicant_region": "Toshkent shahri",
        "subject": "Quo omnis nostrum aut.",
        "locale": "uz",
        "deadline_at": "2026-09-27T13:16:35+00:00",
        "is_overdue": false,
        "status_changed_at": "2026-09-12T13:16:35+00:00",
        "responded_at": null,
        "created_at": "2026-09-12T13:16:35+00:00",
        "body": "Nostrum qui commodi incidunt iure. Et et modi ipsum nostrum. Autem et consequatur aut dolores enim non facere tempora. Voluptatem laboriosam praesentium quis adipisci.",
        "response": null,
        "access_code": "DL5625",
        "ip": "11.196.14.107",
        "user_agent": null,
        "history": []
    }
}
 

Request      

GET api/v1/admin/appeals/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the appeal. Example: 564

Holatni o'zgartirish

requires authentication

Har bir o'zgarish tarixga yoziladi va fuqaro holat sahifasida ko'radi. answered uchun response shart.

Example request:
curl --request PATCH \
    "https://apiagrofin.okslab.uz/api/v1/admin/appeals/564/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"status\": \"in_review\",
    \"note\": \"Ariza mas\'ul bo\'limga yuborildi.\",
    \"response\": \"Kredit 2026 yil 1 sentabrdan ajratiladi.\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/appeals/564/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "status": "in_review",
    "note": "Ariza mas'ul bo'limga yuborildi.",
    "response": "Kredit 2026 yil 1 sentabrdan ajratiladi."
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 40,
        "tracking_number": "2026/09-4027",
        "type": "application",
        "status": "received",
        "is_anonymous": false,
        "applicant_name": "Mr. Gerhard Dach Jr.",
        "applicant_phone": "+998906980841",
        "applicant_email": "cecil42@example.com",
        "applicant_region": "Toshkent shahri",
        "subject": "Perspiciatis quo omnis nostrum aut adipisci.",
        "locale": "uz",
        "deadline_at": "2026-09-27T13:16:35+00:00",
        "is_overdue": false,
        "status_changed_at": "2026-09-12T13:16:35+00:00",
        "responded_at": null,
        "created_at": "2026-09-12T13:16:35+00:00",
        "body": "Qui commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.",
        "response": null,
        "access_code": "MI9365",
        "ip": "158.16.197.2",
        "user_agent": null,
        "history": []
    }
}
 

Request      

PATCH api/v1/admin/appeals/{id}/status

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the appeal. Example: 564

Body Parameters

status   string     

received, in_review, info_requested, answered, rejected. Example: in_review

note   string  optional    

Fuqaroga ko'rinadigan izoh. Example: Ariza mas'ul bo'limga yuborildi.

response   string  optional    

Yakuniy javob (answered uchun shart). Example: Kredit 2026 yil 1 sentabrdan ajratiladi.

Admin — raqamli yordamchi

Bilim bazasining qo'lda yoziladigan qismi

requires authentication

Bazada yozuv bo'lmasa yordamchi repodagi faylni ishlatadi — muharrir ham aynan shu matnni ko'rsatadi, aks holda xodim bo'sh maydondan boshlab mavjud bilimni yo'qotib qo'yardi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/assistant/knowledge" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/knowledge"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Success",
    "data": {
        "content": "## Manzil...",
        "updated_at": null,
        "source": "file"
    },
    "errors": null,
    "meta": null
}
 

Request      

GET api/v1/admin/assistant/knowledge

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Bilim bazasini yangilash

requires authentication

Example request:
curl --request PUT \
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/knowledge" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"content\": \"## Manzil...\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/knowledge"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "content": "## Manzil..."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/admin/assistant/knowledge

PATCH api/v1/admin/assistant/knowledge

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

content   string     

Markdown matn. Example: ## Manzil...

Suhbatlar ro'yxati

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions?filter%5Bsearch%5D=Xusan&filter%5Bdevice_id%5D=dev-3f&filter%5Blocale%5D=uz&filter%5Bwith_phone%5D=1&filter%5Bhuman_takeover%5D=1&sort=-last_seen_at&per_page=20" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions"
);

const params = {
    "filter[search]": "Xusan",
    "filter[device_id]": "dev-3f",
    "filter[locale]": "uz",
    "filter[with_phone]": "1",
    "filter[human_takeover]": "1",
    "sort": "-last_seen_at",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 204,
            "device_id": "dev-gz37449171",
            "ip": "156.179.93.117",
            "locale": "uz",
            "name": null,
            "phone": null,
            "human_takeover": false,
            "messages_count": 0,
            "daily_count": 0,
            "last_seen_at": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        },
        {
            "id": 205,
            "device_id": "dev-vd73089432",
            "ip": "197.200.161.23",
            "locale": "uz",
            "name": null,
            "phone": null,
            "human_takeover": false,
            "messages_count": 0,
            "daily_count": 0,
            "last_seen_at": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        }
    ]
}
 

Request      

GET api/v1/admin/assistant/sessions

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[search]   string  optional    

Qurilma, ism yoki telefon bo'yicha qidiruv. Example: Xusan

filter[device_id]   string  optional    

Qurilma belgisi bo'yicha qisman qidiruv. Example: dev-3f

filter[locale]   string  optional    

uz, ru yoki uz_cyrl. Example: uz

filter[with_phone]   boolean  optional    

Faqat telefon qoldirganlar. Example: true

filter[human_takeover]   boolean  optional    

Faqat xodim qo'lidagi suhbatlar. Example: true

sort   string  optional    

last_seen_at, messages_count yoki id; oldiga - qo'yilsa teskari. Example: -last_seen_at

per_page   integer  optional    

Example: 20

Bitta suhbat, xabarlari bilan

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 206,
        "device_id": "dev-jn96548529",
        "ip": "51.210.32.30",
        "locale": "uz",
        "name": null,
        "phone": null,
        "human_takeover": false,
        "messages_count": 0,
        "daily_count": 0,
        "last_seen_at": null,
        "created_at": "2026-09-12T13:16:35+00:00"
    }
}
 

Request      

GET api/v1/admin/assistant/sessions/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the session. Example: 564

Suhbatni xabarlari bilan o'chirish

requires authentication

Example request:
curl --request DELETE \
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/admin/assistant/sessions/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the session. Example: 564

Xodim javobi

requires authentication

Xabar operator rolida saqlanadi, suhbat xodim qo'liga o'tadi (yordamchi jim turadi).

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564/messages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"content\": \"Hujjatlaringizni qabulxonaga olib keling.\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564/messages"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "content": "Hujjatlaringizni qabulxonaga olib keling."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "status": "ok",
    "message": "Success",
    "data": {
        "id": 12,
        "role": "operator",
        "content": "...",
        "generator": null,
        "source": null,
        "created_at": "2026-09-11T12:00:00+00:00",
        "human_takeover": true
    },
    "errors": null,
    "meta": null
}
 

Request      

POST api/v1/admin/assistant/sessions/{id}/messages

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the session. Example: 564

Body Parameters

content   string     

Javob matni. Example: Hujjatlaringizni qabulxonaga olib keling.

Suhbatni yordamchiga qaytarish

requires authentication

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564/release" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/assistant/sessions/564/release"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Success",
    "data": {
        "human_takeover": false
    },
    "errors": null,
    "meta": null
}
 

Request      

POST api/v1/admin/assistant/sessions/{id}/release

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the session. Example: 564

Endpoints

POST api/v1/login

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "gbailey@example.net",
    "password": "|]|{+-"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 102,
        "name": "Mrs. Justina Gaylord",
        "email": "lafayette.considine@example.com",
        "created_at": "2026-09-12 13:16:36",
        "updated_at": "2026-09-12 13:16:36"
    }
}
 

Request      

POST api/v1/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

validation.email. Example: gbailey@example.net

password   string     

Example: |]|{+-

Revoke the current access token.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/user

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 103,
        "name": "Mr. Adriel Romaguera",
        "email": "antonio24@example.net",
        "created_at": "2026-09-12 13:16:36",
        "updated_at": "2026-09-12 13:16:36"
    }
}
 

Request      

GET api/v1/user

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/user/{id}

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/user/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/user/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 104,
        "name": "Pearl Hauck Sr.",
        "email": "alayna44@example.org",
        "created_at": "2026-09-12 13:16:36",
        "updated_at": "2026-09-12 13:16:36"
    }
}
 

Request      

GET api/v1/user/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the user. Example: 1

PUT api/v1/user

Example request:
curl --request PUT \
    "https://apiagrofin.okslab.uz/api/v1/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"email\": \"zbailey@example.net\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "b",
    "email": "zbailey@example.net",
    "password": "|]|{+-"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 105,
        "name": "Mrs. Justina Gaylord",
        "email": "cormier.nick@example.com",
        "created_at": "2026-09-12 13:16:36",
        "updated_at": "2026-09-12 13:16:36"
    }
}
 

Request      

PUT api/v1/user

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

validation.max. Example: b

email   string  optional    

validation.email validation.max. Example: zbailey@example.net

password   string  optional    

Example: |]|{+-

DELETE api/v1/user

Example request:
curl --request DELETE \
    "https://apiagrofin.okslab.uz/api/v1/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/user

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Fuqarolar qabuli

Qabul jadvali

Shanba, yakshanba va bayram kunlari qabul o'tkazilmaydi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/reception-slots" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/reception-slots"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 52,
            "full_name": "Miss Aliya Ortiz IV",
            "position": "Weapons Specialists",
            "address": "97967 Tobin Highway\nKendraburgh, FL 96823",
            "weekday": "wednesday",
            "starts_at": "10:00",
            "ends_at": "12:00",
            "phone": null
        },
        {
            "id": 53,
            "full_name": "Cassidy Strosin",
            "position": "Buffing and Polishing Operator",
            "address": "58399 Terrill Plaza Apt. 887\nPort Percyside, NY 96046",
            "weekday": "thursday",
            "starts_at": "10:00",
            "ends_at": "12:00",
            "phone": null
        }
    ]
}
 

Request      

GET api/v1/reception-slots

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Moliyalashtirish dasturlari

Dasturlar ro'yxati

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/programs?filter%5Bsector%5D=cotton&filter%5Bkind%5D=credit&filter%5Bsearch%5D=paxta&per_page=20" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/programs"
);

const params = {
    "filter[sector]": "cotton",
    "filter[kind]": "credit",
    "filter[search]": "paxta",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 129,
            "slug": "fugiat-sunt-nihil",
            "sector": "cotton",
            "kind": "credit",
            "title": "Mollitia modi deserunt aut ab provident perspiciatis quo.",
            "summary": "Aut adipisci quidem nostrum qui commodi incidunt iure. Et et modi ipsum nostrum. Autem et consequatur aut dolores enim non facere tempora.",
            "body": null,
            "required_documents": null
        },
        {
            "id": 130,
            "slug": "voluptatem-laboriosam-praesentium",
            "sector": "cotton",
            "kind": "credit",
            "title": "Molestias fugit deleniti distinctio eum doloremque id.",
            "summary": "Aliquam veniam corporis dolorem mollitia deleniti nemo. Quia officia est dignissimos neque. Odio veritatis excepturi doloribus delectus fugit qui repudiandae. Est alias tenetur ratione.",
            "body": null,
            "required_documents": null
        }
    ]
}
 

Request      

GET api/v1/programs

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[sector]   string  optional    

Yo'nalish. Example: cotton

filter[kind]   string  optional    

Turi: credit, leasing, subsidy. Example: credit

filter[search]   string  optional    

Sarlavha bo'yicha qidiruv. Example: paxta

per_page   integer  optional    

Sahifadagi yozuvlar soni (eng ko'pi 100). Example: 20

Sizga mos moliyalashtirishni toping

Uchta savolga javob asosida mos dasturlarni qaytaradi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/programs/match?borrower_type=farmer%2Cseed_farm&sector=cotton%2Cwheat&kind=credit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"borrower_type\": \"b\",
    \"sector\": \"n\",
    \"kind\": \"architecto\",
    \"borrower_types\": [
        \"architecto\"
    ],
    \"sectors\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/programs/match"
);

const params = {
    "borrower_type": "farmer,seed_farm",
    "sector": "cotton,wheat",
    "kind": "credit",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "borrower_type": "b",
    "sector": "n",
    "kind": "architecto",
    "borrower_types": [
        "architecto"
    ],
    "sectors": [
        "architecto"
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 131,
            "slug": "et-animi-quos",
            "sector": "commodity_wheat",
            "kind": "credit",
            "title": "Fugiat sunt nihil accusantium harum mollitia.",
            "summary": "Aut ab provident perspiciatis quo omnis nostrum aut. Quidem nostrum qui commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.",
            "body": null,
            "required_documents": null
        },
        {
            "id": 132,
            "slug": "adipisci-molestias-fugit-deleniti",
            "sector": "oilseed",
            "kind": "credit",
            "title": "Doloremque id aut libero aliquam veniam corporis.",
            "summary": "Deleniti nemo odit quia officia. Dignissimos neque blanditiis odio. Excepturi doloribus delectus fugit qui repudiandae laboriosam.",
            "body": null,
            "required_documents": null
        }
    ]
}
 

Request      

GET api/v1/programs/match

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

borrower_type   string  optional    

Qarz oluvchi turi yoki vergul bilan bir nechtasi. Example: farmer,seed_farm

sector   string  optional    

Yo'nalish yoki vergul bilan bir nechtasi. Example: cotton,wheat

kind   string  optional    

Turi: credit, leasing, subsidy. Example: credit

Body Parameters

borrower_type   string  optional    

validation.max. Example: b

sector   string  optional    

validation.max. Example: n

kind   string  optional    

Example: architecto

Must be one of:
  • credit
  • leasing
  • subsidy
borrower_types   string[]  optional    
Must be one of:
  • farmer
  • seed_farm
  • cluster
  • textile_enterprise
  • grain_receiver
  • leasing_organization
  • entrepreneur
sectors   string[]  optional    
Must be one of:
  • cotton
  • wheat
  • seed_wheat
  • commodity_wheat
  • machinery
  • fruit
  • potato
  • greenhouse
  • oilseed
  • livestock
  • fishery

Bitta dastur

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/programs/paxta-yetishtirish" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/programs/paxta-yetishtirish"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 133,
        "slug": "et-fugiat-sunt",
        "sector": "commodity_wheat",
        "kind": "credit",
        "title": "Harum mollitia modi deserunt aut ab provident perspiciatis quo.",
        "summary": "Aut adipisci quidem nostrum qui commodi incidunt iure. Et et modi ipsum nostrum. Autem et consequatur aut dolores enim non facere tempora.",
        "body": null,
        "required_documents": null
    }
}
 

Request      

GET api/v1/programs/{slug}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

slug   string     

Dastur manzili. Example: paxta-yetishtirish

Murojaatlar

Elektron qabulxona: murojaat yuborish va uning holatini raqam + kirish kodi bo'yicha tekshirish. Ro'yxatdan o'tish talab qilinmaydi.

Murojaat yuborish

Javobda tracking_number va access_code qaytadi — ikkalasi holatni tekshirish uchun kerak. Anonim yuborish faqat corruption va conflict_of_interest turlarida mumkin.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/appeals" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"application\",
    \"is_anonymous\": false,
    \"applicant_name\": \"Alisher Karimov\",
    \"applicant_phone\": \"+998901234567\",
    \"applicant_email\": \"alisher@example.com\",
    \"applicant_region\": \"Farg\'ona viloyati\",
    \"subject\": \"Bug\'doy krediti bo\'yicha savol\",
    \"body\": \"2026 yil hosili uchun kredit ajratish muddati qachon boshlanadi?\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/appeals"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "application",
    "is_anonymous": false,
    "applicant_name": "Alisher Karimov",
    "applicant_phone": "+998901234567",
    "applicant_email": "alisher@example.com",
    "applicant_region": "Farg'ona viloyati",
    "subject": "Bug'doy krediti bo'yicha savol",
    "body": "2026 yil hosili uchun kredit ajratish muddati qachon boshlanadi?"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "status": "ok",
    "message": "Murojaatingiz qabul qilindi.",
    "data": {
        "tracking_number": "2026/09-0001",
        "access_code": "K7M4QP",
        "status": "received",
        "deadline_at": "2026-09-27T10:00:00+00:00",
        "created_at": "2026-09-12T10:00:00+00:00"
    },
    "errors": null,
    "meta": null
}
 

Request      

POST api/v1/appeals

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

type   string     

application, complaint, proposal, corruption yoki conflict_of_interest. Example: application

is_anonymous   boolean  optional    

Faqat korrupsiya kanalida. Example: false

applicant_name   string  optional    

Anonim bo'lmasa shart. Example: Alisher Karimov

applicant_phone   string  optional    

Anonim bo'lmasa shart. Example: +998901234567

applicant_email   string  optional    

Example: alisher@example.com

applicant_region   string  optional    

Example: Farg'ona viloyati

subject   string     

5–200 belgi. Example: Bug'doy krediti bo'yicha savol

body   string     

20–5000 belgi. Example: 2026 yil hosili uchun kredit ajratish muddati qachon boshlanadi?

website   string  optional    

Murojaat holatini tekshirish

POST, chunki kirish kodi URL va server jurnallariga tushmasligi kerak.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/appeals/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tracking_number\": \"2026\\/09-0001\",
    \"access_code\": \"K7M4QP\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/appeals/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tracking_number": "2026\/09-0001",
    "access_code": "K7M4QP"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "tracking_number": "2026/09-7195",
        "type": "application",
        "subject": "Nostrum omnis autem et.",
        "body": "Dolores enim non facere tempora. Voluptatem laboriosam praesentium quis adipisci. Fugit deleniti distinctio eum doloremque id aut libero. Veniam corporis dolorem mollitia.",
        "status": "received",
        "is_final": false,
        "response": null,
        "responded_at": null,
        "deadline_at": "2026-09-27T13:16:35+00:00",
        "is_overdue": false,
        "created_at": "2026-09-12T13:16:35+00:00",
        "history": []
    }
}
 

Example response (404):


{
    "status": "error",
    "message": "Murojaat topilmadi. Raqam va kirish kodini tekshiring.",
    "data": [],
    "errors": {
        "error": "Murojaat topilmadi. Raqam va kirish kodini tekshiring."
    },
    "meta": null
}
 

Request      

POST api/v1/appeals/status

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

tracking_number   string     

Example: 2026/09-0001

access_code   string     

Example: K7M4QP

Normativ hujjatlar

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/legal-documents?filter%5Bdoc_type%5D=cabinet_resolution&filter%5Brelevance%5D=direct_primary&filter%5Bstate%5D=in_force&filter%5Byear%5D=2023&filter%5Bdirection%5D=Paxtachilik&filter%5Bsearch%5D=680&sort=-adopted_on&per_page=20" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/legal-documents"
);

const params = {
    "filter[doc_type]": "cabinet_resolution",
    "filter[relevance]": "direct_primary",
    "filter[state]": "in_force",
    "filter[year]": "2023",
    "filter[direction]": "Paxtachilik",
    "filter[search]": "680",
    "sort": "-adopted_on",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 141,
            "doc_type": "presidential_resolution",
            "number": "690",
            "adopted_on": "2021-09-23",
            "title": "Quis adipisci molestias fugit deleniti distinctio eum.",
            "direction": "doloremque id aut",
            "relevance": "direct",
            "state": "in_force",
            "external_url": null
        },
        {
            "id": 142,
            "doc_type": "ministry_order",
            "number": "3374",
            "adopted_on": "2026-08-23",
            "title": "Mollitia deleniti nemo odit quia officia.",
            "direction": "est dignissimos neque",
            "relevance": "related",
            "state": "in_force",
            "external_url": null
        }
    ]
}
 

Qonunchilikka eng yaqinda o'zgartirish kiritilgan hujjatlar.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/legal-documents/changes" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/legal-documents/changes"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 143,
            "doc_type": "presidential_resolution",
            "number": "1789",
            "adopted_on": "2024-09-17",
            "title": "Delectus fugit qui repudiandae laboriosam.",
            "direction": "est alias tenetur",
            "relevance": "direct_primary",
            "state": "in_force",
            "external_url": null
        },
        {
            "id": 144,
            "doc_type": "charter",
            "number": "1104",
            "adopted_on": "2021-04-19",
            "title": "Et recusandae modi rerum ex repellendus assumenda et.",
            "direction": "tenetur ab reiciendis",
            "relevance": "direct_primary",
            "state": "in_force",
            "external_url": null
        }
    ]
}
 

Faol hujjatlarda uchraydigan yo'nalish yorliqlari (joriy tilda) — saytdagi filtr uchun.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/legal-documents/directions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/legal-documents/directions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Success",
    "data": [
        "Chorvachilik",
        "Lizing",
        "Paxtachilik"
    ],
    "errors": null,
    "meta": null
}
 

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/legal-documents/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/legal-documents/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 145,
        "doc_type": "presidential_decree",
        "number": "9925",
        "adopted_on": "2024-11-16",
        "title": "Accusantium harum mollitia modi deserunt aut ab.",
        "direction": "provident perspiciatis quo",
        "relevance": "direct_primary",
        "state": "in_force",
        "external_url": null,
        "content": null,
        "files": []
    }
}
 

Qidiruv

Sayt bo'ylab yagona qidiruv: normativ hujjatlar (nomi, yo'nalishi va raqami), moliyalashtirish dasturlari, savol-javoblar (savol va javob) va yangiliklar. Atama har ikki o'zbek yozuvida va barcha tillarda izlanadi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/search?q=paxta&limit=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"b\",
    \"limit\": 12
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/search"
);

const params = {
    "q": "paxta",
    "limit": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "b",
    "limit": 12
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Success",
    "data": {
        "query": "paxta",
        "total": 7,
        "groups": [
            {
                "kind": "legal_documents",
                "count": 2,
                "items": [
                    {
                        "id": 3,
                        "doc_type": "cabinet_resolution",
                        "number": "680",
                        "adopted_on": "2023-12-25",
                        "title": "Paxta xom ashyosini yetishtirishni kreditlash tartibi",
                        "direction": "Paxtachilik",
                        "relevance": "direct_primary",
                        "state": "in_force",
                        "external_url": null,
                        "revisions_count": 0
                    }
                ]
            },
            {
                "kind": "programs",
                "count": 1,
                "items": [
                    {
                        "id": 1,
                        "slug": "paxta-krediti",
                        "sector": "cotton",
                        "kind": "credit",
                        "title": "Paxta yetishtirish krediti",
                        "summary": "...",
                        "body": null,
                        "required_documents": null
                    }
                ]
            },
            {
                "kind": "faqs",
                "count": 3,
                "items": [
                    {
                        "id": 12,
                        "question": "Paxta uchun kredit qancha?",
                        "answer": "...",
                        "category": {
                            "id": 1,
                            "slug": "kredit",
                            "title": "Kreditlar"
                        }
                    }
                ]
            },
            {
                "kind": "posts",
                "count": 1,
                "items": [
                    {
                        "id": 210,
                        "slug": "paxta-hosili",
                        "title": "Paxta hosili",
                        "intro": "...",
                        "published_at": "2026-09-01T10:00:00+00:00",
                        "is_featured": false,
                        "cover_url": null,
                        "is_machine_translated": false,
                        "view_count": 0,
                        "categories": []
                    }
                ]
            }
        ]
    },
    "errors": null,
    "meta": null
}
 

Raqamli yordamchi

Savol berish

Javob faqat Jamg'armaning tasdiqlangan bilim bazasidan olinadi. Bazada javob bo'lmasa, yordamchi buni ochiq aytadi va ishonch telefonini ko'rsatadi — o'ylab topilgan javob bermaydi.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/assistant/ask" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"device_id\": \"dev-3f8a2b91c4\",
    \"question\": \"Paxta uchun kredit qanday shartlarda beriladi?\",
    \"name\": \"Xusan\"
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/assistant/ask"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "device_id": "dev-3f8a2b91c4",
    "question": "Paxta uchun kredit qanday shartlarda beriladi?",
    "name": "Xusan"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "ok",
    "message": "Operation completed successfully.",
    "data": {
        "answer": "...",
        "source": "680 — ...",
        "legal_document_id": null,
        "generator": "gemini",
        "confident": true,
        "name": "Xusan",
        "card": null,
        "human_takeover": false
    },
    "errors": null,
    "meta": null
}
 

Example response (429):


{
    "status": "error",
    "message": "Kunlik xabar limiti (100) tugadi. Iltimos, ertaga qayta urinib ko‘ring yoki ishonch telefoniga murojaat qiling: +998 71 231-02-17.",
    "data": [],
    "errors": null,
    "meta": null
}
 

Request      

POST api/v1/assistant/ask

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

device_id   string     

Brauzer yaratgan qurilma belgisi. Example: dev-3f8a2b91c4

question   string     

Xabar matni (500 belgigacha). Example: Paxta uchun kredit qanday shartlarda beriladi?

name   string  optional    

Foydalanuvchi ismi — yordamchi so'raganida widget yuboradi. Example: Xusan

Suhbat tarixi

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/assistant/history/dev-3f8a2b91c4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/assistant/history/dev-3f8a2b91c4"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 460,
            "role": "user",
            "content": "Et animi quos velit et fugiat.",
            "source": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        },
        {
            "id": 461,
            "role": "user",
            "content": "Deserunt aut ab provident perspiciatis quo omnis nostrum.",
            "source": null,
            "created_at": "2026-09-12T13:16:35+00:00"
        }
    ]
}
 

Request      

GET api/v1/assistant/history/{deviceId}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

deviceId   string     

Qurilma belgisi. Example: dev-3f8a2b91c4

Savol-javoblar

Savol-javoblar

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/faqs?filter%5Bfaq_category_id%5D=1&filter%5Bprogram_id%5D=1&filter%5Bsearch%5D=subsidiya&per_page=50" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/faqs"
);

const params = {
    "filter[faq_category_id]": "1",
    "filter[program_id]": "1",
    "filter[search]": "subsidiya",
    "per_page": "50",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 199,
            "question": "Aut adipisci quidem nostrum qui commodi incidunt iure.?",
            "answer": "Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora. Voluptatem laboriosam praesentium quis adipisci."
        },
        {
            "id": 200,
            "question": "Aut libero aliquam veniam corporis.?",
            "answer": "Deleniti nemo odit quia officia. Dignissimos neque blanditiis odio. Excepturi doloribus delectus fugit qui repudiandae laboriosam."
        }
    ]
}
 

Request      

GET api/v1/faqs

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[faq_category_id]   integer  optional    

Kategoriya. Example: 1

filter[program_id]   integer  optional    

Dastur. Example: 1

filter[search]   string  optional    

Savol matni bo'yicha qidiruv. Example: subsidiya

per_page   integer  optional    

Sahifadagi yozuvlar soni (eng ko'pi 100). Example: 50

Savol-javob kategoriyalari

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/faq-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/faq-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 105,
            "slug": "ut-et-recusandae",
            "title": "modi rerum"
        },
        {
            "id": 106,
            "slug": "repellendus-assumenda",
            "title": "et tenetur"
        }
    ]
}
 

Request      

GET api/v1/faq-categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Tashkiliy tuzilma

Tashkiliy tuzilma

Organogramma uchun daraxt ko'rinishida: ildizlar va ularning bo'linmalari.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/staff-units" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/staff-units"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 63,
            "name": "sed sint sed",
            "head_name": "Hans Hackett",
            "duties": null,
            "phone": null,
            "email": null
        },
        {
            "id": 64,
            "name": "est ut enim",
            "head_name": "Gerda O'Conner",
            "duties": null,
            "phone": null,
            "email": null
        }
    ]
}
 

Request      

GET api/v1/staff-units

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Yangiliklar

Yangiliklar ro'yxati

Faqat chop etilgan va so'ralgan tilda mavjud maqolalar qaytadi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/posts?filter%5Bcategory%5D=tenderlar&filter%5Bsearch%5D=paxta&filter%5Byear%5D=2026&filter%5Bis_featured%5D=1&sort=-published_at&per_page=12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/posts"
);

const params = {
    "filter[category]": "tenderlar",
    "filter[search]": "paxta",
    "filter[year]": "2026",
    "filter[is_featured]": "1",
    "sort": "-published_at",
    "per_page": "12",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 593,
            "slug": "fuga-sint-quam-maxime",
            "title": "Fuga sint quam maxime.",
            "intro": "Maxime neque similique animi maxime aut.",
            "published_at": "2025-06-17T19:05:22+00:00",
            "is_featured": false,
            "cover_url": null,
            "is_machine_translated": false,
            "view_count": 0
        },
        {
            "id": 594,
            "slug": "sequi-architecto-sed",
            "title": "Sequi architecto sed.",
            "intro": "Qui aliquid minus tenetur cum quia ut odit dolor.",
            "published_at": "2025-05-19T11:25:21+00:00",
            "is_featured": false,
            "cover_url": null,
            "is_machine_translated": false,
            "view_count": 0
        }
    ]
}
 

Request      

GET api/v1/posts

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[category]   string  optional    

Kategoriya slug'i. Example: tenderlar

filter[search]   string  optional    

Sarlavha bo'yicha qidiruv. Example: paxta

filter[year]   integer  optional    

Chop etilgan yil. Example: 2026

filter[is_featured]   integer  optional    

Faqat asosiy yangiliklar. Example: 1

sort   string  optional    

Tartib: published_at, id (oldiga «-» teskari). Example: -published_at

per_page   integer  optional    

Sahifadagi yozuvlar soni (eng ko'pi 100). Example: 12

Yangilik kategoriyalari

Faol kategoriyalar, har birida joriy tildagi chop etilgan maqolalar soni bilan.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/news-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/news-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 89,
            "slug": "repellat-dolorem-dicta",
            "title": "architecto expedita",
            "parent_id": null
        },
        {
            "id": 90,
            "slug": "accusantium-minima-commodi",
            "title": "consequuntur nobis",
            "parent_id": null
        }
    ]
}
 

Request      

GET api/v1/news-categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Bitta maqola

Maqola matni, kategoriyalari va uchta o'xshash maqola bilan qaytadi. Har chaqiriqda ko'rishlar soni bittaga oshadi.

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/posts/paxta-2026" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/posts/paxta-2026"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 595,
        "slug": "et-animi-quos-velit",
        "title": "Et animi quos velit.",
        "intro": "Sunt nihil accusantium harum mollitia.",
        "published_at": "2025-07-23T22:33:12+00:00",
        "is_featured": false,
        "cover_url": null,
        "is_machine_translated": false,
        "view_count": 0,
        "content": "<p>Aut ab provident perspiciatis quo omnis nostrum aut. Quidem nostrum qui commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.</p>",
        "related": []
    }
}
 

Request      

GET api/v1/posts/{slug}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

slug   string     

Maqola manzil qismi. Example: paxta-2026

Yangiliklar — boshqaruv

Maqolalar ro'yxati (barcha holatlar)

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/posts?filter%5Bpublication_status%5D=draft&filter%5Bcategory%5D=tenderlar&filter%5Bsearch%5D=paxta&filter%5Byear%5D=2026&sort=-id&per_page=20" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts"
);

const params = {
    "filter[publication_status]": "draft",
    "filter[category]": "tenderlar",
    "filter[search]": "paxta",
    "filter[year]": "2026",
    "sort": "-id",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 596,
            "slug": "voluptatem-laboriosam-praesentium",
            "publication_status": "published",
            "published_at": "2025-04-30T17:39:35+00:00",
            "title": {
                "uz": "Voluptatem laboriosam praesentium."
            },
            "intro": {
                "uz": "Molestias fugit deleniti distinctio eum doloremque id."
            },
            "content": {
                "uz": "<p>Aliquam veniam corporis dolorem mollitia deleniti nemo. Quia officia est dignissimos neque. Odio veritatis excepturi doloribus delectus fugit qui repudiandae. Est alias tenetur ratione.</p>"
            },
            "is_featured": false,
            "cover_url": null,
            "generated_locales": [],
            "legacy_slugs": null,
            "view_count": 0,
            "created_at": "2026-09-12T13:16:35+00:00",
            "updated_at": "2026-09-12T13:16:35+00:00"
        },
        {
            "id": 597,
            "slug": "voluptate-accusamus-ut-et",
            "publication_status": "published",
            "published_at": "2026-06-07T18:24:25+00:00",
            "title": {
                "uz": "Voluptate accusamus ut et."
            },
            "intro": {
                "uz": "Rerum ex repellendus assumenda et."
            },
            "content": {
                "uz": "<p>Reiciendis quia perspiciatis deserunt ducimus corrupti et. Quia maiores assumenda odit. Repellat officiis corporis nesciunt ut. Iure impedit molestiae ut rem est esse sint.</p>"
            },
            "is_featured": false,
            "cover_url": null,
            "generated_locales": [],
            "legacy_slugs": null,
            "view_count": 0,
            "created_at": "2026-09-12T13:16:35+00:00",
            "updated_at": "2026-09-12T13:16:35+00:00"
        }
    ]
}
 

Request      

GET api/v1/admin/posts

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[publication_status]   string  optional    

draft, published yoki archived. Example: draft

filter[category]   string  optional    

Kategoriya slug'i. Example: tenderlar

filter[search]   string  optional    

Sarlavha bo'yicha qidiruv. Example: paxta

filter[year]   integer  optional    

Chop etilgan yil. Example: 2026

sort   string  optional    

Tartib: published_at, id. Example: -id

per_page   integer  optional    

Sahifadagi yozuvlar soni (eng ko'pi 100). Example: 20

Yangi maqola

requires authentication

slug bo'sh qoldirilsa sarlavhadan hosil qilinadi. content HTML'i saqlashdan oldin tozalanadi; intro bo'sh bo'lsa matndan chiqariladi.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/posts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"b\",
    \"publication_status\": \"draft\",
    \"published_at\": \"2026-09-12T13:16:35\",
    \"title\": [],
    \"is_featured\": false,
    \"category_ids\": [
        16
    ]
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "b",
    "publication_status": "draft",
    "published_at": "2026-09-12T13:16:35",
    "title": [],
    "is_featured": false,
    "category_ids": [
        16
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 598,
        "slug": "fugiat-sunt-nihil-accusantium",
        "publication_status": "published",
        "published_at": "2026-03-12T18:10:30+00:00",
        "title": {
            "uz": "Fugiat sunt nihil accusantium."
        },
        "intro": {
            "uz": "Modi deserunt aut ab provident perspiciatis."
        },
        "content": {
            "uz": "<p>Nostrum aut adipisci quidem nostrum. Commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.</p>"
        },
        "is_featured": false,
        "cover_url": null,
        "generated_locales": [],
        "legacy_slugs": null,
        "view_count": 0,
        "created_at": "2026-09-12T13:16:35+00:00",
        "updated_at": "2026-09-12T13:16:35+00:00"
    }
}
 

Request      

POST api/v1/admin/posts

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

slug   string  optional    

Must match the regex /^[a-z0-9]+(?:-[a-z0-9]+)*$/. validation.max. Example: b

publication_status   string     

Example: draft

Must be one of:
  • draft
  • published
  • archived
published_at   string  optional    

validation.date. Example: 2026-09-12T13:16:35

title   object     
intro   object  optional    
content   object  optional    
is_featured   boolean  optional    

Example: false

category_ids   integer[]  optional    

Must match an existing stored value.

Bitta maqola — tahrirlash uchun, barcha tillari bilan

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/posts/220" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 599,
        "slug": "adipisci-molestias-fugit-deleniti-distinctio-eum",
        "publication_status": "published",
        "published_at": "2024-01-31T09:40:33+00:00",
        "title": {
            "uz": "Adipisci molestias fugit deleniti distinctio eum."
        },
        "intro": {
            "uz": "Aut libero aliquam veniam corporis."
        },
        "content": {
            "uz": "<p>Deleniti nemo odit quia officia. Dignissimos neque blanditiis odio. Excepturi doloribus delectus fugit qui repudiandae laboriosam.</p>"
        },
        "is_featured": false,
        "cover_url": null,
        "generated_locales": [],
        "legacy_slugs": null,
        "view_count": 0,
        "created_at": "2026-09-12T13:16:35+00:00",
        "updated_at": "2026-09-12T13:16:35+00:00"
    }
}
 

Request      

GET api/v1/admin/posts/{post_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

post_id   integer     

The ID of the post. Example: 220

post   integer     

Maqola raqami. Example: 1

Maqolani tahrirlash

requires authentication

Muharrir matnini tuzatgan til generated_locales ro'yxatidan chiqadi — ya'ni «avtomatik o'girilgan» yorlig'i o'chadi.

Example request:
curl --request PUT \
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"b\",
    \"publication_status\": \"archived\",
    \"published_at\": \"2026-09-12T13:16:35\",
    \"is_featured\": true,
    \"category_ids\": [
        16
    ]
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "b",
    "publication_status": "archived",
    "published_at": "2026-09-12T13:16:35",
    "is_featured": true,
    "category_ids": [
        16
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 600,
        "slug": "mollitia-modi-deserunt-aut-ab",
        "publication_status": "published",
        "published_at": "2024-04-22T07:22:16+00:00",
        "title": {
            "uz": "Mollitia modi deserunt aut ab."
        },
        "intro": {
            "uz": "Quo omnis nostrum aut adipisci."
        },
        "content": {
            "uz": "<p>Qui commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.</p>"
        },
        "is_featured": false,
        "cover_url": null,
        "generated_locales": [],
        "legacy_slugs": null,
        "view_count": 0,
        "created_at": "2026-09-12T13:16:35+00:00",
        "updated_at": "2026-09-12T13:16:35+00:00"
    }
}
 

Request      

PUT api/v1/admin/posts/{post_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

post_id   integer     

The ID of the post. Example: 220

post   integer     

Maqola raqami. Example: 1

Body Parameters

slug   string  optional    

Must match the regex /^[a-z0-9]+(?:-[a-z0-9]+)*$/. validation.max. Example: b

publication_status   string  optional    

Example: archived

Must be one of:
  • draft
  • published
  • archived
published_at   string  optional    

validation.date. Example: 2026-09-12T13:16:35

title   object  optional    
intro   object  optional    
content   object  optional    
is_featured   boolean  optional    

Example: true

category_ids   integer[]  optional    

Must match an existing stored value.

Maqolani o'chirish

requires authentication

Yumshoq o'chirish — yozuv bazada qoladi va qaytarib olinishi mumkin.

Example request:
curl --request DELETE \
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/admin/posts/{post_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

post_id   integer     

The ID of the post. Example: 220

post   integer     

Maqola raqami. Example: 1

Muqova rasmini yuklash

requires authentication

Kolleksiya bitta faylli — eski rasm avtomatik almashadi.

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220/cover" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "cover=@/tmp/phpCLFDIP" 
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220/cover"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('cover', document.querySelector('input[name="cover"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 601,
        "slug": "eius-et-animi-quos",
        "publication_status": "published",
        "published_at": "2025-12-26T19:12:12+00:00",
        "title": {
            "uz": "Eius et animi quos."
        },
        "intro": {
            "uz": "Fugiat sunt nihil accusantium harum mollitia."
        },
        "content": {
            "uz": "<p>Aut ab provident perspiciatis quo omnis nostrum aut. Quidem nostrum qui commodi incidunt iure odit. Et modi ipsum nostrum omnis autem et consequatur. Dolores enim non facere tempora.</p>"
        },
        "is_featured": false,
        "cover_url": null,
        "generated_locales": [],
        "legacy_slugs": null,
        "view_count": 0,
        "created_at": "2026-09-12T13:16:35+00:00",
        "updated_at": "2026-09-12T13:16:35+00:00"
    }
}
 

Request      

POST api/v1/admin/posts/{post_id}/cover

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

post_id   integer     

The ID of the post. Example: 220

post   integer     

Maqola raqami. Example: 1

Body Parameters

cover   file     

validation.image validation.max. Example: /tmp/phpCLFDIP

Muqova rasmini o'chirish

requires authentication

Example request:
curl --request DELETE \
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220/cover" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/posts/220/cover"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/admin/posts/{post_id}/cover

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

post_id   integer     

The ID of the post. Example: 220

post   integer     

Maqola raqami. Example: 1

Kategoriyalar ro'yxati (nofaollari bilan)

requires authentication

Example request:
curl --request GET \
    --get "https://apiagrofin.okslab.uz/api/v1/admin/news-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 91,
            "slug": "voluptatem-laboriosam",
            "title": {
                "uz": "praesentium quis"
            },
            "parent_id": null,
            "status": 1,
            "sort_order": 0
        },
        {
            "id": 92,
            "slug": "molestias-fugit-deleniti",
            "title": {
                "uz": "distinctio eum"
            },
            "parent_id": null,
            "status": 1,
            "sort_order": 0
        }
    ]
}
 

Request      

GET api/v1/admin/news-categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Yangi kategoriya

requires authentication

Example request:
curl --request POST \
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"b\",
    \"title\": [],
    \"parent_id\": 16,
    \"status\": 0,
    \"sort_order\": 22
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "b",
    "title": [],
    "parent_id": 16,
    "status": 0,
    "sort_order": 22
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/admin/news-categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

slug   string     

Must match the regex /^[a-z0-9]+(?:-[a-z0-9]+)*$/. validation.max. Example: b

title   object     
parent_id   integer  optional    

Must match an existing stored value. Example: 16

status   integer  optional    

Example: 0

Must be one of:
  • 1
  • 0
sort_order   integer  optional    

validation.min validation.max. Example: 22

Kategoriyani tahrirlash

requires authentication

Example request:
curl --request PUT \
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories/7" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"b\",
    \"parent_id\": 16,
    \"status\": 0,
    \"sort_order\": 22
}"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories/7"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "b",
    "parent_id": 16,
    "status": 0,
    "sort_order": 22
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/admin/news-categories/{newsCategory_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

newsCategory_id   integer     

The ID of the newsCategory. Example: 7

newsCategory   integer     

Kategoriya raqami. Example: 1

Body Parameters

slug   string  optional    

Must match the regex /^[a-z0-9]+(?:-[a-z0-9]+)*$/. validation.max. Example: b

title   object  optional    
parent_id   integer  optional    

Must match an existing stored value. Must not be one of . Example: 16

status   integer  optional    

Example: 0

Must be one of:
  • 1
  • 0
sort_order   integer  optional    

validation.min validation.max. Example: 22

Kategoriyani o'chirish

requires authentication

Maqolalari bor kategoriya o'chirilmaydi — avval maqolalar boshqa kategoriyaga ko'chirilishi kerak.

Example request:
curl --request DELETE \
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories/7" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiagrofin.okslab.uz/api/v1/admin/news-categories/7"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/admin/news-categories/{newsCategory_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

newsCategory_id   integer     

The ID of the newsCategory. Example: 7

newsCategory   integer     

Kategoriya raqami. Example: 1