Strapi API Error {"data":null,"error":{"status":404,"name":"NotFoundError","message":"Not Found","details":{}}}

I’ve Strapi 4.

I’m getting error for API call

http://localhost:1337/api/customers/:1

{
    "data": null,
    "error": {
        "status": 404,
        "name": "NotFoundError",
        "message": "Not Found",
        "details": {}
    }
}

For customers the API works fine

http://localhost:1337/api/customers
{
    "data": [
        {
            "id": 1,
            "attributes": {
                "firstname": "John",
                "createdAt": "2023-11-18T21:30:47.920Z",
                "updatedAt": "2023-11-18T21:52:02.386Z",
                "publishedAt": "2023-11-18T21:31:46.731Z",
                "lastname": "Does"
            }
        },
        {
            "id": 2,
            "attributes": {
                "firstname": "Lilly",
                "createdAt": "2023-11-18T21:31:38.210Z",
                "updatedAt": "2023-11-18T21:52:17.782Z",
                "publishedAt": "2023-11-18T21:31:41.103Z",
                "lastname": "Filly"
            }
        }
    ],
    "meta": {
        "pagination": {
            "page": 1,
            "pageSize": 25,
            "pageCount": 1,
            "total": 2
        }
    }
}

I’ve set the roles on USERS & PERMISSIONS PLUGIN → Roles, see the screenshot below. Am I missing anything else? How to fix it?

Same here. I have exactly the same problem:
I allready checked the roles permissions ‘find’ and ‘findOne’ in public
& I definitly published both of my 2 collections.

Thanks for help.

Regards, noobee

Same issue on my both PC, it happens on version 5.0.2 as well

System Information
  • Strapi Version: 5.0.2 Community
  • Operating System: Windows 11 Enterprise Version 23H2 (OS Build 22631.4169)
  • Database: sqlite
  • Node Version: 18.20.4
  • NPM Version: 10.8.3
  • Yarn Version: –

I have the same issue on version 5.0.2

however, should it be

http://localhost:1337/api/customers/1

in your case?

1 Like

I have the same issue. as soon as you request 1 item from the collection type using id it returns

{
    "data": null,
    "error": {
        "status": 404,
        "name": "NotFoundError",
        "message": "Not Found",
        "details": {}
    }
}

Has there been a solution?