Admin communities

Manage the communities that receive solidarity-fund allocations. Paths are relative to the /api/v1 prefix; these are back-office endpoints that require an admin token.

Requires an admin bearer token (see Admin auth). Admin only. A scoped admin only sees and edits their own city's communities.

See Common errors. Fund allocation and community progress live under Admin solidarity fund.

Endpoints

Method URI Access Description
POST /admin/communities Admin Create a community
PATCH /admin/communities/{communityId} Admin Update a community

POST /admin/communities

Creates a community. It starts ACTIVE.

Request body

Field Type Required Rules
name string yes ≤ 100 chars, unique among communities
description string yes ≤ 500 chars
meta integer yes ≥ 0; the community's fundraising goal
city_id integer no must be an existing city

Response 201

{
  "community": {
    "id": 7,
    "name": "Barrio La Esperanza",
    "description": "Pozo comunitario",
    "meta": 500,
    "city_id": 1,
    "status": "ACTIVE",
    "created_at": "2026-06-29T10:00:00+00:00"
  }
}

PATCH /admin/communities/{communityId}

Partial update of a community. Only an ACTIVE community can be updated.

Request body

Field Type Required Rules
name string no ≤ 100 chars, unique (excluding this community)
description string no ≤ 500 chars
meta integer no ≥ 0
status string no ACTIVE or INACTIVE
city_id integer no must be an existing city

Response 200

{
  "community": {
    "id": 7,
    "name": "Barrio La Esperanza",
    "description": "Pozo comunitario rehabilitado",
    "meta": 750,
    "status": "ACTIVE",
    "created_at": "2026-06-29T10:00:00+00:00",
    "updated_at": "2026-06-29T11:30:00+00:00"
  }
}

Errors

Status Body When
404 { "error": "CommunityNotFound" } Unknown community id (or outside the admin's cities)
422 { "error": "CommunityInactive", "message": "…" } The community is not ACTIVE