---
title: "POST /api/{version}/organizations/{orgId}/projects/{projId}/grapes"
method: POST
path: "/api/{version}/organizations/{orgId}/projects/{projId}/grapes"
tags: ["Grapes"]
---

# POST /api/{version}/organizations/{orgId}/projects/{projId}/grapes

`POST /api/{version}/organizations/{orgId}/projects/{projId}/grapes`

## Path parameters

- `orgId` string, required
- `projId` string, required
- `version` string, required

## Request body

- CreateGrapeRequest
  - `name` string, nullable
  - `details` CreateGrapeDetailTableRef[], nullable
    - `tableName` string, nullable
    - `databaseId` string, nullable
    - `filter` FilterRuleset
      - `filterType` string, nullable
      - `condition` 'AND' | 'OR'
      - `rules` IFilterComponent[], nullable
        - `filterType` string, nullable
    - `sampling` SamplingModel
      - `take` string, nullable
      - `sort` SortDetailModel[], nullable
        - `order` integer
        - `field` string, nullable
        - `direction` string, nullable
    - `tableStyle` TableStyle
      - `position` Point
        - `isEmpty` boolean
        - `x` integer
        - `y` integer
      - `color` string, nullable
    - `mergeOptions` GrapeMergeOptionsModel
      - `mergeMode` 'Insert' | 'Merge'
      - `basedOnFields` string[], nullable
  - `compositeRelations` CompositeRelationDto[], nullable
    - `name` string, nullable
    - `fromTable` string, nullable
    - `toTable` string, nullable
    - `columnMappings` RelationColumnMappingDto[], nullable
      - `fromColumn` string, nullable
      - `toColumn` string, nullable
    - `fromDatabase` string, nullable
    - `toDatabase` string, nullable
  - `parameters` GrapeParameterDto[], nullable
    - `name` string, nullable
    - `dataType` 'String' | 'Number' | 'Boolean' | 'Date' | 'Binary' | 'Unknown'
    - `defaultValue` string, nullable

## Response `200`

OK

- GrapeDtoItemResponse
  - `item` GrapeDto
    - `id` string, nullable
    - `name` string, nullable
    - `details` GrapeDetailDto[], nullable
      - `tableName` string, nullable
      - `databaseId` string, nullable
      - `filter` FilterRuleset
        - `filterType` string, nullable
        - `condition` 'AND' | 'OR'
        - `rules` IFilterComponent[], nullable
          - `filterType` string, nullable
      - `anonymisers` IAnonymiserComponent[], nullable
        - `type` string, nullable
        - `field` string, nullable
      - `sampling` SamplingModel
        - `take` string, nullable
        - `sort` SortDetailModel[], nullable
          - `order` integer
          - `field` string, nullable
          - `direction` string, nullable
      - `tableStyle` TableStyle
        - `position` Point
          - `isEmpty` boolean
          - `x` integer
          - `y` integer
        - `color` string, nullable
      - `mergeOptions` GrapeMergeOptionsDto
        - `mergeMode` 'Insert' | 'Merge'
        - `basedOnFields` string[], nullable
    - `databases` DatabaseSchemaDto[], nullable
      - `database` DatabaseDto
        - `id` string, nullable
        - `name` string, nullable
        - `type` 'SqlServer' | 'MySql'
        - `environments` DatabaseEnvironmentDto[], nullable
          - `environmentId` string, nullable
          - `infrastructureId` string, nullable
      - `schema` SchemaDto
        - `tables` TableDto[], nullable
          - `name` string, nullable
          - `fields` FieldDto[], nullable
            - `name` string, nullable
            - `dataType` string, nullable
            - `innerDataType` string, nullable
            - `dataTypeGroup` 'String' | 'Number' | 'Boolean' | 'Date' | 'Binary' | 'Unknown'
            - `nullable` boolean
            - `isAutoGenerated` boolean
            - `isComputed` boolean
            - `isPrimaryKey` boolean
        - `relations` RelationDto[], nullable
          - `name` string, nullable
          - `fromTable` string, nullable
          - `toTable` string, nullable
          - `columnMappings` RelationColumnMappingDto[], nullable
            - `fromColumn` string, nullable
            - `toColumn` string, nullable
        - `uniqueIndexes` UniqueIndexDto[], nullable
          - `table` string, nullable
          - `indexName` string, nullable
          - `columns` UniqueIndexColumnDto[], nullable
            - `ordinal` integer
            - `name` string, nullable
    - `compositeRelations` CompositeRelationDto[], nullable
      - `name` string, nullable
      - `fromTable` string, nullable
      - `toTable` string, nullable
      - `columnMappings` RelationColumnMappingDto[], nullable
        - `fromColumn` string, nullable
        - `toColumn` string, nullable
      - `fromDatabase` string, nullable
      - `toDatabase` string, nullable
    - `parameters` GrapeParameterDto[], nullable
      - `name` string, nullable
      - `dataType` 'String' | 'Number' | 'Boolean' | 'Date' | 'Binary' | 'Unknown'
      - `defaultValue` string, nullable
    - `latestModifiedDate` string, date-time, nullable
  - `links` HateoasLink[], nullable
    - `relation` string, nullable
    - `uri` string, nullable
    - `method` string, nullable

## Other responses

- `400` — Validation failed

---

[API](https://skmtc.net/data-grapes/apis/grapes-api.md) · [All operations](https://skmtc.net/data-grapes/apis/grapes-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/data-grapes/grapes-api/revisions/8ff77fe45bba/schema)
