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

# Create Endpoint

> Create a new REST endpoint for the organization's automations



## OpenAPI

````yaml post /api/organizations/{organization_id}/automations/endpoints
openapi: 3.1.0
info:
  title: Axion Backend API
  description: Backend API for Axion platform with desktop automation capabilities
  version: 1.0.0
servers:
  - url: https://api.getgranite.ai
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Organizations
    description: Organization management and membership
  - name: Health
    description: API health and status monitoring
  - name: Automations
    description: Automation planning and execution
  - name: MIG
    description: Managed Instance Group operations
  - name: Agent
    description: Agent execution and streaming
  - name: Onboarding
    description: Organization onboarding flow
  - name: Organization Automations
    description: Organization automation endpoint management
  - name: Organization Endpoints
    description: Public endpoints for organization automations
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/organizations/{organization_id}/automations/endpoints:
    post:
      tags:
        - Organization Automations
      summary: Create a custom automation endpoint
      description: Create a new REST endpoint for the organization's automations
      operationId: createEndpoint
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            title: Organization Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEndpointRequest'
      responses:
        '200':
          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:
    CreateEndpointRequest:
      properties:
        slug:
          type: string
          title: Slug
          description: URL-friendly endpoint identifier
        method:
          type: string
          title: Method
          description: HTTP method (GET, POST, PUT, PATCH, DELETE)
        response_template:
          additionalProperties: true
          type: object
          title: Response Template
          description: Response template JSON
        request_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Request Schema
          description: Request schema JSON
        rpa_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Rpa Run Id
          description: RPA run_id to link for automation execution
        parameter_mapping:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameter Mapping
          description: Mapping of endpoint parameters to script parameters
      type: object
      required:
        - slug
        - method
        - response_template
      title: CreateEndpointRequest
      description: Request to create a custom automation endpoint
    EndpointResponse:
      properties:
        endpoint:
          $ref: '#/components/schemas/EndpointInfo'
          description: Endpoint information
      type: object
      required:
        - endpoint
      title: EndpointResponse
      description: Response containing a single endpoint
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EndpointInfo:
      properties:
        endpoint_id:
          type: string
          title: Endpoint Id
          description: Unique endpoint identifier
        slug:
          type: string
          title: Slug
          description: URL-friendly endpoint identifier
        method:
          type: string
          title: Method
          description: HTTP method
        response_template:
          additionalProperties: true
          type: object
          title: Response Template
          description: Response template JSON
        request_schema:
          additionalProperties: true
          type: object
          title: Request Schema
          description: Request schema JSON
        is_active:
          type: boolean
          title: Is Active
          description: Whether the endpoint is active
        rpa_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Rpa Run Id
          description: Linked RPA run_id for automation
        parameter_mapping:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameter Mapping
          description: Parameter mapping for RPA execution
        created_at:
          type: string
          title: Created At
          description: Creation timestamp
        updated_at:
          type: string
          title: Updated At
          description: Last update timestamp
      type: object
      required:
        - endpoint_id
        - slug
        - method
        - response_template
        - request_schema
        - is_active
        - created_at
        - updated_at
      title: EndpointInfo
      description: Custom endpoint information
    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

````