Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,44 @@ paths:
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
patch:
tags: [Charities]
summary: Change an Organisation's settings
description: |
Changes the Organisation's settings that Charity Preferences offers over the API. For now that is
**Default story level privacy setting on each project**: the Story Privacy Level each new project
in the Organisation starts with. Existing projects keep their own level, and each project's level
can still be changed on its Preferences page. Only settings sent are changed. Only an
Organisation Admin may do this; other colleagues get 403. Returns the Organisation.
operationId: updateCharity
security: [{tokenAuth: []}]
parameters:
- $ref: '#/components/parameters/ResourceId'
requestBody:
content:
application/json:
schema:
type: object
properties:
default_project_story_privacy:
$ref: '#/components/schemas/DefaultProjectStoryPrivacy'
example:
default_project_story_privacy: only_project_colleagues
responses:
"200":
description: The Organisation, with the setting changed
content:
application/json:
schema:
$ref: '#/components/schemas/Charity'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'

/announcements:
get:
Expand Down Expand Up @@ -14783,6 +14821,18 @@ components:
name:
type: string
example: "Greenfield Community Trust"
default_project_story_privacy:
$ref: '#/components/schemas/DefaultProjectStoryPrivacy'

DefaultProjectStoryPrivacy:
type: string
description: |
The Story Privacy Level each new project in the Organisation starts with: Project colleagues
only, Organisation colleagues only, Network & organisation colleagues only, or Everyone.
Organisations created from November 2026 start with `only_project_colleagues`; older ones
with `only_charity_colleagues`.
enum: [only_project_colleagues, only_charity_colleagues, charity_plus_network, everyone]
example: only_project_colleagues

ProjectDetail:
description: A Project as returned by `GET /projects/{id}`.
Expand Down
12 changes: 11 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,20 @@ function buildDocsPage() {
${endpointCard("GET", "/charities/{id}", "Get a single Organisation", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Organisation ID" }
], [
{ code: "200", cls: "response-2xx", desc: "Charity record with id, name, timestamps" },
{ code: "200", cls: "response-2xx", desc: "Charity record with id, name, timestamps and <code>default_project_story_privacy</code>: the Story Privacy Level each new project in the Organisation starts with" },
{ code: "401", cls: "response-4xx", desc: "Not authenticated" },
{ code: "404", cls: "response-4xx", desc: "Not found" }
])}
${endpointCard("PATCH", "/charities/{id}", "Change an Organisation's settings", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Organisation ID" },
{ name: "default_project_story_privacy", in: "body", type: "string", required: false, desc: "<strong>Default story level privacy setting on each project</strong>: the Story Privacy Level each new project starts with. One of <code>only_project_colleagues</code> (Project colleagues only), <code>only_charity_colleagues</code> (Organisation colleagues only), <code>charity_plus_network</code> (Network &amp; organisation colleagues only) or <code>everyone</code>. Existing projects keep their own level." }
], [
{ code: "200", cls: "response-2xx", desc: "The Organisation, with the setting changed" },
{ code: "401", cls: "response-4xx", desc: "Not authenticated" },
{ code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of this Organisation" },
{ code: "404", cls: "response-4xx", desc: "Not found, or not one of your Organisations" },
{ code: "422", cls: "response-4xx", desc: "<code>default_project_story_privacy</code> isn't one of the four levels" }
], "Only an Organisation Admin can change these settings, the same people who can use Charity Preferences. Only the settings sent are changed.")}
</div>
</section>

Expand Down
Loading