Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Export Job

POST/api/v2/notepad/exportJobs/create
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Creates a new ExportJob either from an existing Document or using the content generated by a GenerationJob. If an ExportJob succeeds, it will produce a File that can be downloaded.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:notepad-export.

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Request body

CreateExportJobRequest
object
Hide child attributes

Hide child attributes

exportJobSource
union

Defines the source of contents for an ExportJob

Show child attributes

Show child attributes

exportJobTarget
union

The target format that the job will export to.

Show child attributes

Show child attributes

Response body

ExportJob
object
Hide child attributes

Hide child attributes

rid
string

The unique identifier for an ExportJob

status
union

The status of an export job

Show child attributes

Show child attributes

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/notepad/exportJobs/create?preview=true" \ -d ''

Response

Copied!
1 2 3 4 5 6 { "rid": "ri.notepad.main.export-job.ef32c039-353c-4555-9704-eacfdfaa2c1c", "status": { "type": "running" } }

Error responses

Error Name
GenerationJobStatusFailedError CodeFAILED_PRECONDITION
Status Code500
DescriptionThe operation cannot be completed because the generation job has failed status.
ParametersgenerationJobRid
GenerationJobStatusRunningError CodeFAILED_PRECONDITION
Status Code500
DescriptionThe operation cannot be completed because the generation job has running status.
ParametersgenerationJobRid
DocumentNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested document was not found.
ParametersdocumentRid
ExportDocumentPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe user does not have export permissions on this Document.
ParametersdocumentRid
ExportGenerationJobPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe user does not have export permissions on this GenerationJob.
ParametersgenerationJobRid
InvalidExportJobUserLocaleError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe provided user locale is not valid.
ParametersuserLocale
InvalidTimezoneError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe provided timezone is not valid.
ParametersuserTimezone
CreateExportJobPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not create the ExportJob.
Parameters
GenerationJobNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe given GenerationJob could not be found.
ParametersgenerationJobRid, templateRid