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

# Notify a flow's approvers that a crew run waits on them

> Send the notification-center notice for one item a crew marked
`needs_approval`. Sending the same item and run twice stores one notice.



## OpenAPI

````yaml post /api/inbox-flows/internal/approvals
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/inbox-flows/internal/approvals:
    post:
      tags:
        - Inbox flows (internal)
      summary: Notify a flow's approvers that a crew run waits on them
      description: |-
        Send the notification-center notice for one item a crew marked
        `needs_approval`. Sending the same item and run twice stores one notice.
      operationId: notify_approval_api_inbox_flows_internal_approvals_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalIn'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalOut'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    ApprovalIn:
      properties:
        flow_name:
          type: string
          pattern: ^[A-Za-z0-9 _.-]{1,80}$
          title: Flow Name
          description: The flow's name.
        item_id:
          type: string
          pattern: ^[0-9a-f]{32}$
          title: Item Id
          description: The item's id in the flow_item table.
        item_type:
          type: string
          pattern: ^[a-z][a-z _-]{0,31}$
          title: Item Type
          description: >-
            What the source calls the item the crew looked at, e.g. `email` or
            `file`.
        crew_correlation_id:
          type: string
          maxLength: 64
          minLength: 1
          title: Crew Correlation Id
          description: The crew run that asked for approval.
        run_as:
          type: string
          pattern: ^[A-Za-z0-9_.@-]{1,256}$
          title: Run As
          description: Keycloak username the flow and its crew run as.
        users:
          items:
            type: string
          type: array
          maxItems: 20
          title: Users
          description: Keycloak usernames to notify.
        roles:
          items:
            type: string
          type: array
          maxItems: 5
          title: Roles
          description: Platform roles (`nx1_` only) whose members are notified.
      type: object
      required:
        - flow_name
        - item_id
        - item_type
        - crew_correlation_id
        - run_as
      title: ApprovalIn
      description: A crew handling one email or file asked a person to decide.
    ApprovalOut:
      properties:
        notified:
          type: boolean
          title: Notified
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
      type: object
      required:
        - notified
      title: ApprovalOut
      description: >-
        Whether a notification was stored (false when it was a duplicate or had
        no one to tell).
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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