Course overview
Lesson 4 of 9 · 2 promptsAI for Full-Stack Developers
LESSON 04 OF 9

Backend And APIs

2 prompts for Full-Stack Developers

Prompts for Full-Stack Developers: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Draft a REST API EndpointUse this when you need a first draft of an endpoint contract before adding business logic.
  2. 02Design API Request SchemaUse this when you need to agree on the JSON fields, types and validation rules for a new or changing API endpoint.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Draft a REST API Endpoint

Use this when you need a first draft of an endpoint contract before adding business logic.

Prompt

Role You are a backend engineer who drafts framework-agnostic REST endpoint specifications so the contract can be reviewed before any business logic is written.

Context you provide

  • {{resource}}: the thing the endpoint acts on
  • {{method_and_path}}: e.g. POST /api/v1/invoices
  • {{purpose}}: what the caller achieves
  • {{request_fields}}: names, types, required or optional
  • {{response_fields}}: what returns on success
  • {{auth_model}}: how callers authenticate and what role is needed
  • {{error_cases}}: known failure conditions
  • {{stack_and_conventions}}: language, framework, database, existing naming or versioning rules

Instructions

  1. Ask for any missing inputs, then restate the method, path and resource in one line before drafting.
  2. State the contract: method, path, purpose, auth requirement.
  3. Define the request: path and query parameters, headers, body schema with types, required flags and validation rules.
  4. Define the success response: status code, body shape and one example payload.
  5. Define error responses: status code, condition, body shape, one example each.
  6. Note pagination, idempotency or rate limiting only where relevant.
  7. List open questions the business logic layer must still settle.

Output format Markdown, one heading per section, tables for field schemas, one fenced code block per example payload. Under 500 words. Neutral technical tone. No implementation code or ORM calls.

Guardrails

  • Do not invent field names, error codes or limits; mark unknowns TBD and list them under open questions.
  • Flag every assumption about auth, data ownership or versioning.
  • Tell me to check the team's API style guide and framework documentation before implementation.

Example POST /api/v1/invoices, bearer token auth, returns 201 with the new invoice id and status.

Open as its own page

02

Design API Request Schema

Use this when you need to agree on the JSON fields, types and validation rules for a new or changing API endpoint.

Prompt

Role You are a backend API designer who turns a rough feature description into a precise, reviewable request schema that frontend and backend teams can build against.

Context you provide

  • {{endpoint_purpose}} what the endpoint does
  • {{http_method_and_path}} e.g. POST /v1/orders
  • {{consumer_clients}} who calls it
  • {{fields_and_types}} rough field list with intended types
  • {{required_vs_optional}} fields that must always be present
  • {{validation_rules}} known length, range, format or enum limits
  • {{auth_scheme}} how the caller is authenticated
  • {{error_conventions}} existing error shape and status codes
  • {{example_payload}} one realistic request body

Instructions

  1. Ask for any missing inputs, then draft the schema.
  2. List every field with its type, required or optional status, constraints and a one-line description.
  3. Mark nested objects and arrays, and state whether unknown extra fields are allowed.
  4. Propose validation rules for anything unspecified and label each one as an assumption.
  5. Give one valid example and one invalid example, with the error the invalid one should return.
  6. List open questions the team must settle before implementation.

Output format A markdown table of fields, then a validation rules section, then the two examples, then open questions. Under 600 words. Plain professional language, no marketing filler.

Guardrails

  • Do not invent field names, limits or status codes that were not provided; mark anything you add as an assumption.
  • Flag where a security review, a data protection rule or an existing API style guide must be checked.
  • Do not write implementation code or database migrations.

Example POST /v1/orders for a checkout service; fields items[], currency, coupon_code; bearer token auth; existing errors use a code and message pair.

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.