# Design an API

Resources, endpoints, request/response shapes, errors, auth, and versioning for a REST or GraphQL API.

- Topic: Software Development
- Framework: RTF
- Level: Standard
- Tags: Coding, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/design-an-api

## Prompt

```text
Design an API for me.

**What it does and who uses it:** [PURPOSE, consumers — web app, mobile, partners]
**Domain entities and relationships:** [LIST]
**Key use cases:** [LIST]
**Style:** [REST / GraphQL / gRPC — or recommend]
**Constraints:** [auth method, scale, latency, compatibility, existing conventions]

Deliver:
1. Resource model and endpoints (or schema/services) with methods, paths, and purpose.
2. Request/response examples for the main operations.
3. Conventions — naming, pagination, filtering, sorting, idempotency.
4. Error format and status codes.
5. Authentication, authorization, and rate limiting.
6. Versioning and deprecation strategy.
7. An OpenAPI 3.1 snippet for the core endpoints.
8. Design trade-offs and open questions.
```

## What to fill in

- PURPOSE, consumers — web app, mobile, partners
- LIST
- REST / GraphQL / gRPC — or recommend

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
