> ## 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.

# Resolve an approval

> Resolve an approval this app submitted, choosing one of its options or supplying free-text. Requires the `approvals:resolve` scope. An approval resolves exactly once.



## OpenAPI

````yaml /api-reference/openapi.json post /api/approvals/{id}/resolve
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/{id}/resolve:
    post:
      tags:
        - Approvals
      summary: Resolve an approval
      description: >-
        Resolve an approval this app submitted, choosing one of its options or
        supplying free-text. Requires the `approvals:resolve` scope. An approval
        resolves exactly once.
      operationId: resolveApproval
      parameters:
        - name: id
          in: path
          required: true
          description: Identifier of the approval.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalResolution'
      responses:
        '200':
          description: The approval was resolved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                properties:
                  ok:
                    type: boolean
                    const: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The approval is already resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ApprovalResolution:
      type: object
      required:
        - kind
      discriminator:
        propertyName: kind
      oneOf:
        - type: object
          title: Option
          required:
            - kind
            - optionId
          properties:
            kind:
              type: string
              const: option
            optionId:
              type: string
              description: The chosen option's `id`.
              examples:
                - ship
            note:
              type: string
              description: Optional note attached to the resolution.
        - type: object
          title: Other
          required:
            - kind
            - otherText
          properties:
            kind:
              type: string
              const: other
            otherText:
              type: string
              description: Free-text answer when none of the options fit.
              examples:
                - Ship to staging only
            note:
              type: string
              description: Optional note attached to the resolution.
    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
    NotFound:
      description: No such resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not found
  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.

````