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

# Submit an approval

> Submit an approval for the owner to decide. Requires the `approvals:write` scope. The approval lands in the owner's Approvals inbox in ego.



## OpenAPI

````yaml /api-reference/openapi.json post /api/approvals
openapi: 3.1.0
info:
  title: ego API
  version: 0.0.0
  description: >-
    Preview specification for the ego API. ego sits between your data and the
    agents that read it, granting access one scope at a time. Each endpoint
    requires the native scope named in its description, granted on the consent
    screen and carried on the bearer token.
servers:
  - url: https://api.myego.dev
    description: Preview — not yet live
security:
  - bearerAuth: []
paths:
  /api/approvals:
    post:
      tags:
        - Approvals
      summary: Submit an approval
      description: >-
        Submit an approval for the owner to decide. Requires the
        `approvals:write` scope. The approval lands in the owner's Approvals
        inbox in ego.
      operationId: createApproval
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalCreate'
      responses:
        '201':
          description: The approval was created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    description: Identifier of the created approval.
                    examples:
                      - k1722abcd
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    ApprovalCreate:
      type: object
      required:
        - question
        - options
      properties:
        question:
          type: string
          description: The decision the owner must make.
          examples:
            - Ship the 2.0 release?
        options:
          type: array
          description: The options the owner can choose from.
          items:
            $ref: '#/components/schemas/ApprovalOption'
        backgroundContext:
          type: string
          description: Optional context to help the owner decide.
        recommendation:
          type: string
          description: Optional recommended option or course of action.
    ApprovalOption:
      type: object
      required:
        - id
        - label
      properties:
        id:
          type: string
          description: Stable identifier for the option, returned in the resolution.
          examples:
            - ship
        label:
          type: string
          description: Human-readable label shown to the owner.
          examples:
            - Ship it
        note:
          type: string
          description: Optional detail shown beneath the label.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A human-readable error message.
          examples:
            - Unauthorized
  responses:
    BadRequest:
      description: The request was malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Bad request
    Unauthorized:
      description: The token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    Forbidden:
      description: The token lacks the scope this endpoint requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Forbidden
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass your ego access token as a bearer token: `Authorization: Bearer
        <token>`. The token carries the scopes granted on the consent screen.

````