Schema

Create schema from template

Changed on

Create new schema object from template organization, see available templates in organization.

post/api/v1/schemas/from_template

Request

Request body

namestring required

Name of the new schema

template_namestring required

Name of the template to use

Response

Created

idinteger required

ID of the schema.

namestring required

Name of the schema (not visible in UI).

urlstring uri required

URL of the schema.

queuesstring[] required

List of queues that use schema object.

metadataMetadata required

Client data. May be used to store e.g. external system object IDs. See Metadata for more details.

modified_bystring uri nullable required

User that last modified the object.

modified_atstring date-time nullable required

Timestamp of last modification.

Example response

{
  "id": 31336,
  "name": "Basic Schema",
  "url": "https://example.rossum.app/api/v1/schemas/31336",
  "queues": [
    "https://example.rossum.app/api/v1/queues/8236"
  ],
  "metadata": {
    "some_key": "some_value"
  },
  "modified_by": "https://example.rossum.app/api/v1/users/10775",
  "modified_at": "2021-04-26T10:08:03.856648Z",
  "content": [
    {
      "category": "section",
      "id": "invoice_info_section",
      "label": "Basic information",
      "icon": null,
      "children": [
        {
          "category": "datapoint",
          "id": "document_id",
          "label": "Invoice number",
          "type": "string",
          "rir_field_names": [
            "document_id"
          ],
          "constraints": {
            "required": false
          },
          "default_value": null
        },
        {
          "category": "datapoint",
          "id": "date_issue",
          "label": "Issue date",
          "type": "date",
          "format": "YYYY-MM-DD",
          "rir_field_names": [
            "date_issue"
          ],
          "constraints": {
            "required": false
          },
          "default_value": null
        },
        {
          "category": "datapoint",
          "id": "document_type",
          "label": "Document type",
          "type": "enum",
          "options": [
            {
              "label": "Invoice Received",
              "value": "21"
            },
            {
              "label": "Invoice Sent",
              "value": "22"
            },
            {
              "label": "Receipt",
              "value": "23"
            }
          ],
          "enum_value_type": "number",
          "default_value": "21",
          "rir_field_names": []
        }
      ]
    },
    {
      "category": "section",
      "id": "line_items_section",
      "label": "Line items",
      "icon": null,
      "children": [
        {
          "category": "multivalue",
          "id": "line_items",
          "label": "Line items",
          "min_occurrences": null,
          "max_occurrences": null,
          "rir_field_names": [
            "line_items"
          ],
          "children": {
            "category": "tuple",
            "id": "line_item",
            "label": "Line item",
            "children": [
              {
                "category": "datapoint",
                "id": "item_desc",
                "label": "Description",
                "type": "string",
                "rir_field_names": [
                  "table_column_description"
                ],
                "constraints": {
                  "required": true
                },
                "stretch": true
              },
              {
                "category": "datapoint",
                "id": "item_quantity",
                "label": "Quantity",
                "type": "number",
                "format": "# ##0.#",
                "rir_field_names": [
                  "table_column_quantity"
                ],
                "constraints": {
                  "required": false
                },
                "width": 15
              },
              {
                "category": "datapoint",
                "id": "item_amount_total",
                "label": "Price w tax",
                "type": "number",
                "format": "# ##0.#",
                "rir_field_names": [
                  "table_column_amount_total"
                ],
                "constraints": {
                  "required": false
                },
                "aggregations": {
                  "sum": {
                    "label": "Total"
                  }
                }
              }
            ]
          }
        }
      ]
    },
    {
      "category": "section",
      "id": "tax_details_section",
      "label": "Tax details",
      "icon": null,
      "children": [
        {
          "category": "multivalue",
          "id": "tax_details",
          "label": "Tax details",
          "min_occurrences": null,
          "max_occurrences": null,
          "rir_field_names": [
            "tax_details"
          ],
          "children": {
            "category": "tuple",
            "id": "tax_detail",
            "label": "Tax detail",
            "children": [
              {
                "category": "datapoint",
                "id": "tax_detail_rate",
                "label": "Tax rate",
                "type": "number",
                "format": "# ##0.#",
                "rir_field_names": [
                  "tax_detail_rate"
                ],
                "constraints": {
                  "required": false
                },
                "width": 15
              },
              {
                "category": "datapoint",
                "id": "tax_detail_base",
                "label": "Tax base",
                "type": "number",
                "format": "# ##0.#",
                "rir_field_names": [
                  "tax_detail_base"
                ],
                "constraints": {
                  "required": false
                }
              },
              {
                "category": "datapoint",
                "id": "tax_detail_tax",
                "label": "Tax amount",
                "type": "number",
                "format": "# ##0.#",
                "rir_field_names": [
                  "tax_detail_tax"
                ],
                "constraints": {
                  "required": false
                }
              }
            ]
          }
        }
      ]
    }
  ]
}

Changes

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • warning

      removed the optional property / from the response with the status

    • info

      added the optional property //// to the response with the status