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

# Create Endpoint

> Create an HTTP endpoint the assistant can call from a scenario tool.

Create an HTTP endpoint the assistant can call from a scenario `http` tool.

Required request fields:

* `name` (unique per user)
* `url`

Optional:

* `headers` — JSON object. Put `{{secret.*}}` placeholders here, not in `body`.
* `body` — JSON object. Use `{{runtime.*}}` / `{{llm.*}}` templates as needed.

Akapulu Labs invokes your URL with **POST** and a JSON body. Secrets themselves are still created in the [dashboard](https://akapulu.com/secrets/). See [Endpoints](/guides/endpoints/create-endpoint) and [Templates and variables](/guides/endpoints/templates-and-variables).


## OpenAPI

````yaml openapi/akapulu.json POST /endpoints/create
openapi: 3.1.0
info:
  title: Akapulu Labs API
  version: 1.0.0
  description: Public Akapulu Labs API reference.
servers:
  - url: https://akapulu.com/api
security:
  - bearerAuth: []
paths:
  /endpoints/create:
    post:
      tags:
        - Endpoints
      summary: Create endpoint
      description: Create an HTTP endpoint the assistant can call from a scenario tool.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEndpointRequest'
            examples:
              default:
                value:
                  name: Book Appointment
                  url: https://api.yourcompany.com/v1/book-appointment
                  headers:
                    Authorization: Bearer {{secret.crm_token}}
                  body:
                    patient_id: '{{runtime.patient_id}}'
      responses:
        '200':
          description: Endpoint created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMutationResponse'
              examples:
                success:
                  value:
                    status: created
                    id: 22222222-3333-4444-5555-666666666666
        '400':
          description: Invalid request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                default:
                  value:
                    error: name is required
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid_key:
                  value:
                    error: Invalid API key
components:
  schemas:
    CreateEndpointRequest:
      type: object
      required:
        - name
        - url
      properties:
        name:
          type: string
        url:
          type: string
        headers:
          type: object
          additionalProperties: true
          description: Request headers. Secrets belong here as {{secret.*}} placeholders.
        body:
          type: object
          additionalProperties: true
          description: >-
            JSON body templates. Cannot use {{secret.*}}; put secrets in
            headers.
    ResourceMutationResponse:
      type: object
      required:
        - status
        - id
      properties:
        status:
          type: string
        id:
          type: string
          format: uuid
        redirect_url:
          type: string
          description: Dashboard path. Ignore for API clients.
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````