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

# Create an API endpoint

> Publish a scraper as a typed REST endpoint at `https://app.manypi.com/v1/e/{slug}`.

Slugs are unique per account and resolve within the key owner's endpoints, so your slug namespace is your own.

Requires the `write` permission.



## OpenAPI

````yaml POST /api/endpoints
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:
  /api/endpoints:
    post:
      tags:
        - Endpoints
      summary: Create an API endpoint
      description: >-
        Publish a scraper as a typed REST endpoint at
        `https://app.manypi.com/v1/e/{slug}`.


        Slugs are unique per account and resolve within the key owner's
        endpoints, so your slug namespace is your own.


        Requires the `write` permission.
      operationId: createEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - slug
                - name
                - scraper_id
              properties:
                slug:
                  type: string
                  minLength: 2
                  maxLength: 64
                  pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
                  description: Lowercase letters, digits and dashes.
                name:
                  type: string
                  maxLength: 120
                description:
                  type: string
                  maxLength: 2000
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                  default: GET
                scraper_id:
                  type: string
                  format: uuid
                param_schema:
                  type: object
                  nullable: true
                  description: JSON Schema for the input. Validated on every call.
                output_schema:
                  type: object
                  nullable: true
                freshness:
                  type: string
                  enum:
                    - cached_ok
                    - always_fresh
                  default: cached_ok
                cache_ttl_seconds:
                  type: integer
                  minimum: 0
                  maximum: 604800
                  default: 3600
                mode:
                  type: string
                  enum:
                    - sync
                    - async
                  default: sync
            example:
              slug: product-price
              name: Product price lookup
              scraper_id: …
              param_schema:
                type: object
                properties:
                  url:
                    type: string
                required:
                  - url
              cache_ttl_seconds: 3600
      responses:
        '201':
          description: The created endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Endpoint'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Endpoint limit reached for the plan.
        '404':
          description: Scraper not found.
        '409':
          description: That slug is already in use.
components:
  schemas:
    Endpoint:
      type: object
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        method:
          type: string
          enum:
            - GET
            - POST
        scraper_id:
          type: string
          format: uuid
        param_schema:
          type: object
          nullable: true
        output_schema:
          type: object
          nullable: true
        freshness:
          type: string
          enum:
            - cached_ok
            - always_fresh
        cache_ttl_seconds:
          type: integer
        mode:
          type: string
          enum:
            - sync
            - async
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: >-
            A machine-readable code on gated failures: `lead_limit`,
            `outreach_locked`, `validation_credits_exhausted`.
  responses:
    BadRequest:
      description: The request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    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'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A ManyPI API key (`mpi_...`) from Settings → API keys, or an OAuth 2.1
        access token obtained through the MCP consent flow.

````