emojis
table. If a record exists for the user, it’s updated; otherwise, a new record is created.
Authentication
This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Requires user session.
Request
Bearer token for authentication. Format:
Bearer YOUR_JWT_TOKEN
The string representing the user’s chosen emoji or emoji configuration.
Response
HTTP status code (e.g., 200).
A descriptive message about the result (e.g., “Emoji updated successfully”).
The created or updated emoji data object from the
emojis
table.Error Codes
Status Code | Description | Example Message |
---|---|---|
400 | Missing or invalid emoji field in body. | ”Missing required fields” |
401 | Invalid or missing authentication token. | ”Not authorized” |
500 | Internal server error during processing. | ”Failed to process request” |
500 | Database error during insert/update. | Specific DB error |
Notes
- Performs an “upsert” operation.
- Assumes an
emojis
table exists.
Code Examples
Headers
Bearer token for authentication (JWT)
Body
application/json
The string or JSON representing the user's chosen emoji configuration.
Example:
"😊"