Skip to main content

Document

Document Object

FieldTypeDescription
idsnowflakethe document's id
numberintegerthe sequential number for the document within an organisation
typesnowflakethe type of document
organisation_idsnowflakethe id of the organisation
titlestringthe title of the document (2-200 characters)
created_byuser objectthe creator of the document
created_atISO8601 timestampwhen the document was created
release_revision_hashhashthe crytographic hash corresponding to current released revision
last_numberintegerthe largest number currently issued to a clause, ensures no conflicts
forked_fromsnowflakethe forked document's id
forked_revisionhashthe forked document revision's hash

Document Branch Object

There is always a release branch and a draft branch. Initially only the draft branch will contain a document revision object.

FieldTypeDescription
idsnowflakethe document revision's id
namestringthe branch name (2-50 characters)
created_byuser objectthe creator of the document branch
created_atISO8601 timestampwhen the document branch was created

Document Revision Object

FieldTypeDescription
idsnowflakethe document revision's id (do we even need this?)
hashhashthe crytographic hash of the revision contents
branchdocument branchthe revision's branch
revisionstringthe revison for the document within an organisation (1-10 characters) or null
titlestringthe title of the document revision (2-200 characters)
created_byuser objectthe creator of the document revision
created_atISO8601 timestampwhen the document revision was created
previous_revision_hashhashthe crytographic hash corresponding to the previous revision

Document Type Object

FieldTypeDescription
idsnowflakethe document type's id
organisation_idsnowflakethe id of the organisation
namestringthe type's name (2-20 characters)
descriptionstringa description of the type
last_numberintegerthe largest number currently issued to a document
number_formatstringa string formatter
revision_formatintegerrevision format

Document Sheet Object

FieldTypeDescription
idsnowflakethe document sheet's id
document_idsnowflakethe id of the document

Document Revision Sheet Object

Implements Orderable

FieldTypeDescription
revision_idsnowflakethe document revision's id
sheet_idsnowflakethe document sheet's id
namestringthe document sheet's name (2-20 characters)
orderintegerthe order of the sheet within the document

Document Column Object

FieldTypeDescription
idsnowflakethe document columns's id
document_sheet_idsnowflakethe id of the document sheet

Document Revision Column Object

Implements Orderable

FieldTypeDescription
revision_idsnowflakethe document revision's id
column_idsnowflakethe document sheet's id
namestringthe document column's name (2-20 characters)
descriptionstringa description of the document column
typethe document column's data type
conditional_formattingstringthe conditional formatting condition

Document Clause Object

FieldTypeDescription
idsnowflakethe document clause's id
document_sheet_idsnowflakethe id of the document sheet
numberintegerclause number

Document Revision Clause Object

Implements Orderable

FieldTypeDescription
revision_idsnowflakethe document revision's id
clause_idsnowflakethe document clause's id
textstringthe clause text (maximum 16 MiB including base 64 encoded image data)
fieldslist of document fieldsthe document field values

Document Field Object

FieldTypeDescription
column_idsnowflakethe document column's id
clause_idsnowflakethe document clause's id
valuestringthe document field value
background_colourstringhex colour value
Document Data Types
Document Data Units
Document Data Formats
ValueNameDescription
0StringString
1DecimalDecimal number format 0.0000
2ScientificScientific notation 0.0000x10^0
3EngineeringScientific notation where the exponent is a multiple of 3 [..., -6, -3, 0, 3, 6, ...]
4TimeInstead of second, expressed in dd:hh:mm:ss
5UnixtimeNumber of seconds or milliseconds since the unix epoch expressed in ISO date format

Document Revision Field Object

FieldTypeDescription
revision_idsnowflakethe document revision's id
field_idsnowflakethe document field's id

Document View Object

The document view object describes which columns to show and in which order. Views can be inherited from forked documents.

FieldTypeDescription
idsnowflakethe document view's id

Document View Column Object

FieldTypeDescription
view_idsnowflakethe document view's id
column_idsnowflakethe document column's id
orderintegerthe order to display the columns in

Document Merge Request Object

FieldTypeDescription
organisation_idsnowflakethe organisation the merge request belongs to
numberintegera sequential number for the merge request
from_branch_idsnowflakethe branch to merge
to_branch_idsnowflakethe branch to be merged to
workflow_idsnowflakethe workflow that will trigger the merge
useruser objectthe creator of the document merge request
created_atISO8601 timestampwhen the document merge request was created

Revision Format

NameValueDescription
none0No numbering scheme, use this if you issue numbers from another system. This will allow the user to manually assign both the document number and the revision.
zero1This scheme uses the integer numbers starting at 0.
one2This scheme uses the integer numbers starting at 1.
major_minor3This scheme uses a version number of the scheme Major.Minor allowing either the Major or the Minor component to be incremented.
major_minor_revision4This scheme uses a version number of the scheme Major.Minor.Revision allowing either the Major or the Minor component to be incremented. The Revision component is always incremented.
alphabet5This is the default scheme and uses the letters A-Z skipping "I", "O", "Q", "S", "X", "Z". The initial revision is denoted by a dash "-".
alphabet_all6This scheme uses the letters A-Z with the initial revision denoted by a dash "-".

Clause Number Format

NameValueDescription
number0Document number
number_revision1Document number plus revision

Create Document

POST /documents

Parameters
FieldTypeDescription
titlestringthe document's title (2 - 200 characters)

Fork Document

POST /documents/{document.id}

This operation will create a fork of the document. The new document will be returned.




Create Document Branch

POST /documents/{document.id}/branches

Parameters
FieldTypeDescription
namestringthe document branch's name (2 - 50 characters)

Create Document Sheet

POST /documents/{document.id}/revisions/{revision.hash}/sheets

This operation will create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.


{
"id": 123456,
"hash": abdf12,
"branch": {
"id": 5678,
"name": "draft",
"user": { },
"created_at": "2019-07-01T00:00:00+00:00",
}
}

Parameters
FieldTypeDescription
namestringthe document sheet's name (2 - 20 characters)

List Document Columns

GET /documents/{document.id}/revisions/{revision.hash}/columns

Get a list of columns for this revision of the document. Returns an array of document revision column objects.

Create Document Column

POST /documents/{document.id}/revisions/{revision.hash}/columns

This operation will create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.


{
"id": 123456,
"hash": abdf12,
"branch": {
"id": 5678,
"name": "draft",
"user": { },
"created_at": "2019-07-01T00:00:00+00:00"
}
}

Modify Document Column

PATCH /documents/{document.id}/revisions/{revision.hash}/columns/{column.id}

Parameters
FieldTypeDescription
name?stringthe document column's name (2-20 characters)
description?stringa description of the document column
type?the document column's data type
conditional_formatting?stringthe conditional formatting condition

Delete Document Column

DELETE /documents/{document.id}/revisions/{revision.hash}/columns/{column.id}

This operation will delete a column from a revision on the branch and create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.

Create Document Clause

POST /documents/{document.id}/revisions/{revision.hash}/clauses

This operation will create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.

Parameters
FieldTypeDescription
after?snowflakethe clause to insert the new clause after
before?snowflakethe clause to insert the new clause before

Modify Document Clause

PATCH /documents/{document.id}/revisions/{revision.hash}/clauses/{clause.id}

Parameters
FieldTypeDescription
after?snowflakethe clause to move the clause after
below?snowflakethe clause to move the clause below

Delete Document Clause

DELETE /documents/{document.id}/revisions/{revision.hash}/clauses/{clause.id}

This operation will delete a clause from a revision on the branch and create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.

Update Document Field

PATCH /documents/{document.id}/revisions/{revision.hash}/fields

This operation will create a new revision on the branch. The new revision will be returned. If the change cannot be merged then an error code will return.

This operation will cause all calculations to re-calculate.

Parameters
FieldTypeDescription
clause_idsnowflakethe clause the updated field belongs to
column_idsnowflakethe column the updated field belongs to
valuestringthe new value of the field

{
"id": 123450,
"hash": abdf12,
"user": {},
"created_at": "2019-07-01T00:00:00+00:00",
"fields": [
{
"column_id": 123453,
"clause_id": 123454,
"value": "field value",
"background_colour": ""
}
]
}

Get Document Revision

GET /documents/{document.id}/revisions/{revision.hash}

GET /documents/{document.id}/branches/{branch.name}

A document revision can be retrieved either by specifying a specific branch by name to get the latest revison, or by a specific revision's hash.


{
"id": 123450,
"hash" abdf12,
"user" { },
"created_at": "2019-07-01T00:00:00+00:00"
}