---
title: Endpoint
description: Endpoint protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

API Mapping Schema

Transform input/output data.

<Callout type="info">
**Source:** `packages/spec/src/api/endpoint.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { ApiEndpoint, ApiMapping } from '@objectstack/spec/api';
import type { ApiEndpoint, ApiMapping } from '@objectstack/spec/api';

// Validate data
const result = ApiEndpoint.parse(data);
```

---

## ApiEndpoint

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Unique endpoint ID |
| **path** | `string` | ✅ | URL Path (e.g. /api/v1/customers) |
| **method** | `Enum<'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH' \| 'HEAD' \| 'OPTIONS'>` | ✅ | HTTP Method |
| **summary** | `string` | optional |  |
| **description** | `string` | optional |  |
| **type** | `Enum<'flow' \| 'script' \| 'object_operation' \| 'proxy'>` | ✅ | Implementation type |
| **target** | `string` | ✅ | Target Flow ID, Script Name, or Proxy URL |
| **objectParams** | `Object` | optional | For object_operation type |
| **inputMapping** | `Object[]` | optional | Map Request Body to Internal Params |
| **outputMapping** | `Object[]` | optional | Map Internal Result to Response Body |
| **authRequired** | `boolean` | ✅ | Require authentication |
| **rateLimit** | `Object` | optional | Rate limiting policy |
| **cacheTtl** | `number` | optional | Response cache TTL in seconds |


---

## ApiMapping

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **source** | `string` | ✅ | Source field/path |
| **target** | `string` | ✅ | Target field/path |
| **transform** | `string` | optional | Transformation function name |


---

