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

# Call a generated endpoint



## OpenAPI

````yaml /openapi.json post /v1/apis/{api_id}/endpoints/{endpoint_name}:call
openapi: 3.1.0
info:
  title: Peel API
  version: '2026-03-21'
  description: >-
    Public Peel API for creating APIs from URLs, inspecting them, calling
    generated endpoints, revising builds, and exporting OpenAPI or MCP
    definitions.
servers:
  - url: https://api.peel.sh
security: []
tags:
  - name: APIs
    description: Create, list, inspect, revise, rebuild, and export APIs.
  - name: Account
    description: Credits and account usage surfaces used by CLI, REST, and MCP clients.
  - name: Device Auth
    description: CLI browser-login device flow helpers.
  - name: Endpoint Execution
    description: Execute generated endpoints through a stable API resource.
  - name: OAuth
    description: OAuth discovery and token flows for hosted MCP clients.
  - name: MCP
    description: Hosted MCP transport and discovery surface.
paths:
  /v1/apis/{api_id}/endpoints/{endpoint_name}:call:
    post:
      tags:
        - Endpoint Execution
      summary: Call a generated endpoint
      operationId: callApiEndpoint
      parameters:
        - $ref: '#/components/parameters/ApiId'
        - in: path
          name: endpoint_name
          required: true
          schema:
            type: string
        - in: header
          name: X-Session-ID
          required: false
          schema:
            type: string
          example: SESSION_ID
          description: >-
            Target-site session ID returned by a login endpoint. Required for
            session_required endpoints.
        - in: header
          name: X-Encryption-Key
          required: false
          schema:
            type: string
          example: ENCRYPTION_KEY
          description: >-
            Target-site encryption key returned by a login endpoint. Required
            with X-Session-ID for session_required endpoints.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                params:
                  type: object
                  additionalProperties: true
                  description: >-
                    Endpoint parameters. If omitted, top-level body fields are
                    treated as endpoint parameters for CLI/backward
                    compatibility.
                session_id:
                  type: string
                  description: Body fallback for target-site session credentials.
                encryption_key:
                  type: string
                  description: Body fallback for target-site session credentials.
              additionalProperties: true
            examples:
              topLevelParams:
                summary: Call with top-level endpoint params
                value:
                  limit: 10
              paramsEnvelope:
                summary: Call with explicit params envelope
                value:
                  params:
                    limit: 10
              sessionBodyFallback:
                summary: Call a session-required endpoint with body credentials
                value:
                  params:
                    status: open
                  session_id: SESSION_ID
                  encryption_key: ENCRYPTION_KEY
      responses:
        '200':
          description: >-
            Endpoint execution envelope. Runtime failures that do not map to a
            more specific transport status may also return 200 with
            status:error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Runtime execution envelope for a target block or policy rejection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: API exists but is not ready yet.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  status:
                    type: string
                additionalProperties: false
        '422':
          description: Runtime execution envelope for extraction or validation failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '429':
          description: Runtime execution envelope for target or upstream rate limiting.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '502':
          description: Runtime execution envelope for target transport failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '503':
          description: >-
            Runtime execution envelope for temporary execution capacity or
            retryable runtime failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
        '504':
          description: Runtime execution envelope for timeout.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEndpointExecutionResponse'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    ApiId:
      in: path
      name: api_id
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    PublicEndpointExecutionResponse:
      type: object
      required:
        - status
        - status_code
        - data
        - error
        - error_code
        - execution_time
      properties:
        status:
          oneOf:
            - type: string
            - type: 'null'
        status_code:
          oneOf:
            - type: number
            - type: 'null'
        data: {}
        error:
          oneOf:
            - type: string
            - type: 'null'
        error_code:
          oneOf:
            - type: string
            - type: 'null'
        execution_time:
          oneOf:
            - type: number
            - type: 'null'
        transport:
          oneOf:
            - type: string
              enum:
                - html_tls
                - html_browser
                - http_replay
                - http_flow
                - graphql_replay
            - type: 'null'
        initiates_session:
          type: boolean
        session_id:
          oneOf:
            - type: string
            - type: 'null'
        encryption_key:
          oneOf:
            - type: string
            - type: 'null'
        raw_output:
          oneOf:
            - type: string
            - type: 'null'
      additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            additionalProperties: true
    Unauthorized:
      description: Missing or invalid auth.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: OAuth bearer challenge with MCP resource metadata when available.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            additionalProperties: true
    NotFound:
      description: Requested API or endpoint was not found.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````