Skip to main content

Current User API

Verify the validity of your API key and retrieve basic account information.

Authentication

Authorization: Apikey YOUR_API_KEY

Get Current User

Validates your API key and returns the associated email and subscription plan.

Endpoint

GET /api/uploadposts/me

Headers

NameRequiredDescription
AuthorizationYesApikey YOUR_API_KEY

Example Request (curl)

curl -X GET https://api.upload-post.com/api/uploadposts/me \
-H "Authorization: Apikey YOUR_API_KEY"

Success Response (200 OK)

{
"success": true,
"message": "Token is valid",
"email": "[email protected]",
"plan": "Professional",
"preferences": {
"weekStartDay": 1
}
}

Response Fields:

FieldTypeDescription
successBooleanAlways true for successful requests
messageStringConfirmation message
emailStringThe email address associated with the authenticated account
planStringCurrent subscription plan (e.g., Basic, Professional, Business, Default)
preferencesObjectUser preferences. See Preferences below.

Error Responses

401 Unauthorized - Invalid or missing authentication

{
"success": false,
"message": "Invalid or expired token"
}

500 Internal Server Error - Server-side error

{
"success": false,
"message": "Error description"
}

Preferences

Manage user-level preferences via the preferences endpoint.

Get Preferences

GET /api/uploadposts/users/preferences

Response (200 OK):

{
"success": true,
"preferences": {
"weekStartDay": 1
}
}

Update Preferences

POST /api/uploadposts/users/preferences

Body (JSON):

FieldTypeDescription
weekStartDayIntegerCalendar week start day. 0 = Sunday, 1 = Monday.

Example:

curl -X POST https://api.upload-post.com/api/uploadposts/users/preferences \
-H 'Authorization: Apikey YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"weekStartDay": 1}'

Response (200 OK):

{
"success": true,
"preferences": {
"weekStartDay": 1
}
}

Error (400 Bad Request):

{
"success": false,
"message": "weekStartDay must be 0 (Sunday) or 1 (Monday)"
}

Use Cases

  • Token Validation: Verify that your API key or JWT is still valid before making other API calls
  • Plan Check: Determine the current subscription plan to understand available features and limits
  • Account Verification: Confirm which account is associated with your credentials