# API Endpoint Enumeration

> Discover hidden API endpoints via fuzzing, path traversal, JS analysis, and spec file leakage to map attack surface on HTTP/HTTPS services.

- **URL:** https://hackindex.io/index.php/services/web/enumeration/api-endpoint-enumeration
- **Path:** HTTP/HTTPS > Enumeration
- **Up:** [Enumeration](https://hackindex.io/index.php/services/web/enumeration.md)
- **Published:** 2026-03-28
- **Updated:** 2026-04-24

API endpoint enumeration maps the attack surface of REST APIs, GraphQL interfaces, and OpenAPI-documented services. APIs frequently have weaker input validation than frontend forms, expose more functionality than the UI presents, and often lack the same access control enforcement. Run this after [content discovery](https://hackindex.io/services/web/enumeration/content-discovery) confirms an API path exists, or when fingerprinting reveals a framework that typically exposes APIs.

## OpenAPI and Swagger Discovery

Many frameworks auto-generate API documentation at predictable paths. Check these before doing anything else:

```bash
for path in /api/docs /api/swagger /swagger /swagger-ui /swagger-ui.html /swagger.json /openapi.json /api/openapi.json /api/v1/docs /docs /redoc /api/redoc; do code=$(curl -skI http://$TARGET_IP:$PORT$path | grep HTTP | awk '{print $2}'); echo "$code $path"; done
# 404 /api/docs
# 200 /swagger-ui.html
# 200 /swagger.json
# 404 /openapi.json
```

A 200 on swagger.json or openapi.json gives you the complete API definition including all endpoints, parameters, authentication requirements, and data models. Download it and parse it for targets:

```bash
curl -sk http://$TARGET_IP:$PORT/swagger.json | python3 -m json.tool | grep -E '"/(api|v[0-9])'
# "/api/v1/users": {
# "/api/v1/users/{id}": {
# "/api/v1/admin/users": {
# "/api/v1/orders": {
```

```bash
curl -sk http://$TARGET_IP:$PORT/swagger.json | python3 -c "import sys,json; spec=json.load(sys.stdin); [print(path) for path in spec.get('paths',{}).keys()]"
# /api/v1/users
# /api/v1/users/{id}
# /api/v1/admin/users
# /api/v1/orders
# /api/v1/products
```

High-value endpoints to test once paths are known:

- `/users`, `/accounts`: user data, often IDOR-vulnerable
- `/admin`, `/management`: admin functionality behind weak auth
- `/config`, `/settings`, `/env`: application configuration and secrets
- `/debug`, `/health`, `/metrics`: diagnostic info, stack traces, internal state
- `/upload`, `/import`: file upload surfaces for RCE
- `/graphql`: single endpoint exposing the full data model

## REST API Endpoint Bruteforce

When no documentation is available, bruteforce common API paths with a dedicated wordlist:

```bash
ffuf -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt -u http://$TARGET_IP:$PORT/api/FUZZ -mc 200,201,204,301,302,401,403 -o api_endpoints.json
```

```bash
ffuf -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt -u http://$TARGET_IP:$PORT/api/v1/FUZZ -mc 200,201,204,301,302,401,403
```

Test common API version prefixes when you don't know the versioning scheme:

```bash
for ver in v1 v2 v3 api api/v1 api/v2 rest rest/v1; do code=$(curl -skI http://$TARGET_IP:$PORT/$ver/users | grep HTTP | awk '{print $2}'); echo "$code /$ver/users"; done
# 404 /v1/users
# 200 /v2/users
# 404 /v3/users
# 401 /api/v1/users
```

## HTTP Method Testing

REST APIs often have different behavior per method. Test GET, POST, PUT, PATCH, and DELETE on discovered endpoints: some may be accessible with methods the application doesn't use in the UI:

```bash
for method in GET POST PUT PATCH DELETE OPTIONS; do echo -n "$method: "; curl -sk -X $method http://$TARGET_IP:$PORT/api/v1/users -H 'Content-Type: application/json' -o /dev/null -w '%{http_code}'; echo; done
# GET: 200
# POST: 201
# PUT: 405
# PATCH: 403
# DELETE: 403
# OPTIONS: 200
```

A 403 on DELETE or PATCH where GET returns 200 suggests the endpoint exists but is access-controlled. These are candidates for authorization bypass testing and [IDOR testing](https://hackindex.io/services/web/vulnerability-discovery/idor-testing-by-parameter-tampering).

## GraphQL Enumeration

GraphQL exposes a single endpoint that handles all queries. Detect it and run introspection to dump the full schema:

```bash
for path in /graphql /api/graphql /graphiql /graphql/console /v1/graphql; do code=$(curl -skI http://$TARGET_IP:$PORT$path | grep HTTP | awk '{print $2}'); echo "$code $path"; done
# 200 /graphql
# 404 /api/graphql
```

```bash
curl -sk -X POST http://$TARGET_IP:$PORT/graphql -H 'Content-Type: application/json' -d '{"query":"{__schema{types{name}}}"}' | python3 -m json.tool | grep '"name"'
# "name": "Query"
# "name": "User"
# "name": "Order"
# "name": "Admin"
```

```bash
graphw00f -d -t http://$TARGET_IP:$PORT/graphql
```

Introspection returning type names confirms GraphQL is active and introspection is enabled. Run a full introspection query to dump all queries, mutations, and field definitions. The presence of an Admin type or mutation is an immediate escalation target.

## References

- [SecLists: API Wordlists](https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content/api) - API endpoint wordlists for REST bruteforce
- [graphw00f](https://github.com/dolevf/graphw00f) - GraphQL fingerprinting and introspection tool
- [GraphQL: Introspection](https://graphql.org/learn/introspection/) - Introspection query format and schema discovery
