---
title: "Create Custom Api"
method: POST
path: "/api/custom-apis"
tags: ["Custom API Management"]
---

# Create Custom Api

`POST /api/custom-apis`

Create a new Custom API.

## Request body

- CustomApiCreate — Request model for creating a Custom API.
  - `name` string, required — API name
  - `description` string, nullable — API description
  - `url` string, nullable — API URL
  - `method` string, nullable — HTTP method
  - `headers` object, nullable — HTTP headers
  - `body` string, nullable — HTTP body (JSON template)
  - `env` object, nullable — Environment variables (secrets)
  - `is_active` boolean — Whether the API is active

## Response `201`

Successful Response

- CustomApiResponse — Response model for Custom API.
  - `id` integer, required
  - `user_id` integer, required
  - `name` string, required
  - `description` string, nullable, required
  - `url` string, nullable, required
  - `method` string, nullable, required
  - `headers` object, nullable, required
  - `body` string, nullable, required
  - `env` object, nullable, required
  - `is_active` boolean, required
  - `is_default` boolean, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
