Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pvnm4/Social-Media-Backend/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint retrieves a user’s public profile by their numeric ID. Given a valid integer user ID, it returns the matching account’s id, email, and created_at timestamp. No authentication token is required to look up a user profile. If no user exists for the provided ID, the endpoint returns a 404 Not Found error.

Endpoint

GET /users/{id}
Authentication is not required for this endpoint.

Path Parameters

id
integer
required
The unique numeric ID of the user to retrieve. This corresponds to the auto-generated primary key assigned when the account was created. Must be a positive integer — passing a non-integer value will result in a 422 Unprocessable Entity response.

Response

A successful request returns HTTP 200 OK with the user’s profile.
id
integer
The user’s unique auto-generated integer ID, as assigned by the database at registration time.
email
string
The email address associated with the user’s account.
created_at
string
ISO 8601 timestamp (with timezone) indicating when the account was originally created. Example: "2024-01-15T10:30:00.000000+00:00".

Error Responses

Status CodeDetail MessageCause
404 Not Found"User with id: {id} does not exists"No user record was found in the database for the given ID.
422 Unprocessable Entity(Pydantic validation error)The id path parameter could not be parsed as an integer.

Examples

curl http://localhost:8000/users/1

Successful Response — 200 OK

{
  "id": 1,
  "email": "alice@example.com",
  "created_at": "2024-01-15T10:30:00.000000+00:00"
}

Error Response — 404 Not Found

{
  "detail": "User with id: 99 does not exists"
}

Build docs developers (and LLMs) love