---     
tags: 
  - Custom Polygons
description: Creates a CustomPolygon
  <br/><strong>REQUIRED</strong> `custom_group_id` integer
  <br/><strong>REQUIRED</strong> `reference` string
  <br/><strong>REQUIRED</strong> `geometry` GeoJSON object

  The geometry must be a single, simple polygon with a maximum of 50 vertices, no larger than 500,000m², and no more than 100,000 polygons in a group.
parameters:
  - in: header
    name: Authorization
    type: string
    required: true
  - in: path
    name: custom_group_id
    type: integer
    required: true
  - in: body
    name: body
    type: object
    required: true
    schema:
      example: {
        "custom_group_id": 1,
        "reference": 3,
        "geometry": {"type": "Polygon", "coordinates": [[[0,0], [0,1], [1,1], [1,0], [0,0]]]},
    }
produces: 
  - 'application/json'
responses:
  200:
    schema:
      type: object
      example: {
        "message": "Custom Polygon created",
        "id": 1,
        "geometry": {"type": "Polygon", "coordinates": [[[0,0], [0,1], [1,1], [1,0], [0,0]]]},
        "custom_group": {
          "id": 1,
          "name": "Custom Group"
        }
      }
  406:
    schema:
      type: object
      properties:
        error:
          type: string
          example: Invalid geometry - must be a single, simply polygon with at least four vertices
  401:
    schema:
      type: object
      properties:
        error:
          type: string
          example: Must have access to Custom Group
  404:
    schema:
      type: object
      properties:
        error:
          type: string
          example: Custom Group not found
