Skip to main content

Import, delete or modify documents via API

GraphQL enables you to:

Import a document

To import a document to a portfolio, include the following in the query:

  • Path to the portfolio.

  • Filename.

  • Base64-coded string for the file.

mutation {
  uploadDocument(
    path:"/Portfolios/10527954",
    fileName:"Test2.pdf",
    data:"VGhpcyBpcyBhIFRlc3QgRmlsZQ")
}

To import a document to a specific context, use the query below and change the context depending on what the target is.

  • 1 = Contacts

  • 2 = Portfolios

  • 3 = Securities

  • 4 = Transactions

  • 5 = Trade orders

mutation {
  uploadDocumentInContext(
    context: "1",
    id: 1234,
    fileName:"Test2.pdf",
    data:"VGhpcyBpcyBhIFRlc3QgRmlsZQ")
}

Add and remove document tags

The query below removes the "Not approved" tag from the document with the specified ID. It also adds the "Approved to" tag to the same document.

mutation {
documentTags(identifier:"439d44d7",removeTags:"Not approved",addTags:"Approved")
}

Delete a document

The query below deletes a document with a certain ID.

mutation {
  deleteDocument(identifier:"439d44d7") 
}