---
title: "Post field"
method: POST
path: "/schema/{table}/field"
tags: ["Schema"]
---

# Post field

`POST /schema/{table}/field`

## Request

- Base URL: `https://api.lytics.io/v2`
- URL: `https://api.lytics.io/v2/schema/{table}/field`
- Auth: API key in header `Authorization`

Upsert a field in draft schema.

## Path parameters

- `table` string, required

## Query parameters

- `account_id` string

## Request body `*/*`

- ModelsField
  - `assertions` ModelsAssertions
    - `email` boolean: Asserts that the field is an email address
    - `filter` string[]: []string is the type of v2schema.Filter
    - `format` 'alpha' | 'alphanumeric' | 'uuid' | 'base64' | 'hex' | 'int' | 'any': Asserts the format of string fields. If this is set to any value other than "any", the incoming data will be validated against the specified format for all mappings to this field. If the format does not match, the mapping will ignore the input.
    - `length` object
      - `max` integer: Maximum length of the field
      - `min` integer: Minimum length of the field
  - `capacity` integer: Specifies the capacity for fields of type set or map
  - `created` string, date-time
  - `disable_indexing` boolean
  - `edit_status` string
  - `id` string: ID, or name of field
  - `id_config` ModelsIDConfig
    - `changes` V2schemadiffSchemaChange
      - `diff` V2schemadiffDiff[]: Diff will be empty if verb is "created" or "removed".
        - `from_val` unknown
        - `property` string: Property can be field type, mapping expression, etc.
        - `to_val` unknown
      - `id` string: ID will be field name, mapping ID, rank setting field, or empty for "rank" source type.
      - `subject` 'mapping' | 'field' | 'rank' | 'rank_setting'
      - `verb` 'created' | 'removed' | 'modified'
    - `compact_after_days` integer
    - `compact_over` integer
    - `created` string
    - `edit_status` string
    - `field` string
    - `many_to` string[]
    - `modified` string
  - `is_identifier` boolean
  - `is_pii` boolean
  - `keep_days` integer: TTL for fields of type set or map, in days
  - `keep_duration` string: TTL for field of type set or map, must match keep_days if both are defined ie: 7d
  - `longdesc` string
  - `managed_by` string
  - `mergeop` string
  - `modified` string
  - `shortdesc` string
  - `tags` string[]
  - `type` string

## Response `200`

Field

- object
  - `_meta` object: Response Metadata
  - `data` object: Response Payload
    - `assertions` ModelsAssertions
      - `email` boolean: Asserts that the field is an email address
      - `filter` string[]: []string is the type of v2schema.Filter
      - `format` 'alpha' | 'alphanumeric' | 'uuid' | 'base64' | 'hex' | 'int' | 'any': Asserts the format of string fields. If this is set to any value other than "any", the incoming data will be validated against the specified format for all mappings to this field. If the format does not match, the mapping will ignore the input.
      - `length` object
        - `max` integer: Maximum length of the field
        - `min` integer: Minimum length of the field
    - `capacity` integer: Specifies the capacity for fields of type set or map
    - `created` string, date-time
    - `disable_indexing` boolean
    - `edit_status` string
    - `id` string: ID, or name of field
    - `id_config` ModelsIDConfig
      - `changes` V2schemadiffSchemaChange
        - `diff` V2schemadiffDiff[]: Diff will be empty if verb is "created" or "removed".
          - `from_val` unknown
          - `property` string: Property can be field type, mapping expression, etc.
          - `to_val` unknown
        - `id` string: ID will be field name, mapping ID, rank setting field, or empty for "rank" source type.
        - `subject` 'mapping' | 'field' | 'rank' | 'rank_setting'
        - `verb` 'created' | 'removed' | 'modified'
      - `compact_after_days` integer
      - `compact_over` integer
      - `created` string
      - `edit_status` string
      - `field` string
      - `many_to` string[]
      - `modified` string
    - `is_identifier` boolean
    - `is_pii` boolean
    - `keep_days` integer: TTL for fields of type set or map, in days
    - `keep_duration` string: TTL for field of type set or map, must match keep_days if both are defined ie: 7d
    - `longdesc` string
    - `managed_by` string
    - `mergeop` string
    - `modified` string
    - `shortdesc` string
    - `tags` string[]
    - `type` string
  - `request_id` string
  - `status` integer: HTTP Status Code

## Other responses

- `201`: Field
- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2026-11-03** `d8e975057aec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/lytics/apis/lytics-api/changes/schema/:table/field/post.md)

---

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