> ## Documentation Index
> Fetch the complete documentation index at: https://help.propops.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle branch sharing

> Enable or disable branch sharing for the current agent's branch. **Required permission:** `api.agents.branch_sharing`



## OpenAPI

````yaml /openapi.yaml post /api/agents/branch-sharing
openapi: 3.0.3
info:
  title: PropOps Platform API
  description: >
    ## PropOps Platform API


    This is the official REST API documentation for the **PropOps Platform** — a
    comprehensive property

    maintenance and job management solution developed and maintained exclusively
    by **PropOps Technologies Ltd**.


    ### Overview


    The PropOps API enables full CRUD access to all platform resources,
    including job management,

    user administration, contractor assignments, tenant records, financial
    tracking, analytics, and more.


    The backend is built on **PHP 8+** with a custom modular architecture,
    backed by a MySQL/MariaDB

    database accessed via PDO.


    ### Authentication


    All endpoints (unless stated otherwise) require authentication via a
    **Bearer Token** (JWT-compatible).

    Include the token in the `Authorization` header:


    ```

    Authorization: Bearer <your_token>

    ```


    Tokens are issued upon successful login and are session-scoped SHA-256
    hashes (64 characters).

    Mobile and API clients must supply the token on every request. Web session
    cookies are used for

    browser clients.


    ### CSRF Protection


    State-mutating operations (POST, PUT, DELETE) require a valid CSRF token
    passed in the request body

    or header as `csrf_token`. Obtain a fresh token from `GET
    /api/security/csrf-token`.


    ### Permissions


    Access to each endpoint is controlled by a granular permission key
    (dot-notation, e.g.

    `api.jobs.manage.manage`). Your account must be granted the relevant
    permission by an administrator.


    ### Rate Limiting


    Requests are subject to per-IP and per-account rate limits. Exceeding limits
    returns `429 Too Many Requests`.


    ### Pagination


    List endpoints support `limit` (default: 50, max: 200) and `offset` query
    parameters.


    ### Response Format


    All responses are JSON with the following envelope:


    ```json

    {
      "success": true,
      "data": { ... },
      "count": 0,
      "message": "Operation completed successfully"
    }

    ```


    Errors follow:


    ```json

    {
      "success": false,
      "error": "Human-readable error message"
    }

    ```


    ---

    **© 2024 PropOps Technologies Ltd. All rights reserved. Proprietary and
    confidential.**
  version: 2.0.0
  contact:
    name: PropOps Technologies Ltd — API Support
    url: https://propops.co.uk/support
    email: support@propops.co.uk
  license:
    name: Proprietary — No Unauthorized Distribution
    url: https://propops.co.uk/legal/api-license
  x-logo:
    url: https://propops.co.uk/assets/logo.png
  x-owner: PropOps Technologies Ltd
  x-copyright: © 2024 PropOps Technologies Ltd. All rights reserved.
servers:
  - url: https://my.propops.app
    description: API Playground
security:
  - BearerAuth: []
tags:
  - name: Jobs
    description: >-
      Create, retrieve, update, and delete jobs; manage associated documents,
      photos, case notes, and more.
  - name: Dashboard
    description: Aggregated metrics and chiplet data powering the main dashboard view.
  - name: Admin
    description: >-
      Administrative operations — branch management, roles, permissions, API
      discovery, and audit logs.
  - name: Users
    description: >-
      Full lifecycle user management — creation, updates, session control, and
      password security.
  - name: Contractors
    description: Contractor records, trade categories, certification, and coverage lookups.
  - name: Agents
    description: Property agent management and branch-level job assignment data.
  - name: Analytics
    description: Branch performance, job health checks, and activity reporting.
  - name: Email
    description: >-
      Transactional email delivery, template management, and address
      verification.
  - name: Financial
    description: Invoice tracking and payment status management.
  - name: Security
    description: >-
      CSRF tokens, session management, blacklisting, and file-integrity
      monitoring.
  - name: System
    description: >-
      Platform health checks, system status, push notifications, and device
      token registration.
  - name: Tenants
    description: Tenant record management, address assignment, and GDPR reporting.
  - name: Reports
    description: Financial and user activity report generation.
  - name: Services
    description: Service pricing configuration.
  - name: Search
    description: Global cross-module search.
  - name: Calendar
    description: Calendar-view job data.
  - name: Notices
    description: System notices displayed on the dashboard and login page.
  - name: Weather
    description: Weather forecast data via Open-Meteo integration.
  - name: SLA
    description: SLA breach detection and response-time tracking.
  - name: WhatsApp
    description: WhatsApp message sending via template system.
  - name: Webhooks
    description: n8n workflow management and triggering.
  - name: GDPR
    description: GDPR consent logging and data-subject rights.
  - name: Authentication
    description: API authentication and token management. SysOps accounts only.
paths:
  /api/agents/branch-sharing:
    post:
      tags:
        - Agents
      summary: Toggle branch sharing
      description: >-
        Enable or disable branch sharing for the current agent's branch.
        **Required permission:** `api.agents.branch_sharing`
      operationId: agents_branch_sharing_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
                - csrf_token
              properties:
                enabled:
                  type: boolean
                  example: true
                csrf_token:
                  type: string
                  example: abc123def456
      responses:
        '200':
          description: Sharing status updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Operation completed successfully
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: An error occurred. Please try again.
  responses:
    Unauthorized:
      description: Authentication required or token invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error: Unauthorized. Valid Bearer token required.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: SHA-256 session hash
      description: >
        All API requests must include a valid Bearer token in the
        `Authorization` header.

        Tokens are 64-character SHA-256 session hashes issued by the PropOps
        authentication system.


        **Example:**

        ```

        Authorization: Bearer a1b2c3d4e5f6...

        ```

````