Profile APIs
This set of APIs manages the full lifecycle of a “Profile” resource. Each API plays a specific role, and together they provide a standard create–read–update pattern.
1. Create Profile API
POST /profile
This endpoint is responsible for creating a new profile in the system.
Operation:
- The authenticated client sends profile details in the request body.
- The server validates and stores the new profile.
- A unique profile id is generated and returned in the response.
Required fields:
{
"firstName": "string",
"lastName": "string"
}Typical Response (201 Created):
{
"id": "uuid string",
"createdDate": "UTC time"
...
}Purpose:
- Initialize a fresh profile record.
- Retrieve the ID required for further operations (retrieval, updates).
2. Retrieve Profile API
GET /profile/:id
This endpoint is used to fetch an existing profile by its ID.
Operation:
- Client sends a GET request with the id returned from the create step.
- The server validates the ID and returns the profile details.
Typical Response (200 OK):
{
"id": "uuid string",
"createdDate": "UTC time"
...
}Purpose:
- View existing profile information.
- Confirm data that was created or previously updated.
3. Update Profile API
PUT /profile/:id or PATCH /profile/:id
These endpoints allow modifying an existing profile.
- PUT: replaces the entire profile record with the new payload.
- PATCH: applies a partial update, only modifying provided fields.
Operation:
- Client sends updated fields with the correct id.
- Server applies the update and returns the updated record or status.
Typical Response (200 OK):
{
"id": "12345",
"createdDate": "UTC time",
...
}Purpose:
- Modify or correct profile information.
- Progress the profile through its lifecycle.
How They Work Together
- Create a profile using POST /profile.
- Server returns an id.
- Use this ID to either:
- Retrieve the profile (GET /profile/:id)
- Update the profile (PUT/PATCH /profile/:id)
This flow ensures all profile operations are securely tied to an authenticated session, and that each profile is managed consistently using its unique identifier.
