Building APIs from Scratch with the API Designer
Overview
No OpenAPI specification? No problem! ReadMe's API Designer lets you build your API reference directly in the platform with an intuitive visual interface β no YAML or JSON required.
In this guide, we'll walk through creating a Social Media API with endpoints for listing and creating posts. You'll see how easy it is to document your API even if you're starting from a blank slate.
Creating Your API Definition
Let's start by setting up the basic structure for your API:
- Navigate to API Reference in your ReadMe project
- Click the + Add button
- Select Start Building under "Build an API definition from scratch"

- Enter your API definition details:
- API Title: Enter a descriptive name (e.g., "Social Media API")
- Target Host URL: Your API's base URL (e.g., "http://api.example.com")
- Authentication Type: Select your authentication method (None, API Key, Basic, or Bearer)

- Click Save to create your API definition
Your new API definition will appear in the left navigation panel, ready for you to add endpoints.
Creating Your First Endpoint (List Social Media Posts)
Let's create an endpoint to retrieve a list of social media posts:
- In the left navigation, you'll see a default endpoint labeled
/new-endpoint
- Rename this to better reflect your API structure - let's call it "Posts"
- You'll now see this category in your left navigation

- Create your GET endpoint for listing posts:
- Click on the endpoint to edit it
- Change the title to "List Social Media Posts"
- Select the GET method from the dropdown menu
- Set the path to
/posts
- Add a description explaining what the endpoint does (e.g., "Returns a paginated list of social media posts")

Adding Query Parameters
Most list endpoints support pagination or filtering. Let's add some query parameters:
- Locate the Query Parameters section and click the + button
- Add parameters for pagination:
- Add a
page
parameter of typeinteger
- Add a
limit
parameter of typeinteger
- Add any other filtering parameters (e.g.,
category
as astring
)
- Add a
- For each parameter:
- Add a description
- Set whether it's required
- Provide a default value if applicable

Adding Example Responses
Now let's add an example response to show developers what to expect:
- Locate the Add example response section on the right side
- Click the + button
- Select the status code (typically
200
for successful GET requests) - Add a JSON response example that shows a list of posts with typical fields like IDs, content, timestamps, etc.
- You can add multiple response examples for different scenarios

Creating Your Second Endpoint (Create a Social Media Post)
Now let's add an endpoint for creating new posts:
- In the left navigation, click the + New Category button if you need a new category, or use your existing "Posts" category
- Click the + icon to add a new endpoint
- Set up your POST endpoint:
- Title: "Create New Post"
- Method: Select POST from the dropdown
- Path:
/posts
- Description: "Allows authenticated users to create new posts"

Adding Request Body Parameters
For a POST endpoint, you'll need to define the request body:
- Locate the Request Body section and click to expand it
- Set the content type to
object
- Add the required fields:
- Add a
content
field of typestring
and mark it as required - Add any additional fields your API accepts (e.g.,
image_url
,tags
)
- Add a
- For each field:
- Add a clear description
- Mark whether it's required
- Provide any constraints (min/max length, pattern, etc.)

Adding Request Code Samples
One of ReadMe's powerful features is automatic code sample generation:
- Find the Request Code section on the right
- ReadMe automatically generates code examples in multiple languages
- You can also click "Write your own static samples" to add custom examples

Adding Example Responses
Finally, add example responses for your POST endpoint:
- Click the + button under "Add example response"
- Add a
201
status code for successful creation - Provide a JSON example of the created resource
- Consider adding additional response examples for errors like
400
(Bad Request) or401
(Unauthorized)

Testing Your API Documentation
After creating your endpoints:
- Save your changes
- Toggle to the "View" mode to see how your documentation looks to developers
- Test the interactive features to ensure your examples work correctly
Tips for Great API Documentation
- Be thorough with descriptions: Clearly explain what each endpoint does and why
- Provide realistic examples: Use example data that looks like real-world usage
- Document error states: Include examples of error responses and how to handle them
- Use consistent naming: Maintain a consistent style across all endpoints and parameters
- Add "What's Next": Use the "What's Next" section to guide users on related endpoints they might need
By following this guide, you've created a well-documented API reference from scratch using ReadMe's API Designer. Your developers now have interactive, clear documentation that helps them integrate with your API quickly and easily.
Remember, you can always return to the API Designer to add endpoints, update parameters, or enhance your documentation as your API evolves.
Updated about 10 hours ago