MyApp API Reference

Overview

Welcome to the MyApp API reference. All endpoints are RESTful and return JSON. Base URL: https://api.myapp.com/v1.

Authentication

All requests require an Authorization header with a Bearer token.

Authorization: Bearer <your-token>

Users

Endpoints for managing user resources.

POST /users

Create a new user.

Request

POST /v1/users HTTP/1.1
Host: api.myapp.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "email": "jane.doe@example.com",
  "name": "Jane Doe",
  "password": "securePassword123"
}

Response (201)

{
  "id": "8f7a3c4e",
  "email": "jane.doe@example.com",
  "name": "Jane Doe",
  "createdAt": "2025-09-17T12:34:56Z"
}

PATCH /users/{id}

Update an existing user.

Request

PATCH /v1/users/8f7a3c4e HTTP/1.1
Host: api.myapp.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Jane D."
}

Response (200)

{
  "id": "8f7a3c4e",
  "email": "jane.doe@example.com",
  "name": "Jane D.",
  "updatedAt": "2025-09-17T13:02:10Z"
}

DELETE /users/{id}

Delete a user.

Request

DELETE /v1/users/8f7a3c4e HTTP/1.1
Host: api.myapp.com
Authorization: Bearer <token>

Response (204)

No content.

Error Codes

CodeDescription
400Bad Request – validation error.
401Unauthorized – missing or invalid token.
404Not Found – resource does not exist.
500Internal Server Error – unexpected condition.