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

# Create Endpoint

> Create a new custom endpoint for the current account.

Returns 409 if the account has reached the endpoint limit, or if a
conflicting (account_id, path, method) combination already exists.
Returns 422 if the path is invalid or conflicts with a built-in route.



## OpenAPI

````yaml post /api/v1/endpoints
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/endpoints:
    post:
      tags:
        - endpoints
        - Endpoints
      summary: Create Endpoint
      description: |-
        Create a new custom endpoint for the current account.

        Returns 409 if the account has reached the endpoint limit, or if a
        conflicting (account_id, path, method) combination already exists.
        Returns 422 if the path is invalid or conflicts with a built-in route.
      operationId: create_endpoint_api_v1_endpoints_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndpointCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EndpointCreateRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
          description: Human-readable name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description
        path:
          type: string
          title: Path
          description: >-
            URL path starting with /. Supports :param segments (e.g.
            /users/:user_id/orders). Must not shadow built-in routes.
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          title: Method
          description: HTTP method
        auth_required:
          type: boolean
          title: Auth Required
          description: 'Whether a valid auth token is required (default: true)'
          default: true
        condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Condition
          description: Optional rule expression; request denied (403) if it evaluates False
        actions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Actions
          description: Ordered list of action configs to execute sequentially
        response_template:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Template
          description: >-
            HTTP response template: {"status": 200, "body": {...}, "headers":
            {...}}. Supports {{template}} variables from request context and
            action results.
        enabled:
          type: boolean
          title: Enabled
          description: Whether the endpoint is active on creation
          default: true
      type: object
      required:
        - name
        - path
        - method
      title: EndpointCreateRequest
      description: Request body for creating a custom endpoint.
    EndpointResponse:
      properties:
        id:
          type: string
          title: Id
        account_id:
          type: string
          title: Account Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        path:
          type: string
          title: Path
        method:
          type: string
          title: Method
        auth_required:
          type: boolean
          title: Auth Required
        condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Condition
        actions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Actions
        response_template:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Template
        enabled:
          type: boolean
          title: Enabled
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
      type: object
      required:
        - id
        - account_id
        - name
        - description
        - path
        - method
        - auth_required
        - condition
        - actions
        - response_template
        - enabled
        - created_at
        - updated_at
        - created_by
      title: EndpointResponse
      description: Response schema for a single custom endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````