---
title: "Create an action for a custom provider"
method: POST
path: "/credits/custom-endpoints/{providerId}/endpoints"
tags: ["Custom APIs"]
---

# Create an action for a custom provider

`POST /credits/custom-endpoints/{providerId}/endpoints`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}/endpoints`
- Auth: HTTP bearer

Creates one disabled-by-default or explicitly enabled action. Its input schema must describe an object, its example must validate, path placeholders must resolve to scalar schema properties, and the top-level names externalUserId, attribution, and _locus are reserved for Locus transport controls. Publishing an enabled action requires a positive end-user price.

## Path parameters

- `providerId` string, uuid, required

## Request body

- CustomEndpointCreateRequest
  - `slug` string, required: Stable 3–64 character action name.
  - `name` string, required
  - `description` string, required
  - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', required
  - `path` string, required: Upstream path. Placeholders must reference required scalar properties from inputSchema.
  - `inputSchema` object, required: Compilable JSON Schema, at most 64 KiB and 32 levels deep, whose root type is object. Top-level transport-control names are reserved.
  - `inputExample` object, required: Executable example that must satisfy inputSchema.
  - `outputSchema` object, nullable: Optional JSON Schema, at most 64 KiB and 32 levels deep.
  - `outputExample` unknown
  - `providerCostUsdc` union, required: Upstream provider cost in USD, rounded up to six decimal places.
    - string: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
    - number
  - `markupBps` integer, required: Percentage markup, also limited by the workspace's effective cap.
  - `flatMarkupUsdc` union, required: Flat USD markup, also limited by the workspace's effective cap.
    - string: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
    - number
  - `enabled` boolean: Enabled actions must have a positive end-user price.

## Response `201`

Action created

- CustomEndpointResponse
  - `success` unknown, required
  - `endpoint` CustomEndpoint, required
    - `id` string, uuid, required
    - `slug` string, required
    - `publicSlug` string, required: Catalog and execution identity.
    - `name` string, required
    - `description` string, required
    - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', required
    - `path` string, required
    - `inputSchema` object, required
    - `inputExample` object, required
    - `outputSchema` object, nullable, required
    - `outputExample` unknown, required
    - `providerCostUsdc` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
    - `markupBps` integer, required
    - `flatMarkupUsdc` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
    - `endUserPriceUsdc` string, required: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
    - `enabled` boolean, required
    - `pricingRevision` integer, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid schema, example, path, pricing, or action configuration
- `403`: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
- `404`: Custom provider not found in this workspace
- `409`: That action slug is already in use for this provider

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
