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

# Invoke an endpoint with a JSON body

> Call one of your published endpoints with its parameters as a JSON object. Values keep their JSON types, so numbers, booleans and nested objects arrive as sent. Works for every endpoint, whichever method it was created with.

Resolves exactly like `GET`: a fresh cached result immediately, otherwise the scrape runs inline for up to ~110 seconds, then `202` with a run id.

Requires the `endpoints:invoke` permission.



## OpenAPI

````yaml POST /v1/e/{slug}
openapi: 3.1.0
info:
  title: ManyPI API
  description: >-
    The REST API behind ManyPI — AI lead generation, email validation,
    cold-email outreach, agent runs and web scraping. Every endpoint is
    authenticated with a ManyPI API key (`mpi_...`) or an OAuth 2.1 access
    token, and honours the permissions granted to that credential.
  version: 2.0.0
  contact:
    name: ManyPI Support
    email: support@manypi.com
    url: https://manypi.com
servers:
  - url: https://app.manypi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Leads
    description: Find, store, enrich and manage leads.
  - name: Email validation
    description: Verify that lead addresses can receive mail.
  - name: Outreach
    description: Inboxes, sequences, campaigns, sending and replies.
  - name: Agent
    description: Agent runs, replies and skills.
  - name: Scraping
    description: Scrapers, runs and extracted data.
  - name: Endpoints
    description: Publish scrapers as typed REST endpoints.
  - name: Account
    description: Key validation and account information.
paths:
  /v1/e/{slug}:
    post:
      tags:
        - Endpoints
      summary: Invoke an endpoint with a JSON body
      description: >-
        Call one of your published endpoints with its parameters as a JSON
        object. Values keep their JSON types, so numbers, booleans and nested
        objects arrive as sent. Works for every endpoint, whichever method it
        was created with.


        Resolves exactly like `GET`: a fresh cached result immediately,
        otherwise the scrape runs inline for up to ~110 seconds, then `202` with
        a run id.


        Requires the `endpoints:invoke` permission.
      operationId: invokeEndpointWithBody
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              description: The endpoint's parameters, validated against its `param_schema`.
            example:
              url: https://example.com/product/42
      responses:
        '200':
          $ref: '#/components/responses/EndpointResult'
        '202':
          $ref: '#/components/responses/EndpointAccepted'
        '400':
          description: >-
            Parameters failed validation against the endpoint's schema.
            `details` lists what was wrong.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: The key lacks the `endpoints:invoke` permission.
        '404':
          description: No active endpoint with that slug for this account.
        '502':
          $ref: '#/components/responses/EndpointFailed'
components:
  responses:
    EndpointResult:
      description: >-
        The extracted data, matching the endpoint's output schema.
        `X-ManyPI-Cache` says whether it came from the cache (`hit`) or a fresh
        scrape (`miss`); `X-ManyPI-Run-Id` names the run behind it.
      headers:
        X-ManyPI-Cache:
          schema:
            type: string
            enum:
              - hit
              - miss
        X-ManyPI-Run-Id:
          schema:
            type: string
            format: uuid
        X-ManyPI-Cached-At:
          description: When the cached result was produced. Sent on cache hits only.
          schema:
            type: string
            format: date-time
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
    EndpointAccepted:
      description: >-
        Still running — the endpoint is `async`, or the scrape ran past the ~110
        second inline budget. Poll the URL in `poll` (also sent as `Location`)
        with `GET /v1/e/{slug}/results/{runId}`.
      headers:
        Location:
          schema:
            type: string
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - accepted
              run_id:
                type: string
                format: uuid
              poll:
                type: string
                description: >-
                  Path of the result to poll, e.g.
                  `/v1/e/{slug}/results/{runId}`.
          example:
            status: accepted
            run_id: b3c4d5e6-7f80-4912-a3b4-c5d6e7f8a901
            poll: /v1/e/product-price/results/b3c4d5e6-7f80-4912-a3b4-c5d6e7f8a901
    Unauthorized:
      description: >-
        Missing, invalid or expired credential — or a key that lacks the
        permission this route requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EndpointFailed:
      description: >-
        The scrape failed (`error: "Scrape failed"`), or it finished but the
        result did not match the endpoint's output schema. In the second case
        `details` lists the mismatches and `raw` carries the result that was
        produced — the credits for it are already spent.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              details: {}
              run_id:
                type: string
                format: uuid
              raw:
                type: object
                additionalProperties: true
  schemas:
    Error:
      type: object
      properties:
        error:
          description: >-
            Human-readable message. A few validation failures (creating or
            updating an endpoint, bulk lead updates and deletes) send a list of
            the individual problems here instead of one string.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type:
                        - string
                        - integer
                  message:
                    type: string
        code:
          type: string
          description: >-
            A machine-readable code on gated failures: `lead_limit`,
            `outreach_locked`, `validation_credits_exhausted`.
        details:
          description: >-
            Extra detail on some failures, such as the list of parameters that
            failed an endpoint's `param_schema`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A ManyPI API key (`mpi_...`) from the profile menu → API Access in the
        dashboard, or an OAuth 2.1 access token obtained through the MCP consent
        flow.

````

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