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

# Stop or restart an app's SDK

> The app's own kill switch (spec 12.3): on, its SDKs stop collecting, drop what they hold and send nothing until it is off; devices take it at their next fetch. A reason is required to turn it on. It never lifts Apsio's switch or a suspension (by_apsio). Owners and admins; audited as instrumentation.kill_switch_on or instrumentation.kill_switch_off.



## OpenAPI

````yaml /api-reference/openapi.json post /orgs/{orgId}/projects/{projectId}/apps/{appId}/kill-switch
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /orgs/{orgId}/projects/{projectId}/apps/{appId}/kill-switch:
    post:
      summary: Stop or restart an app's SDK
      description: >-
        The app's own kill switch (spec 12.3): on, its SDKs stop collecting,
        drop what they hold and send nothing until it is off; devices take it at
        their next fetch. A reason is required to turn it on. It never lifts
        Apsio's switch or a suspension (by_apsio). Owners and admins; audited as
        instrumentation.kill_switch_on or instrumentation.kill_switch_off.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a001
          required: true
          name: orgId
          in: path
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a001
          required: true
          name: projectId
          in: path
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a001
          required: true
          name: appId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                'on':
                  type: boolean
                reason:
                  type: string
                  maxLength: 500
                  description: 'Required to turn it on: 1 to 500 characters.'
              required:
                - 'on'
      responses:
        '200':
          description: The instrumentation, with the switch as published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstrumentation'
      security:
        - session: []
components:
  schemas:
    AppInstrumentation:
      type: object
      properties:
        app_id:
          type: string
        families:
          type: object
          properties:
            summary:
              $ref: '#/components/schemas/InstrumentationFamily'
            errors:
              $ref: '#/components/schemas/InstrumentationFamily'
            logs:
              $ref: '#/components/schemas/InstrumentationFamily'
            spans:
              $ref: '#/components/schemas/InstrumentationFamily'
            network:
              $ref: '#/components/schemas/InstrumentationFamily'
            metrics:
              $ref: '#/components/schemas/InstrumentationFamily'
            replay:
              $ref: '#/components/schemas/InstrumentationFamily'
            resources:
              $ref: '#/components/schemas/InstrumentationFamily'
          additionalProperties: false
          description: >-
            A family left out is in always mode, except resources, which is in
            never mode (D113).
        retention_hours:
          type: integer
          description: 'How long held records stay on the device: 1 to 168 hours.'
        cap_bytes:
          type: integer
          description: 'The store''s cap: at most 20 MiB.'
        replay_cap_bytes:
          type: integer
          description: 'Replay''s share of it: at most 10 MiB.'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/InstrumentationRule'
          description: At most 50; families list them as rule:<id>.
        kill_switch:
          $ref: '#/components/schemas/KillSwitch'
        updated_by:
          type:
            - string
            - 'null'
          description: 'Null: the profile''s defaults.'
        updated_at:
          type:
            - string
            - 'null'
      required:
        - app_id
        - families
        - retention_hours
        - cap_bytes
        - replay_cap_bytes
        - rules
        - kill_switch
        - updated_by
        - updated_at
    InstrumentationFamily:
      type: object
      properties:
        mode:
          type: string
          enum:
            - always
            - sampled
            - on_trigger
            - never
        rate:
          type: number
          minimum: 0
          maximum: 1
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/InstrumentationTrigger'
        window_minutes:
          type: integer
          minimum: 1
          maximum: 60
        retention_hours:
          type: integer
          minimum: 1
          maximum: 168
          description: >-
            This family's retention on the device, instead of the store's (spec
            15.6).
        cap_bytes:
          type: integer
          minimum: 65536
          maximum: 20971520
          description: The most bytes of the store this family takes (spec 15.6).
      required:
        - mode
      description: >-
        A family's mode (spec 15.3): always; sampled at a rate; on_trigger with
        triggers and window_minutes; or never. A sampled family may list
        triggers too: a session outside its sample sends the window before a
        trigger.
    InstrumentationRule:
      type: object
      properties:
        id:
          type: string
          pattern: ^[a-z0-9._-]{1,64}$
          description: Listed by families as rule:<id>.
          example: checkout_5xx
        'on':
          type: string
          description: log, log:<event name>, span, span:<span name> or network.
          example: network
        where:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
          maxItems: 8
        name:
          type: string
        updated_by:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
      required:
        - id
        - 'on'
        - name
        - updated_by
        - updated_at
      description: >-
        A trigger the policy defines (spec 15.8), matched on the device as
        records are written. A rule fires at most once per session.
    KillSwitch:
      type: object
      properties:
        'on':
          type: boolean
        reason:
          type:
            - string
            - 'null'
        updated_by:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
        by_apsio:
          type: boolean
          description: >-
            Apsio's kill switch or a suspension has the app stopped; the owner's
            switch cannot lift it.
      required:
        - 'on'
        - reason
        - updated_by
        - updated_at
        - by_apsio
      description: >-
        The app's own kill switch (spec 12.3): its SDKs stop collecting, drop
        what they hold and send nothing until it is off.
    InstrumentationTrigger:
      anyOf:
        - type: string
        - type: object
          properties:
            trigger:
              type: string
            window_minutes:
              type: integer
              minimum: 1
              maximum: 60
            after:
              type: string
              enum:
                - session
                - window
          required:
            - trigger
      description: >-
        A trigger's name (crash, error, anr, rage_tap, dead_tap, event:<name>,
        rule:<id>), or an object that sets its own window and whether the rest
        of the session is released after it (after: session) or only the window
        (after: window) (spec 15.4).
    RuleCondition:
      type: object
      properties:
        attr:
          type: string
          minLength: 1
          maxLength: 128
        op:
          type: string
          enum:
            - eq
            - in
            - prefix
            - gte
            - lte
            - status_class
            - glob
            - exists
        value:
          anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
      required:
        - attr
        - op
      description: >-
        A condition on a record's attribute (spec 15.8): eq, in (1 to 50
        values), prefix, gte, lte, status_class (1xx to 5xx), glob (* and ?, at
        most 128 characters) or exists.
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: apsio_session
      description: >-
        The console session, set by /v1/auth/callback (`__Host-apsio_session`
        when host-only).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.