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

# Ask a question on your paired phone and wait for an answer

> Sends a question — with 2–4 answer choices (default `["Approve","Deny"]`) — to the phone paired with the user behind the bearer token. The phone shows it as a high-priority notification; the first tap wins.

**Idempotent duplicates.** Re-sending the same `idempotency_key` (or, when it's omitted, the same `question` + `choices` from the same token) while a matching interaction is within its idempotency window (until its `expires_at`) returns the **existing** interaction with `200` instead of creating a new one — no second prompt reaches the phone. This holds even after the phone has already answered: the idempotency key outlives the answer, so a duplicate create after an answer still returns the same (now-answered) interaction's id, not a fresh one. A genuinely new request returns `201`.

Poll the result with `GET /v1/interactions/{id}`. Each owner may have at most **10 pending** interactions at once (`429 too_many_pending`); the owning account must have a paired phone device (`409 no_phone_device`).

**Phone-capability gate.** If the paired phone's reported app build is too old to show the prompt, the request is refused outright (`426 phone_app_outdated`) rather than accepted and silently dropped on arrival. A phone that has never reported its version is allowed through anyway (unknown builds fail open), but this is not yet surfaced back to the caller for this endpoint.



## OpenAPI

````yaml /openapi.yaml post /v1/interactions
openapi: 3.1.0
info:
  title: Reflecto API
  version: 1.1.0
  description: >-
    The Reflecto public HTTP API lets you push notifications to your own paired

    devices — your Android phone and any browser extensions you've paired with
    it.

    Designed for the same job as Pushover or the old Pushbullet API: a single

    HTTPS call from a script, cron job, or webhook puts a notification on every

    screen you own.


    Authentication uses opaque prefixed bearer tokens (`rfk_live_…`) created and

    managed on your paired Android device — there are no email accounts, no

    passwords, no server-side user records beyond device pairing state. See the

    Authentication guide for the token lifecycle.


    The public-API surface is small on purpose: `POST /v1/send`, its

    capability-URL alias `POST /v1/send/{token}`, and a Pushover-compatible shim

    at `POST /v1/messages.json`. Mirroring traffic from your phone to your

    extension never reaches this surface — it stays end-to-end encrypted via the

    private `/v1/sync` SSE stream.


    See the Guides tab for the quickstart, authentication model, rate-limit

    contract, and encryption posture.
  contact:
    name: Reflecto
    url: https://github.com/reflectoapp/reflecto
  license:
    name: MIT
    url: https://github.com/reflectoapp/reflecto/blob/main/LICENSE
servers:
  - url: https://api.reflecto.dev
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Send
    description: Push notifications to one or all of your paired devices.
  - name: Pushover compatibility
    description: >-
      Drop-in replacement for `POST https://api.pushover.net/1/messages.json`.
      Field names, request shape, and response shape mirror Pushover's so
      existing senders can migrate by changing a single URL. See [Pushover
      compatibility guide](/guides/pushover-compatibility) for the full mapping.
paths:
  /v1/interactions:
    post:
      tags:
        - Interactions
      summary: Ask a question on your paired phone and wait for an answer
      description: >-
        Sends a question — with 2–4 answer choices (default
        `["Approve","Deny"]`) — to the phone paired with the user behind the
        bearer token. The phone shows it as a high-priority notification; the
        first tap wins.


        **Idempotent duplicates.** Re-sending the same `idempotency_key` (or,
        when it's omitted, the same `question` + `choices` from the same token)
        while a matching interaction is within its idempotency window (until its
        `expires_at`) returns the **existing** interaction with `200` instead of
        creating a new one — no second prompt reaches the phone. This holds even
        after the phone has already answered: the idempotency key outlives the
        answer, so a duplicate create after an answer still returns the same
        (now-answered) interaction's id, not a fresh one. A genuinely new
        request returns `201`.


        Poll the result with `GET /v1/interactions/{id}`. Each owner may have at
        most **10 pending** interactions at once (`429 too_many_pending`); the
        owning account must have a paired phone device (`409 no_phone_device`).


        **Phone-capability gate.** If the paired phone's reported app build is
        too old to show the prompt, the request is refused outright (`426
        phone_app_outdated`) rather than accepted and silently dropped on
        arrival. A phone that has never reported its version is allowed through
        anyway (unknown builds fail open), but this is not yet surfaced back to
        the caller for this endpoint.
      operationId: createInteraction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInteractionRequest'
            examples:
              minimal:
                summary: Minimal — question only (default Approve/Deny choices)
                value:
                  question: Deploy to production?
              full:
                summary: Full — custom choices, expiry, idempotency key
                value:
                  question: 'Merge PR #482?'
                  choices:
                    - Merge
                    - Wait
                    - Close
                  expires_in: 300
                  idempotency_key: pr-482-merge-ask
      responses:
        '200':
          description: >-
            Idempotent duplicate — an existing interaction with the same
            idempotency key, still within its idempotency window (until its
            `expires_at`), was returned instead of creating a new one. No new
            prompt was sent to the phone. Can surface an already-answered
            interaction's id if the duplicate arrives after the phone answered
            but before expiry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInteractionResponse'
              examples:
                duplicate:
                  value:
                    id: int_3f6e2a7c9b1d4f8e8a5b6c1d2e3f4a5b
                    expires_at: 1754800000
        '201':
          description: >-
            Created — a new interaction was reserved and dispatched to the
            phone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInteractionResponse'
              examples:
                created:
                  value:
                    id: int_3f6e2a7c9b1d4f8e8a5b6c1d2e3f4a5b
                    expires_at: 1754800000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '426':
          $ref: '#/components/responses/UpgradeRequired'
        '429':
          $ref: '#/components/responses/RateLimitedInteractions'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateInteractionRequest:
      type: object
      properties:
        question:
          type: string
          description: The question shown on the phone. 1–1000 characters.
          example: Deploy to production?
        choices:
          type: array
          items:
            type: string
          minItems: 2
          maxItems: 4
          description: >-
            Answer labels rendered as buttons. 2–4 entries. Default
            ["Approve","Deny"].
          example:
            - Approve
            - Deny
        expires_in:
          type: integer
          minimum: 60
          maximum: 86400
          description: Seconds until the ask expires. 60–86400, default 600.
          example: 600
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            Client-supplied dedup key; server derives one from content hashes
            when absent.
      required:
        - question
    CreateInteractionResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            Interaction id (`int_` prefix). Poll it via `GET
            /v1/interactions/{id}`.
          example: int_3f6e2a7c9b1d4f8e8a5b6c1d2e3f4a5b
        expires_at:
          type: integer
          description: Unix epoch seconds when the interaction expires without an answer.
          example: 1754800000
      required:
        - id
        - expires_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: message_too_long
            message:
              type: string
              example: message must be ≤ 1500 bytes
            details:
              type: object
              additionalProperties: {}
          required:
            - code
            - message
      required:
        - error
    SimpleErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: invalid_token
        message:
          type: string
      required:
        - error
      description: >-
        Flat error shape used for auth failures — `invalid_token` carries only
        the stable code; `missing_token` adds a `message` hint pointing at the
        `Authorization: Bearer …` header. The `message` field is therefore
        optional.
  responses:
    BadRequest:
      description: Malformed payload or invalid field value.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidPriority:
              value:
                error:
                  code: invalid_priority
                  message: priority must be one of min, low, default, high, urgent
            messageTooLong:
              value:
                error:
                  code: message_too_long
                  message: message must be ≤ 1500 bytes
                  details:
                    bytes: 1620
                    max: 1500
            invalidFilename:
              summary: POST /v1/documents — blocked extension or unsafe name
              value:
                error:
                  code: invalid_filename
                  message: >-
                    filename must end in an allowed extension and be a safe name
                    (max 120 characters)
            invalidContent:
              summary: POST /v1/documents — empty content
              value:
                error:
                  code: invalid_content
                  message: content must not be empty
    Unauthorized:
      description: Missing, invalid, or revoked bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleErrorResponse'
          examples:
            missingToken:
              value:
                error: missing_token
                message: 'Authorization: Bearer rfk_live_… required'
            invalidToken:
              value:
                error: invalid_token
    Forbidden:
      description: Token exists but lacks scope for the requested action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            priorityCapped:
              value:
                error:
                  code: priority_capped
                  message: Token's priority_cap is 'default'; requested 'high'
    Conflict:
      description: The request conflicts with the current state of a resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noPhoneDevice:
              summary: Owner has no paired phone to ask
              value:
                error:
                  code: no_phone_device
                  message: no_phone_device
    UpgradeRequired:
      description: >-
        The target phone's Reflecto app is too old to receive this — update
        Reflecto on the phone from the Google Play Store before this can be
        delivered. Nothing was sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            phoneAppOutdated:
              value:
                error:
                  code: phone_app_outdated
                  message: >-
                    the paired phone's Reflecto app is too old to receive this —
                    update Reflecto on the phone from the Google Play Store
                    before this can be delivered; nothing was sent.
    RateLimitedInteractions:
      description: >-
        Rate limit or resource cap exceeded. For interaction creation this
        includes the 10-pending-per-owner cap; for ring and reminders, IP/token
        rate limits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimitExceeded:
              value:
                error:
                  code: rate_limit_exceeded
                  message: Rate limit hit
            tooManyPending:
              summary: Owner already has 10 pending interactions
              value:
                error:
                  code: too_many_pending
                  message: too_many_pending
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: rfk_live_…
      description: >-
        Opaque bearer token created on your paired Android phone. The format is
        `rfk_live_` followed by 32 URL-safe alphanumeric characters (≥160 bits
        of entropy). Test tokens use the `rfk_test_` prefix.

````