Skip to main content
GET
/
api
/
projects
/
:id
/
meta
Get Project Meta
curl --request GET \
  --url https://api.example.com/api/projects/:id/meta
{
  "success": true,
  "name": "<string>",
  "plan": "<string>"
}

Authentication

This endpoint requires JWT authentication via the verifyJWT middleware. Include your access token in the Authorization header.

Path Parameters

id
string
required
The unique identifier of the project (MongoDB ObjectId)

Response

success
boolean
required
Indicates whether the request was successful
name
string
required
The name of the project
plan
string
required
The subscription plan for the project

Example Request

curl -X GET "https://api.deployhub.online/api/projects/65f3a2b1c4d5e6f7g8h9i0j1/meta" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Example Response

{
  "success": true,
  "name": "my-awesome-app",
  "plan": "pro"
}

Error Responses

404 Not Found
Returned when:
  • Project with the specified ID doesn’t exist
  • Project doesn’t belong to the authenticated user
  • Project has been deleted (status is ‘deleted’)
{
  "success": false,
  "message": "Project not found"
}
500 Internal Server Error
Returned when a server error occurs during processing
{
  "success": false,
  "message": "Failed to fetch project meta"
}

Implementation Notes

  • Only returns projects owned by the authenticated user (verified via req.user._id)
  • Excludes projects with status deleted
  • Uses .lean() for optimized read-only query performance
  • Only selects name and plan fields to minimize data transfer

Source Reference

backend/src/controllers/slices/Project/getProjectMeta.js:4