B3

B3 Orgs API

The Orgs API from B3 — 6 operation(s) for orgs.

OpenAPI Specification

b3-orgs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  description: Workflow management API for B3OS
  title: B3OS Workflow Action Orgs API
  version: '1.0'
tags:
- name: Orgs
paths:
  /v1/orgs/{orgId}/integrations/pipedream:
    post:
      description: Handle Pipedream trigger source webhook event
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Webhook secret
        in: query
        name: secret
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - type: object
              - additionalProperties: {}
                title: body
                type: object
        description: Pipedream event payload
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.IntegrationResult'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Not Found
      tags:
      - Orgs
  /v1/orgs/{orgId}/integrations/shopify:
    post:
      description: Handle Shopify webhook event
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Webhook secret
        in: query
        name: secret
        required: true
        schema:
          type: string
      - description: Shopify topic (e.g., orders/create)
        in: header
        name: X-Shopify-Topic
        required: true
        schema:
          type: string
      - description: Shop domain (e.g., my-store.myshopify.com)
        in: header
        name: X-Shopify-Shop-Domain
        required: true
        schema:
          type: string
      - description: HMAC signature for payload verification
        in: header
        name: X-Shopify-Hmac-SHA256
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - type: object
              - additionalProperties: {}
                title: body
                type: object
        description: Shopify webhook payload
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.IntegrationResult'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Not Found
      tags:
      - Orgs
  /v1/orgs/{orgId}/integrations/telegram:
    post:
      description: Handle Telegram webhook update
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Webhook secret
        in: query
        name: secret
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - type: object
              - additionalProperties: {}
                title: body
                type: object
        description: Telegram update payload
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.IntegrationResult'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Not Found
      tags:
      - Orgs
  /v1/orgs/{orgId}/integrations/webhook:
    post:
      description: Handle generic webhook trigger (secret identifies workflow)
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Per-workflow webhook secret (identifies the workflow)
        in: query
        name: secret
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - type: object
              - $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.GenericWebhookPayload'
                summary: body
                description: Optional payload data
        description: Optional payload data
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.IntegrationResult'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Not Found
      tags:
      - Orgs
  /v1/orgs/{orgId}/invites:
    get:
      description: List pending invites for an organization
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Number of items (default 20, max 100)
        in: query
        name: limit
        schema:
          type: integer
      - description: Offset for pagination (default 0)
        in: query
        name: offset
        schema:
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOrgInvitesSuccessResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
      tags:
      - Orgs
  /v1/orgs/{orgId}/members:
    get:
      description: List all members of an organization
      parameters:
      - description: Organization ID
        in: path
        name: orgId
        required: true
        schema:
          type: string
      - description: Number of items (default 20, max 100)
        in: query
        name: limit
        schema:
          type: integer
      - description: Offset for pagination (default 0)
        in: query
        name: offset
        schema:
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMembersSuccessResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse'
          description: Bad Request
      tags:
      - Orgs
components:
  schemas:
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.ForEachLevel:
      properties:
        index:
          description: Current iteration index (0, 1, 2...)
          type: integer
        parentNodeId:
          description: For-each node ID (e.g., "for_each_send")
          type: string
        total:
          description: Total iterations (for progress tracking)
          type: integer
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.IntegrationResult:
      properties:
        action:
          description: '"triggered", "resumed", "skipped"'
          type: string
        eventId:
          description: Webhook event ID for audit
          type: string
        reason:
          description: If skipped, the reason
          type: string
        runIds:
          description: Multiple if fan-out (platform) or single (generic)
          items:
            type: string
          type: array
          uniqueItems: false
      type: object
    PaginatedData-github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity_OrganizationMember:
      properties:
        hasMore:
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationMember'
          type: array
          uniqueItems: false
        limit:
          type: integer
        offset:
          type: integer
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationInvite:
      properties:
        createdAt:
          type: string
        expiresAt:
          type: string
        id:
          type: string
        invitedBy:
          type: string
        inviteeEmail:
          type: string
        inviteeUserId:
          type: string
        organizationId:
          type: string
        role:
          $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationRole'
        status:
          $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.InviteStatus'
        updatedAt:
          type: string
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationMember:
      properties:
        createdAt:
          type: string
        id:
          type: string
        invitedBy:
          type: string
        organizationId:
          type: string
        role:
          $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationRole'
        updatedAt:
          type: string
        userId:
          type: string
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.InviteStatus:
      enum:
      - pending
      - accepted
      - declined
      - expired
      type: string
      x-enum-varnames:
      - InviteStatusPending
      - InviteStatusAccepted
      - InviteStatusDeclined
      - InviteStatusExpired
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.ForEachContext:
      description: For wait resume inside for-each
      properties:
        index:
          type: integer
        parentNodeId:
          description: 'Legacy fields kept for backward-compatible JSON deserialization.

            New code should only use Stack.'
          type: string
        stack:
          description: 'Stack holds nesting levels from outermost to innermost.

            Single-level for-each uses a stack of length 1.'
          items:
            $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.ForEachLevel'
          type: array
          uniqueItems: false
        total:
          type: integer
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_service_integration.GenericWebhookPayload:
      properties:
        data:
          additionalProperties: {}
          type: object
        forEachContext:
          $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.ForEachContext'
        nodeId:
          description: For wait resume
          type: string
        runId:
          description: For wait resume
          type: string
        workflowId:
          type: string
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationRole:
      enum:
      - owner
      - developer
      type: string
      x-enum-varnames:
      - OrgRoleOwner
      - OrgRoleDeveloper
    PaginatedData-github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity_OrganizationInvite:
      properties:
        hasMore:
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity.OrganizationInvite'
          type: array
          uniqueItems: false
        limit:
          type: integer
        offset:
          type: integer
      type: object
    ListOrgInvitesSuccessResponse:
      properties:
        code:
          example: 200
          type: integer
        data:
          $ref: '#/components/schemas/PaginatedData-github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity_OrganizationInvite'
        message:
          example: success
          type: string
        requestId:
          example: req_abc123
          type: string
      type: object
    github_com_b3-fun_b3-mono_services_b3os-workflow_internal_app_api_http.ErrorResponse:
      properties:
        code:
          type: integer
        details:
          items: {}
          type: array
          uniqueItems: false
        message:
          type: string
        requestId:
          type: string
      type: object
    ListMembersSuccessResponse:
      properties:
        code:
          example: 200
          type: integer
        data:
          $ref: '#/components/schemas/PaginatedData-github_com_b3-fun_b3-mono_services_b3os-workflow_internal_pkg_entity_OrganizationMember'
        message:
          example: success
          type: string
        requestId:
          example: req_abc123
          type: string
      type: object