# Why can't I access my API?

**URL:** <https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199>\
**Category:** General\
**Created:** [November 2, 2026, 3:30am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199 "2026-11-02T03:30:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 3:30am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/1 "2026-11-02T03:30:05Z")

</div>

`curl http://192.168.88.1:8728`

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 5:40am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/2 "2026-11-02T05:40:33Z")

</div>

... and why can't I see the contents of the folder???

`user@server:/# ls folder`  
🤔🤔🤔

**there is absolutely not enough information for any advice/help**...

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 7:06am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/3 "2026-11-02T07:06:53Z")

</div>

It’s not a folder. I cannot access the api using curl.

---

<div class="post-metadata">

**Author:** ![CGGXANNX](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/cggxannx/32/55490_2.png) [@CGGXANNX](https://forum.mikrotik.com/u/CGGXANNX)\
**Post date:** [November 2, 2026, 7:27am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/4 "2026-11-02T07:27:33Z")

</div>

It was an analogy. Read what @aldek wrote in bold.

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 7:28am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/5 "2026-11-02T07:28:18Z")

</div>

it is completely unclear in your question what you want to get from: `curl http://192.168.88.1:8728`  
and why did you decide that you don't have access to the API?

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 8:20am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/6 "2026-11-02T08:20:22Z")

</div>

192.168.88.1 is the router ip. I want to access it, but I can’t.

---

<div class="post-metadata">

**Author:** ![infabo](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/infabo/32/55692_2.png) [@infabo](https://forum.mikrotik.com/u/infabo)\
**Post date:** [November 2, 2026, 8:26am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/7 "2026-11-02T08:26:02Z")

</div>

Have you been able to connect to API before?

see also

> **[API | RouterOS Manual](https://manual.mikrotik.com/docs/developer-guides/api/)**
>
> The API page introduces RouterOS's Application Programming Interface for secure communication with routers, detailing syntax rules, sentence structure, encoding methods, and supported commands like login and cancel for configuration management.

---

<div class="post-metadata">

**Author:** ![patrikg](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/patrikg/32/1153_2.png) [@patrikg](https://forum.mikrotik.com/u/patrikg)\
**Post date:** [November 2, 2026, 8:27am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/8 "2026-11-02T08:27:47Z")

</div>

Or REST API

> **[REST API | RouterOS Manual](https://manual.mikrotik.com/docs/developer-guides/rest-api/)**
>
> RouterOS REST API: enable HTTPS access with a least-privilege user, read and change the configuration with GET, PUT, PATCH and DELETE, run any console command with POST, work within the 60-second limit and per-user sessions, and build scripts,...

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 8:30am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/9 "2026-11-02T08:30:01Z")

</div>

Please read this: [https://manual.mikrotik.com/docs/7.24/developer-guides/api/](https://manual.mikrotik.com/docs/7.24/developer-guides/api/)  
If you try to make `curl ``http://192.168.88.1:8728`, you will not get a webpage or JSON response.

The RouterOS API protocol is binary, not HTTP.

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 8:42am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/10 "2026-11-02T08:42:45Z")

</div>

> [@aldek](#):
>
> [API | RouterOS Manual](https://manual.mikrotik.com/docs/7.24/developer-guides/api/)

OK, but i can't access the api with Ansible using api\_modify, getting no route to host. Though can ping the IP.

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 9:00am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/11 "2026-11-02T09:00:01Z")

</div>

> [@aldek](#):
>
> **... not enough information ...**

Don’t keep me guessing...

- do you have the API service enabled
- do you have the correct settings in the firewall filters
- what is your network layout, or at least the section with involved devices/containes
- ....etc...

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 9:02am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/12 "2026-11-02T09:02:07Z")

</div>

> [@aldek](#):
>
> Don’t keep me guessing...
> 
> - do you have the API service enabled
> - do you have the correct settings in the firewall filters
> - what is your network layout, or at least the section with involved devices/containes
> - ....etc...

The API Service is enabled.  
I have enabled an accept service in the firewall for port 8728.  
I have a mac connected via LAN to the Router.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [November 2, 2026, 9:35am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/13 "2026-11-02T09:35:13Z")

</div>

Only `/export` speaks the truth; all the rest are just empty words.

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 9:41am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/14 "2026-11-02T09:41:43Z")

</div>

🤨 And I have to keep guessing.:

- Why did you write about `curl http://...`

- Is MAC an API client?

- Is Ansible installed probably on a MAC with which modules and what is the configuration/settings

Please provide more information if you want help rather than ignoring...

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 9:48am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/15 "2026-11-02T09:48:56Z")

</div>

[config\_backup.rsc](https://forum.mikrotik.com/uploads/short-url/ySEHfSuWPTR4MVlqlYbziUmC8jZ.rsc) (6.2 KB)

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 9:52am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/16 "2026-11-02T09:52:06Z")

</div>

I wanted to try a curl to the API to test it.

The Mac is a MacBook Pro.

Ansible responds the following:

```auto
TASK [mikrotik : Set hostname of MikroTik router] *******************************************************************************************************************
[ERROR]: Task failed: Module failed: Error while connecting: [Errno 65] No route to host
Origin: /Users/ronnyforberger/IdeaProjects/mikrotik_configuration/mikrotik/tasks/main.yml:5:3

3 ################
4
5 - name: Set hostname of MikroTik router
    ^ column 3

fatal: [192.168.88.1]: FAILED! => {"changed": false, "connection": {"hostname": "192.168.88.1", "port": 8728, "ssl": false, "status": "Error while connecting: [Errno 65] No route to host", "username": "admin"}, "msg": "Error while connecting: [Errno 65] No route to host"}

```

Playbook/Role:

```auto
- name: Set password for mikrotik router
  community.routeros.api_modify:
    hostname: "{{ inventory_hostname }}"
    username: "{{ username }}"
    password: "{{ ansible_password }}"
    path: user
    data:
      - name: admin
        password: "{{ routeros.new_password }}"
    handle_absent_entries: ignore
    handle_entries_content: ignore
  no_log: true

```

---

<div class="post-metadata">

**Author:** ![holvoetn](https://forum.mikrotik.com/letter_avatar/holvoetn/32/6_449c533f586939b6e5f246632a46421f.png) [@holvoetn](https://forum.mikrotik.com/u/holvoetn)\
**Post date:** [November 2, 2026, 9:58am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/17 "2026-11-02T09:58:12Z")

</div>

You might want to check the previous questions/remarks again and then have a close look at those firewall rules...

> [@ronnyforberger](#):
>
> I have enabled an accept service in the firewall for port 8728.

Where ?

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 10:27am UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/18 "2026-11-02T10:27:46Z")

</div>

in IP-\>Firewall. I enabled port 8728 tcp for the service api. I put it before the drop rules.

---

<div class="post-metadata">

**Author:** ![aldek](https://forum.mikrotik.com/letter_avatar/aldek/32/6_449c533f586939b6e5f246632a46421f.png) [@aldek](https://forum.mikrotik.com/u/aldek)\
**Post date:** [November 2, 2026, 12:02pm UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/19 "2026-11-02T12:02:00Z")

</div>

Check your MAC Privacy & Security for Local Network and allow terminal access to LAN.

---

<div class="post-metadata">

**Author:** ![ronnyforberger](https://forum.mikrotik.com/letter_avatar/ronnyforberger/32/6_449c533f586939b6e5f246632a46421f.png) [@ronnyforberger](https://forum.mikrotik.com/u/ronnyforberger)\
**Post date:** [November 2, 2026, 1:30pm UTC](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199/20 "2026-11-02T13:30:59Z")

</div>

yeah, but ssh works.

[Next page](https://forum.mikrotik.com/t/why-cant-i-access-my-api/274199.md?page=2)
