«حفظ كمسودة» and «الحفظ التلقائي» for the project form, and «نشر».
A draft is the form saved before it is finished: every field optional, nothing
visible to anyone but its author — not in the projects list, not to admins, not
to guests. Publishing turns it into a project through the same path as
POST /projects (webhook, types, AI index) and deletes the draft.
- Who: the same callers as creating a project (
projects:manage,projects:createorprojects:moderate), not restricted from media (403RESTRICTION_BLOCKED). Only the author reads or writes a draft: anyone else's answers 404PROJECT_DRAFT_NOT_FOUND. - Saving:
PUTchanges only the fields sent (absent = unchanged, null / "" = cleared). JSON is fine for text-only autosaves; send multipart when a file is attached. Send back therevisionyou last got: if another tab saved since, nothing is written and the answer is 409PROJECT_DRAFT_CONFLICTwith the currentrevision. - Limits: at most 20 drafts per author per community (409
PROJECT_DRAFT_LIMIT); a draft above 2 MB answers 413PROJECT_DRAFT_TOO_LARGE. - Publishing: 400
PROJECT_DRAFT_INCOMPLETEwithmissingwhile name, nameArabic, description or the logo is missing. Publishing the same draft twice creates ONE project: the second answers 409PROJECT_DRAFT_ALREADY_PUBLISHEDwithprojectId. The project's id is the draft's id. - «إشعار الأعضاء عند النشر»:
notifyMembersin the publish body, else the value the draft stored, else no notice. - «المشاريع 2» has the same endpoints under
/projects2/drafts(tag Project 2 Drafts); a draft belongs to one section and is invisible from the other.
6 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/communities/{communityId}/project-drafts | My drafts in this community, most recently saved first |
POST | /api/communities/{communityId}/project-drafts | Save a new draft (the first «حفظ كمسودة» or autosave) |
DELETE | /api/communities/{communityId}/project-drafts/{draftId} | Discard a draft |
GET | /api/communities/{communityId}/project-drafts/{draftId} | One of my drafts (to reopen it in the form) |
PUT | /api/communities/{communityId}/project-drafts/{draftId} | Autosave / save — only the fields sent change |
POST | /api/communities/{communityId}/project-drafts/{draftId}/publish | Publish — the draft becomes a project |
GET /api/communities/{communityId}/project-draftsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | { success, data: ProjectDraftSummary[] } — a summary per draft; open one with GET /draftId | object |
POST /api/communities/{communityId}/project-draftsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
Request body — application/json
Type: ProjectDraftSaveForm
Responses
| Status | Description | Body |
|---|---|---|
201 | data is the ProjectDraft (revision 1) | — |
400 | PROJECT_DRAFT_INVALID — a field of the wrong type | — |
403 | Missing permission, RESTRICTION_BLOCKED, FEATURE_NOT_AVAILABLE, or storage quota exceeded | — |
409 | PROJECT_DRAFT_LIMIT — already 20 drafts | — |
413 | PROJECT_DRAFT_TOO_LARGE | — |
DELETE /api/communities/{communityId}/project-drafts/{draftId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
draftId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Deleted | — |
404 | PROJECT_DRAFT_NOT_FOUND | — |
GET /api/communities/{communityId}/project-drafts/{draftId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
draftId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | data is the ProjectDraft | — |
404 | PROJECT_DRAFT_NOT_FOUND — missing | — |
PUT /api/communities/{communityId}/project-drafts/{draftId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
draftId | path | yes | string (uuid) | — |
Request body — application/json
Type: ProjectDraftSaveForm
Responses
| Status | Description | Body |
|---|---|---|
200 | data is the ProjectDraft, revision + 1 | — |
400 | PROJECT_DRAFT_INVALID | — |
404 | PROJECT_DRAFT_NOT_FOUND | — |
409 | PROJECT_DRAFT_CONFLICT — revision is stale; the body carries the current revision | — |
413 | PROJECT_DRAFT_TOO_LARGE | — |
POST /api/communities/{communityId}/project-drafts/{draftId}/publishThe body is optional and is saved first, exactly like PUT (so «نشر» can carry the
last unsaved changes in the same request), then the draft is published and deleted.
notifyMembers here overrides the value the draft stored.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
draftId | path | yes | string (uuid) | — |
Request body — application/json
Type: ProjectDraftSaveForm
Responses
| Status | Description | Body |
|---|---|---|
201 | Published; data is the Project (its id is the draft's id) | — |
400 | PROJECT_DRAFT_INCOMPLETE with missing, PROJECT_DRAFT_INVALID, or the create endpoint's own checks (dates, prices, TOO_MANY_PROJECT_TYPES, PROJECT_OWNER_NOT_MEMBER) | — |
403 | Missing permission, RESTRICTION_BLOCKED, PROJECT_OWNER_ASSIGN_FORBIDDEN, FEATURE_NOT_AVAILABLE | — |
404 | PROJECT_DRAFT_NOT_FOUND | — |
409 | PROJECT_DRAFT_ALREADY_PUBLISHED with projectId, or PROJECT_DRAFT_CONFLICT | — |