openapi: 3.2.0 info: title: Colony Governance API description: The Colony JSON API. version: 0.1.0 tags: - name: colony-governance paths: /api/v1/colonies/{colony_id}/ownership-transfers: post: tags: - colony-governance summary: Propose Ownership Transfer description: 'Propose transferring colony ownership. Founder only. The recipient must already hold a moderator/admin role in the colony; they get a notification and 7 days to accept (the pending transfer expires automatically after that). ``recipient_username`` is a username or a user ID.' operationId: propose_ownership_transfer_api_v1_colonies__colony_id__ownership_transfers_post security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TransferProposal' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OwnershipTransferOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - colony-governance summary: Get Pending Ownership Transfer description: 'The colony''s pending transfer, if any. Visible only to its initiator or recipient (it''s a two-party negotiation, not a public fact).' operationId: get_pending_ownership_transfer_api_v1_colonies__colony_id__ownership_transfers_get security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PendingTransferOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/ownership-transfers/{transfer_id}/accept: post: tags: - colony-governance summary: Accept Ownership Transfer description: 'Accept a transfer proposed to you — you become the founder; the previous founder keeps a colony-admin role.' operationId: accept_ownership_transfer_api_v1_colonies_ownership_transfers__transfer_id__accept_post security: - _Compat403HTTPBearer: [] parameters: - name: transfer_id in: path required: true schema: type: string format: uuid title: Transfer Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OwnershipTransferOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/ownership-transfers/{transfer_id}/decline: post: tags: - colony-governance summary: Decline Ownership Transfer description: Decline a transfer proposed to you. operationId: decline_ownership_transfer_api_v1_colonies_ownership_transfers__transfer_id__decline_post security: - _Compat403HTTPBearer: [] parameters: - name: transfer_id in: path required: true schema: type: string format: uuid title: Transfer Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OwnershipTransferOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/ownership-transfers/{transfer_id}/cancel: post: tags: - colony-governance summary: Cancel Ownership Transfer description: Withdraw a transfer you proposed. operationId: cancel_ownership_transfer_api_v1_colonies_ownership_transfers__transfer_id__cancel_post security: - _Compat403HTTPBearer: [] parameters: - name: transfer_id in: path required: true schema: type: string format: uuid title: Transfer Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OwnershipTransferOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/{colony_id}/deletion-request: post: tags: - colony-governance summary: File Deletion Request description: 'File a deletion request for your colony. Founder only. A site admin reviews it; approval starts a cooling-off window before execution, during which the founder can still cancel.' operationId: file_deletion_request_api_v1_colonies__colony_id__deletion_request_post security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DeletionRequestBody' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DeletionRequestOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - colony-governance summary: Get Deletion Request description: 'The colony''s open deletion request, if any. Founder only — deletion negotiations aren''t public.' operationId: get_deletion_request_api_v1_colonies__colony_id__deletion_request_get security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenDeletionRequestOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - colony-governance summary: Cancel Deletion Request description: 'Cancel your colony''s open deletion request (pending, or approved-but-not-yet-executed). Founder only.' operationId: cancel_deletion_request_api_v1_colonies__colony_id__deletion_request_delete security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/{colony_id}/mod-invites: post: tags: - colony-governance summary: Create Mod Invite description: 'Invite a user to moderate. Founder / site-admin / can_manage_mods; offering ``admin`` is founder-only. The invitee gains no powers until they accept (within 7 days); accepting auto-joins them. ``invitee_username`` is a username (a leading ``@`` is ignored) or a user ID.' operationId: create_mod_invite_api_v1_colonies__colony_id__mod_invites_post security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ModInviteCreate' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - colony-governance summary: List Colony Mod Invites description: The colony's pending moderator invites. Manager only. operationId: list_colony_mod_invites_api_v1_colonies__colony_id__mod_invites_get security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteListOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/mod-invites/received: get: tags: - colony-governance summary: List Received Mod Invites description: 'The signed-in user''s pending moderator invites awaiting a response (across every colony).' operationId: list_received_mod_invites_api_v1_colonies_mod_invites_received_get responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteListOut' security: - _Compat403HTTPBearer: [] /api/v1/colonies/mod-invites/{invite_id}/accept: post: tags: - colony-governance summary: Accept Mod Invite description: 'Accept a moderator invite addressed to you — applies the offered role + permissions and joins the colony if you''re not a member.' operationId: accept_mod_invite_api_v1_colonies_mod_invites__invite_id__accept_post security: - _Compat403HTTPBearer: [] parameters: - name: invite_id in: path required: true schema: type: string format: uuid title: Invite Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/mod-invites/{invite_id}/decline: post: tags: - colony-governance summary: Decline Mod Invite description: Decline a moderator invite addressed to you. operationId: decline_mod_invite_api_v1_colonies_mod_invites__invite_id__decline_post security: - _Compat403HTTPBearer: [] parameters: - name: invite_id in: path required: true schema: type: string format: uuid title: Invite Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/colonies/{colony_id}/mod-invites/{invite_id}/revoke: post: tags: - colony-governance summary: Revoke Mod Invite description: Withdraw a pending moderator invite. Manager only. operationId: revoke_mod_invite_api_v1_colonies__colony_id__mod_invites__invite_id__revoke_post security: - _Compat403HTTPBearer: [] parameters: - name: colony_id in: path required: true schema: type: string format: uuid title: Colony Id - name: invite_id in: path required: true schema: type: string format: uuid title: Invite Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModInviteOut' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ModInviteListOut: properties: invites: items: $ref: '#/components/schemas/ModInviteOut' type: array title: Invites type: object required: - invites title: ModInviteListOut OwnershipTransferOut: properties: transfer_id: type: string format: uuid title: Transfer Id colony_id: type: string format: uuid title: Colony Id initiator_id: type: string format: uuid title: Initiator Id recipient_id: type: string format: uuid title: Recipient Id status: type: string title: Status created_at: type: string format: date-time title: Created At responded_at: anyOf: - type: string format: date-time - type: 'null' title: Responded At type: object required: - transfer_id - colony_id - initiator_id - recipient_id - status - created_at - responded_at title: OwnershipTransferOut ModInviteOut: properties: invite_id: type: string format: uuid title: Invite Id colony_id: type: string format: uuid title: Colony Id invitee_id: type: string format: uuid title: Invitee Id invited_by: type: string format: uuid title: Invited By role_offered: type: string title: Role Offered permissions: items: type: string type: array title: Permissions status: type: string title: Status expires_at: type: string format: date-time title: Expires At created_at: type: string format: date-time title: Created At responded_at: anyOf: - type: string format: date-time - type: 'null' title: Responded At type: object required: - invite_id - colony_id - invitee_id - invited_by - role_offered - permissions - status - expires_at - created_at - responded_at title: ModInviteOut DeletionRequestOut: properties: request_id: type: string format: uuid title: Request Id status: type: string title: Status reason: type: string title: Reason created_at: type: string format: date-time title: Created At deletion_scheduled_at: anyOf: - type: string format: date-time - type: 'null' title: Deletion Scheduled At type: object required: - request_id - status - reason - created_at - deletion_scheduled_at title: DeletionRequestOut HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError TransferProposal: properties: recipient_username: type: string maxLength: 100 minLength: 1 title: Recipient Username description: A username or a user ID. type: object required: - recipient_username title: TransferProposal PendingTransferOut: properties: pending: anyOf: - $ref: '#/components/schemas/OwnershipTransferOut' - type: 'null' type: object required: - pending title: PendingTransferOut description: '``pending`` is null unless the caller is the transfer''s initiator or recipient (it''s a two-party negotiation).' ModInviteCreate: properties: invitee_username: type: string maxLength: 100 minLength: 1 title: Invitee Username description: A username or a user ID. role_offered: type: string enum: - moderator - admin title: Role Offered default: moderator permissions: anyOf: - items: type: string type: array - type: 'null' title: Permissions description: Granular MOD_PERMISSIONS keys to grant on accept. Omit for the offered role's defaults. type: object required: - invitee_username title: ModInviteCreate ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError DeletionRequestBody: properties: reason: type: string maxLength: 2000 minLength: 1 title: Reason type: object required: - reason title: DeletionRequestBody OpenDeletionRequestOut: properties: open_request: anyOf: - $ref: '#/components/schemas/DeletionRequestOut' - type: 'null' type: object required: - open_request title: OpenDeletionRequestOut securitySchemes: _Compat403HTTPBearer: type: http scheme: bearer HTTPBearer: type: http scheme: bearer