Skip to content
Follow yggy on LinkedInFollow @yggy_tech on X

Import documents from a connected provider (e.g. Google Drive)

POST
/api/v1/documents/import-from-provider
curl --request POST \
--url https://api.yggy.tech/api/v1/documents/import-from-provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "type": "jira", "fileIds": [ "example" ], "projectId": "example", "parentNoteId": "example", "desiredTier": "auto", "importTotal": 680, "importId": "imp_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f" }'
Media type application/json
object
type
required
string
Allowed values: jira confluence github gitlab slack notion linear webhook google_drive microsoft_drive gmail google_calendar outlook
fileIds
required
Array<string>
>= 1 items <= 200 items
projectId
string
parentNoteId
string
/^[A-Za-z0-9_-]{1,128}$/
desiredTier
string
Allowed values: auto fast balanced accurate
importTotal

First request of an import sent in several requests: how many files were selected in all. When the monthly credit limit is not reached yet, the response returns an importId, and the selected files, at most one month’s credits, are processed even if the limit is reached while the import runs. Files past that are refused with usage_limit_exceeded.

integer
>= 1 <= 1000
Example
680
importId

Later requests of the same import: the importId the first response returned. An unknown or expired id is ignored and the monthly credit limit applies as usual; once the import’s files are used up, the rest is refused with usage_limit_exceeded.

string
>= 1 characters <= 100 characters
Example
imp_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f

One entry per fileId: either queued (documentId) or failed (error)

Media type application/json
object
documents
required
Array<object>
object
fileId
required
string
documentId
string
error
string
attachments

For an email: what became of each of its attachments. Each real attachment is imported as a document of its own; small images, inline pictures, calendar invites and files that cannot be imported are skipped with a reason.

Array<object>
object
filename
required
string
documentId

Set unless the attachment was skipped.

string
status
required
string
Allowed values: imported already_imported skipped
reason

Why a skipped attachment was left out.

string
Allowed values: inline small_image calendar unsupported_format too_large usage_limit_exceeded import_failed
importId

Set when the request belongs to an admitted import. Send it as importId with the next requests of this import.

string
Example
{
"documents": [
{
"attachments": [
{
"status": "imported",
"reason": "inline"
}
]
}
]
}

Not authenticated

No active organization

Provider type has no content-browsing capability

No connected row for this provider/caller

Too many imports into notes by this user