openapi: 3.1.0
info:
  title: Webhooks
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Register a webhook subscription
      description: >-
        Creates a webhook subscription with a delivery URL and an optional list
        of event types to subscribe to (defaults to all when omitted). The
        response includes the generated signing secret, which is returned only
        once at creation time and cannot be retrieved later.
      operationId: createWebhook
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  maxLength: 2048
                  format: uri
                  example: https://example.com/webhooks/droidrun
                eventTypes:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 256
                  maxItems: 100
                  example:
                    - task.run.completed
                    - task.run.failed
                description:
                  type: string
                  maxLength: 500
              required:
                - url
      responses:
        '201':
          description: Webhook created (secret shown once)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                      eventTypes:
                        type: array
                        items:
                          type: string
                      state:
                        type: string
                        enum:
                          - ACTIVE
                          - DISABLED
                          - DELETED
                      health:
                        type: string
                        enum:
                          - healthy
                          - failing
                          - blocked
                        description: >-
                          System-observed delivery health. `blocked` endpoints
                          are auto-disabled after sustained failure; PATCH
                          state=ACTIVE to re-enable.
                      blockedAt:
                        type:
                          - string
                          - 'null'
                      blockedReason:
                        type:
                          - string
                          - 'null'
                      signingEnabled:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      secret:
                        type: string
                        description: Signing secret — shown only once. Store it now.
                    required:
                      - id
                      - url
                      - eventTypes
                      - state
                      - health
                      - blockedAt
                      - blockedReason
                      - signingEnabled
                      - description
                      - createdAt
                      - updatedAt
                      - secret
                required:
                  - data
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const webhook = await client.webhooks.create({ url:
            'https://example.com/webhooks/droidrun' });


            console.log(webhook.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            webhook = client.webhooks.create(
                url="https://example.com/webhooks/droidrun",
            )
            print(webhook.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twebhook, err := client.Webhooks.New(context.TODO(), mobileruncloud.WebhookNewParams{\n\t\tURL: \"https://example.com/webhooks/droidrun\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", webhook.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks create \
              --api-key 'My API Key' \
              --url https://example.com/webhooks/droidrun
    get:
      tags:
        - Webhooks
      summary: List your webhook subscriptions
      description: >-
        Returns a paginated list of your webhook subscriptions, optionally
        filtered by status (active, failing, blocked, or disabled). The response
        also includes per-status counts across all of your subscriptions.
      operationId: listWebhooks
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - active
              - failing
              - blocked
              - disabled
          required: false
          name: status
          in: query
      responses:
        '200':
          description: Webhook subscriptions
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        url:
                          type: string
                        eventTypes:
                          type: array
                          items:
                            type: string
                        state:
                          type: string
                          enum:
                            - ACTIVE
                            - DISABLED
                            - DELETED
                        health:
                          type: string
                          enum:
                            - healthy
                            - failing
                            - blocked
                          description: >-
                            System-observed delivery health. `blocked` endpoints
                            are auto-disabled after sustained failure; PATCH
                            state=ACTIVE to re-enable.
                        blockedAt:
                          type:
                            - string
                            - 'null'
                        blockedReason:
                          type:
                            - string
                            - 'null'
                        signingEnabled:
                          type: boolean
                        description:
                          type:
                            - string
                            - 'null'
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                      required:
                        - id
                        - url
                        - eventTypes
                        - state
                        - health
                        - blockedAt
                        - blockedReason
                        - signingEnabled
                        - description
                        - createdAt
                        - updatedAt
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                  counts:
                    type: object
                    properties:
                      active:
                        type: number
                      failing:
                        type: number
                      blocked:
                        type: number
                      disabled:
                        type: number
                      total:
                        type: number
                    required:
                      - active
                      - failing
                      - blocked
                      - disabled
                      - total
                required:
                  - items
                  - pagination
                  - counts
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const webhooks = await client.webhooks.list();

            console.log(webhooks.counts);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            webhooks = client.webhooks.list()
            print(webhooks.counts)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twebhooks, err := client.Webhooks.List(context.TODO(), mobileruncloud.WebhookListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", webhooks.Counts)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks list \
              --api-key 'My API Key'
  /webhooks/{id}:
    get:
      tags:
        - Webhooks
      summary: Get a webhook subscription
      description: >-
        Returns a single webhook subscription by id, including its URL,
        subscribed event types, state, and system-observed delivery health. The
        signing secret is never included.
      operationId: getWebhook
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Webhook subscription
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                      eventTypes:
                        type: array
                        items:
                          type: string
                      state:
                        type: string
                        enum:
                          - ACTIVE
                          - DISABLED
                          - DELETED
                      health:
                        type: string
                        enum:
                          - healthy
                          - failing
                          - blocked
                        description: >-
                          System-observed delivery health. `blocked` endpoints
                          are auto-disabled after sustained failure; PATCH
                          state=ACTIVE to re-enable.
                      blockedAt:
                        type:
                          - string
                          - 'null'
                      blockedReason:
                        type:
                          - string
                          - 'null'
                      signingEnabled:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                    required:
                      - id
                      - url
                      - eventTypes
                      - state
                      - health
                      - blockedAt
                      - blockedReason
                      - signingEnabled
                      - description
                      - createdAt
                      - updatedAt
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const webhook = await
            client.webhooks.retrieve('550e8400-e29b-41d4-a716-446655440000');


            console.log(webhook.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            webhook = client.webhooks.retrieve(
                "550e8400-e29b-41d4-a716-446655440000",
            )
            print(webhook.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twebhook, err := client.Webhooks.Get(context.TODO(), \"550e8400-e29b-41d4-a716-446655440000\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", webhook.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks retrieve \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
    patch:
      tags:
        - Webhooks
      summary: Update a webhook subscription
      description: >-
        Updates a webhook subscription. Any combination of the subscribed event
        types, state (ACTIVE or DISABLED), and description may be changed, and
        at least one field must be supplied. Setting state to ACTIVE re-enables
        a subscription that was auto-blocked after sustained delivery failures.
      operationId: updateWebhook
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                eventTypes:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 256
                  maxItems: 100
                state:
                  type: string
                  enum:
                    - ACTIVE
                    - DISABLED
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 500
      responses:
        '200':
          description: Updated webhook subscription
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                      eventTypes:
                        type: array
                        items:
                          type: string
                      state:
                        type: string
                        enum:
                          - ACTIVE
                          - DISABLED
                          - DELETED
                      health:
                        type: string
                        enum:
                          - healthy
                          - failing
                          - blocked
                        description: >-
                          System-observed delivery health. `blocked` endpoints
                          are auto-disabled after sustained failure; PATCH
                          state=ACTIVE to re-enable.
                      blockedAt:
                        type:
                          - string
                          - 'null'
                      blockedReason:
                        type:
                          - string
                          - 'null'
                      signingEnabled:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                    required:
                      - id
                      - url
                      - eventTypes
                      - state
                      - health
                      - blockedAt
                      - blockedReason
                      - signingEnabled
                      - description
                      - createdAt
                      - updatedAt
                required:
                  - data
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const webhook = await
            client.webhooks.update('550e8400-e29b-41d4-a716-446655440000');


            console.log(webhook.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            webhook = client.webhooks.update(
                id="550e8400-e29b-41d4-a716-446655440000",
            )
            print(webhook.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twebhook, err := client.Webhooks.Update(\n\t\tcontext.TODO(),\n\t\t\"550e8400-e29b-41d4-a716-446655440000\",\n\t\tmobileruncloud.WebhookUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", webhook.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks update \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
    delete:
      tags:
        - Webhooks
      summary: Delete a webhook subscription
      description: >-
        Deletes a webhook subscription so it stops receiving deliveries. Returns
        204 No Content on success.
      operationId: deleteWebhook
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
      responses:
        '204':
          description: Deleted
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            await
            client.webhooks.delete('550e8400-e29b-41d4-a716-446655440000');
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            client.webhooks.delete(
                "550e8400-e29b-41d4-a716-446655440000",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Webhooks.Delete(context.TODO(), \"550e8400-e29b-41d4-a716-446655440000\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks delete \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
  /webhooks/{id}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate signing secret
      description: >-
        Generates a new signing secret for the webhook subscription and returns
        it once in the response. The previous secret is replaced immediately, so
        any signature verification on your endpoint must be updated to use the
        new value.
      operationId: rotateWebhookSecret
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
      responses:
        '200':
          description: New signing secret (shown once)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                      eventTypes:
                        type: array
                        items:
                          type: string
                      state:
                        type: string
                        enum:
                          - ACTIVE
                          - DISABLED
                          - DELETED
                      health:
                        type: string
                        enum:
                          - healthy
                          - failing
                          - blocked
                        description: >-
                          System-observed delivery health. `blocked` endpoints
                          are auto-disabled after sustained failure; PATCH
                          state=ACTIVE to re-enable.
                      blockedAt:
                        type:
                          - string
                          - 'null'
                      blockedReason:
                        type:
                          - string
                          - 'null'
                      signingEnabled:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      secret:
                        type: string
                        description: Signing secret — shown only once. Store it now.
                    required:
                      - id
                      - url
                      - eventTypes
                      - state
                      - health
                      - blockedAt
                      - blockedReason
                      - signingEnabled
                      - description
                      - createdAt
                      - updatedAt
                      - secret
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.webhooks.rotateSecret('550e8400-e29b-41d4-a716-446655440000');


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.rotate_secret(
                "550e8400-e29b-41d4-a716-446655440000",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.RotateSecret(context.TODO(), \"550e8400-e29b-41d4-a716-446655440000\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks rotate-secret \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
  /webhooks/{id}/test:
    post:
      tags:
        - Webhooks
      summary: Send a one-shot test delivery
      description: >-
        Sends a single test payload to the webhook subscription URL to verify
        connectivity. The response reports whether the attempt succeeded along
        with the returned HTTP status code or error, if any.
      operationId: testWebhook
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Test delivery result
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                      statusCode:
                        type:
                          - number
                          - 'null'
                      error:
                        type:
                          - string
                          - 'null'
                    required:
                      - success
                      - statusCode
                      - error
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.webhooks.testDelivery('550e8400-e29b-41d4-a716-446655440000');


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.test_delivery(
                "550e8400-e29b-41d4-a716-446655440000",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.TestDelivery(context.TODO(), \"550e8400-e29b-41d4-a716-446655440000\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks test-delivery \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
  /event-types:
    get:
      tags:
        - Webhook Event Types
      summary: List subscribable event types per source
      description: >-
        Returns the catalog of event types that webhook subscriptions can
        subscribe to, grouped by source. Use the returned type identifiers as
        the `eventTypes` values when creating or updating a webhook.
      operationId: listWebhookEventTypes
      responses:
        '200':
          description: Event-type catalog
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      schemaVersion:
                        type: number
                        enum:
                          - 1
                      sources:
                        type: array
                        items:
                          type: object
                          properties:
                            source:
                              type: string
                              minLength: 1
                              maxLength: 128
                            events:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    minLength: 1
                                    maxLength: 256
                                  description:
                                    type: string
                                    minLength: 1
                                    maxLength: 512
                                required:
                                  - type
                                  - description
                          required:
                            - source
                            - events
                    required:
                      - schemaVersion
                      - sources
                required:
                  - data
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.webhooks.eventTypes();

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.event_types()
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.EventTypes(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks event-types \
              --api-key 'My API Key'
  /webhooks/deliveries:
    get:
      tags:
        - Webhook Deliveries
      summary: List deliveries across all your webhooks
      description: >-
        Returns a paginated feed of webhook deliveries across all of your
        subscriptions, with the originating endpoint URL included on each
        record. Results can be filtered by delivery status (pending, success,
        skipped, or dead) and by a `since` timestamp.
      operationId: listAllWebhookDeliveries
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 100
            default: 20
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - pending
              - success
              - skipped
              - dead
          required: false
          name: status
          in: query
        - schema:
            type: string
            format: date-time
          required: false
          name: since
          in: query
      responses:
        '200':
          description: Deliveries across all of your endpoints
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        endpointId:
                          type: string
                          format: uuid
                        eventId:
                          type: string
                        eventType:
                          type: string
                        source:
                          type: string
                        status:
                          type: string
                          enum:
                            - pending
                            - success
                            - skipped
                            - dead
                        attempts:
                          type: number
                        lastStatusCode:
                          type:
                            - number
                            - 'null'
                        lastError:
                          type:
                            - string
                            - 'null'
                        durationMs:
                          type:
                            - number
                            - 'null'
                        isTest:
                          type: boolean
                        occurredAt:
                          type: string
                        createdAt:
                          type: string
                        completedAt:
                          type:
                            - string
                            - 'null'
                        endpointUrl:
                          type: string
                      required:
                        - id
                        - endpointId
                        - eventId
                        - eventType
                        - source
                        - status
                        - attempts
                        - lastStatusCode
                        - lastError
                        - durationMs
                        - isTest
                        - occurredAt
                        - createdAt
                        - completedAt
                        - endpointUrl
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const deliveries = await client.webhooks.deliveries.list();

            console.log(deliveries.items);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            deliveries = client.webhooks.deliveries.list()
            print(deliveries.items)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tdeliveries, err := client.Webhooks.Deliveries.List(context.TODO(), mobileruncloud.WebhookDeliveryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", deliveries.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks:deliveries list \
              --api-key 'My API Key'
  /webhooks/deliveries/stats:
    get:
      tags:
        - Webhook Deliveries
      summary: Get delivery statistics
      description: >-
        Returns aggregate delivery statistics across all of your webhooks,
        including the total count, a breakdown by status (pending, success,
        skipped, dead), and the overall success rate. An optional `since`
        timestamp narrows the reporting window.
      operationId: getWebhookDeliveryStats
      parameters:
        - schema:
            type: string
            format: date-time
          required: false
          name: since
          in: query
      responses:
        '200':
          description: Delivery statistics
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      total:
                        type: number
                      byStatus:
                        type: object
                        properties:
                          pending:
                            type: number
                          success:
                            type: number
                          skipped:
                            type: number
                          dead:
                            type: number
                        required:
                          - pending
                          - success
                          - skipped
                          - dead
                      successRate:
                        type:
                          - number
                          - 'null'
                    required:
                      - total
                      - byStatus
                      - successRate
                required:
                  - data
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.webhooks.deliveries.stats();

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.deliveries.stats()
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.Deliveries.Stats(context.TODO(), mobileruncloud.WebhookDeliveryStatsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks:deliveries stats \
              --api-key 'My API Key'
  /webhooks/{id}/deliveries:
    get:
      tags:
        - Webhook Deliveries
      summary: List deliveries for a webhook
      description: >-
        Returns a paginated list of deliveries for a single webhook
        subscription, identified by its id. Each record reports the event,
        delivery status, attempt count, and the last response code or error.
      operationId: listWebhookDeliveries
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
      responses:
        '200':
          description: Deliveries
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        endpointId:
                          type: string
                          format: uuid
                        eventId:
                          type: string
                        eventType:
                          type: string
                        source:
                          type: string
                        status:
                          type: string
                          enum:
                            - pending
                            - success
                            - skipped
                            - dead
                        attempts:
                          type: number
                        lastStatusCode:
                          type:
                            - number
                            - 'null'
                        lastError:
                          type:
                            - string
                            - 'null'
                        durationMs:
                          type:
                            - number
                            - 'null'
                        isTest:
                          type: boolean
                        occurredAt:
                          type: string
                        createdAt:
                          type: string
                        completedAt:
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - endpointId
                        - eventId
                        - eventType
                        - source
                        - status
                        - attempts
                        - lastStatusCode
                        - lastError
                        - durationMs
                        - isTest
                        - occurredAt
                        - createdAt
                        - completedAt
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.webhooks.deliveries.listForWebhook(
              '550e8400-e29b-41d4-a716-446655440000',
            );

            console.log(response.items);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.deliveries.list_for_webhook(
                id="550e8400-e29b-41d4-a716-446655440000",
            )
            print(response.items)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.Deliveries.ListForWebhook(\n\t\tcontext.TODO(),\n\t\t\"550e8400-e29b-41d4-a716-446655440000\",\n\t\tmobileruncloud.WebhookDeliveryListForWebhookParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks:deliveries list-for-webhook \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000
  /webhooks/{id}/deliveries/{deliveryId}:
    get:
      tags:
        - Webhook Deliveries
      summary: Get a delivery with its attempts
      description: >-
        Returns a single delivery for a webhook subscription along with the full
        list of captured attempt records. Each attempt includes the request URL,
        method, headers and body, whether it was signed, and the response
        status, headers, and snippet.
      operationId: getWebhookDelivery
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
        - schema:
            type: string
            format: uuid
          required: true
          name: deliveryId
          in: path
      responses:
        '200':
          description: Delivery with captured attempts
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      endpointId:
                        type: string
                        format: uuid
                      eventId:
                        type: string
                      eventType:
                        type: string
                      source:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                          - success
                          - skipped
                          - dead
                      attempts:
                        type: array
                        items:
                          type: object
                          properties:
                            attemptNo:
                              type: number
                            requestUrl:
                              type: string
                            requestMethod:
                              type: string
                            requestHeaders:
                              type:
                                - object
                                - 'null'
                              additionalProperties:
                                type: string
                            requestBody:
                              type:
                                - string
                                - 'null'
                            signed:
                              type: boolean
                            responseStatus:
                              type:
                                - number
                                - 'null'
                            responseHeaders:
                              type:
                                - object
                                - 'null'
                              additionalProperties:
                                type: string
                            responseSnippet:
                              type:
                                - string
                                - 'null'
                            durationMs:
                              type:
                                - number
                                - 'null'
                            error:
                              type:
                                - string
                                - 'null'
                            sentAt:
                              type: string
                          required:
                            - attemptNo
                            - requestUrl
                            - requestMethod
                            - requestHeaders
                            - requestBody
                            - signed
                            - responseStatus
                            - responseHeaders
                            - responseSnippet
                            - durationMs
                            - error
                            - sentAt
                      lastStatusCode:
                        type:
                          - number
                          - 'null'
                      lastError:
                        type:
                          - string
                          - 'null'
                      durationMs:
                        type:
                          - number
                          - 'null'
                      isTest:
                        type: boolean
                      occurredAt:
                        type: string
                      createdAt:
                        type: string
                      completedAt:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - endpointId
                      - eventId
                      - eventType
                      - source
                      - status
                      - attempts
                      - lastStatusCode
                      - lastError
                      - durationMs
                      - isTest
                      - occurredAt
                      - createdAt
                      - completedAt
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.webhooks.deliveries.retrieveAttempts(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              { id: '550e8400-e29b-41d4-a716-446655440000' },
            );

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.deliveries.retrieve_attempts(
                delivery_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                id="550e8400-e29b-41d4-a716-446655440000",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.Deliveries.GetAttempts(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WebhookDeliveryGetAttemptsParams{\n\t\t\tID: \"550e8400-e29b-41d4-a716-446655440000\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud webhooks:deliveries retrieve-attempts \
              --api-key 'My API Key' \
              --id 550e8400-e29b-41d4-a716-446655440000 \
              --delivery-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /notifications/catalog:
    get:
      tags:
        - Notifications
      summary: List notification event types
      description: >-
        Returns the catalog of notifiable event types grouped by source
        category. Each event lists its type identifier, label, and description,
        which can be referenced when muting event types in notification
        preferences.
      operationId: getNotificationCatalog
      responses:
        '200':
          description: Notifiable event catalog
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: string
                          example: triggers-api
                        label:
                          type: string
                          example: Workflows
                        events:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                example: workflow.run.completed
                              label:
                                type: string
                                example: Completed
                              description:
                                type: string
                            required:
                              - type
                              - label
                              - description
                      required:
                        - source
                        - label
                        - events
                required:
                  - data
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
  /notifications/preferences:
    get:
      tags:
        - Notifications
      summary: Get notification preferences
      description: >-
        Returns your current notification preferences, expressed as the list of
        event types you have muted. An empty list means notifications are
        enabled for all notifiable event types.
      operationId: getNotificationPreferences
      responses:
        '200':
          description: Muted event types
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      mutedTypes:
                        type: array
                        items:
                          type: string
                          minLength: 1
                          maxLength: 256
                        maxItems: 200
                        example:
                          - workflow.run.running
                          - task.run.running
                    required:
                      - mutedTypes
                required:
                  - data
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
    patch:
      tags:
        - Notifications
      summary: Update notification preferences
      description: >-
        Replaces your set of muted event types with the supplied list. Any
        unknown or non-notifiable types are dropped, and the response returns
        the muted types that were actually stored.
      operationId: updateNotificationPreferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mutedTypes:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 256
                  maxItems: 200
                  example:
                    - workflow.run.running
                    - task.run.running
              required:
                - mutedTypes
      responses:
        '200':
          description: Stored muted event types (unknown/non-notifiable types dropped)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      mutedTypes:
                        type: array
                        items:
                          type: string
                          minLength: 1
                          maxLength: 256
                        maxItems: 200
                        example:
                          - workflow.run.running
                          - task.run.running
                    required:
                      - mutedTypes
                required:
                  - data
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  schemas:
    Pagination:
      type: object
      properties:
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        page:
          type: integer
          minimum: 1
        pageSize:
          type: integer
          minimum: 1
        pages:
          type: integer
          minimum: 0
        total:
          type: integer
          minimum: 0
      required:
        - hasNext
        - hasPrev
        - page
        - pageSize
        - pages
        - total
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header
