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

# Update Endpoint

> Update an HTTP endpoint owned by the API key's user.

Update an HTTP endpoint you own. The request must include `id` plus the full `name`, `url`, `headers`, and `body` fields (same shape as create).


## OpenAPI

````yaml openapi/akapulu.json POST /endpoints/update
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/update:
    post:
      tags:
        - Endpoints
      summary: Update endpoint
      description: Update an HTTP endpoint owned by the API key's user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEndpointRequest'
            examples:
              default:
                value:
                  id: 22222222-3333-4444-5555-666666666666
                  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 updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMutationResponse'
              examples:
                success:
                  value:
                    status: updated
                    id: 22222222-3333-4444-5555-666666666666
        '400':
          description: Invalid request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                default:
                  value:
                    error: id 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
        '404':
          description: Endpoint not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                default:
                  value:
                    error: HttpEndpoint not found
components:
  schemas:
    UpdateEndpointRequest:
      allOf:
        - type: object
          required:
            - id
          properties:
            id:
              type: string
              format: uuid
        - $ref: '#/components/schemas/CreateEndpointRequest'
    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.
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````