Create a document

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Document Creation Strategies

When creating documents within Joyfill there are two strategies you can use: Raw Document and Document from Template.

Raw Document

With this method you pass the raw files and fields on the body param. These params will be used for creating the document.

Can thetemplate body param be used with this strategy?

Yes. The template will only be used as the source reference to the template you specified. The custom files and fields will be used for the actual document creation.

Why would anyone pass in rawfiles and fields with the template param?

This is usually done when the document from template creation cycle is managed on the client side. This strategy allows the new document with all the modifications, updates, etc. and the reference to the original template to all be created with a single request.

Example Body

{
  "name": "New Document",
  "group": "group_id",
  "files": [JoyDocFileObject, ...],
  "fields": [JoyDocFieldObject, ...],
  ...
}

Document From Template

With this method you can leave the files and fields params empty and simply pass the template param on the body and the Joyfill API will use the template to generate a new document with files and fields from the template.

Example Body

{
  "name": "New Document",
  "group": "group_id",
  "template": "temp_identifier",
  ...
}
Body Params
string

Specifies a document's unique ID. Maximum length is 80 characters. Identifier cannot be changed after creation. Leave the identifier param empty to have Joyfill auto generate an identifier.

string

Specifies the visual display name. When the template param is used in this creation event and this name is left blank the document will automatically be given the same name as the original template.

files
array

Array of JoyDoc file objects. See the JoyDoc data structure under the guides section to learn more.

files
fields
array

Array of JoyDoc field objects. See the JoyDoc data structure under the guides section to learn more.

fields
string

The template identifier to use as the source of the document.

string

The group identifier of the group that you would like to create the document for.

string
enum
Defaults to published
Allowed:
Headers
string

Supports both API Key and User Access Token authorization. See https://docs.joyfill.io/docs/authentication

Response

Language
LoadingLoading…
Response
Choose an example:
application/json