Mutation
mutation CreateAttachmentUploadUrl($input: CreateAttachmentUploadUrlInput!) {
createAttachmentUploadUrl(input: $input) {
attachmentUploadUrl {
attachment {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
type
}
uploadFormUrl
uploadFormData {
key
value
}
expiresAt {
unixTimestamp
iso8601
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"fileName": "string",
"fileSizeBytes": 1,
"attachmentType": "EMAIL"
}
}Response
{
"data": {
"createAttachmentUploadUrl": {
"attachmentUploadUrl": {
"attachment": {
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"type": "EMAIL"
},
"uploadFormUrl": "string",
"uploadFormData": [
{
"key": "string",
"value": "string"
}
],
"expiresAt": {
"unixTimestamp": "string",
"iso8601": "string"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
createAttachmentUploadUrl
Generate a presigned upload URL for an attachment. Use the returned uploadFormUrl and
uploadFormData fields to POST the file as multipart/form-data directly to storage. The
upload URL expires after 2 hours; the resulting attachment.id can then be referenced in
mutations such as createThread, replyToEmail, or createNote. Requires the
attachment:create permission. Attachments that are never referenced in a message are
automatically deleted after 24 hours.
MUTATION
createAttachmentUploadUrl(input: CreateAttachmentUploadUrlInput!): CreateAttachmentUploadUrlOutput!Arguments
input
required
Returns
attachmentUploadUrl
error
Mutation
mutation CreateAttachmentUploadUrl($input: CreateAttachmentUploadUrlInput!) {
createAttachmentUploadUrl(input: $input) {
attachmentUploadUrl {
attachment {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
type
}
uploadFormUrl
uploadFormData {
key
value
}
expiresAt {
unixTimestamp
iso8601
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"fileName": "string",
"fileSizeBytes": 1,
"attachmentType": "EMAIL"
}
}Response
{
"data": {
"createAttachmentUploadUrl": {
"attachmentUploadUrl": {
"attachment": {
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"type": "EMAIL"
},
"uploadFormUrl": "string",
"uploadFormData": [
{
"key": "string",
"value": "string"
}
],
"expiresAt": {
"unixTimestamp": "string",
"iso8601": "string"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

