Add file attachment
Use this API to add a file attachment to a message. An attachment can be one of the following types: fileAttachment, itemAttachment, or referenceAttachment. All these types of attachment resources are derived from the attachment resource. For file attachments smaller than 3 MB, use this endpoint. For larger files, use the createUploadSession endpoint.
Request body
Response
Created attachment
Changes
Changed in 4 of the 10 revisions of this API.240
- ○
added the new optional request property
allOf[subschema #2: attachment]/contentBytesnew-optional-request-property
- ○
added the optional property
allOf[subschema #2: attachment]/contentBytesto the response with the2XXstatusresponse-optional-property-added
- ○
- ○
api operation id
me.messages.CreateAttachmentsremoved and replaced withaddAttachmentapi-operation-id-removed
- ○
- ○
mapped value for discriminator key
#microsoft.graph.attachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged frommicrosoft.graph.fileAttachmenttoMicrosoftGraphAttachmentforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged frommicrosoft.graph.fileAttachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.itemAttachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailFolderchanged frommicrosoft.graph.mailFoldertoMicrosoftGraphMailFolderforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailSearchFolderchanged frommicrosoft.graph.mailSearchFoldertoMicrosoftGraphMailFolderforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.messagechanged frommicrosoft.graph.messagetoMicrosoftGraphMessageforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.outlookItemchanged frommicrosoft.graph.outlookItemtoMicrosoftGraphOutlookItemforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.referenceAttachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.attachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged frommicrosoft.graph.fileAttachmenttoMicrosoftGraphAttachmentforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged frommicrosoft.graph.fileAttachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.itemAttachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailFolderchanged frommicrosoft.graph.mailFoldertoMicrosoftGraphMailFolderforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailSearchFolderchanged frommicrosoft.graph.mailSearchFoldertoMicrosoftGraphMailFolderforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.messagechanged frommicrosoft.graph.messagetoMicrosoftGraphMessageforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.outlookItemchanged frommicrosoft.graph.outlookItemtoMicrosoftGraphOutlookItemforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.referenceAttachmentchanged frommicrosoft.graph.attachmenttoMicrosoftGraphAttachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
- ●
removed the request property
allOf[subschema #2: attachment]/contentBytesrequest-property-removed
- ●
removed the optional property
allOf[subschema #2: attachment]/contentBytesfrom the response with the2XXstatusresponse-optional-property-removed
- ○
api operation id
addAttachmentremoved and replaced withme.messages.CreateAttachmentsapi-operation-id-removed
- ○
mapped value for discriminator key
#microsoft.graph.attachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.fileAttachmentforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.fileAttachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.itemAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailFolderchanged fromMicrosoftGraphMailFoldertomicrosoft.graph.mailFolderforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailSearchFolderchanged fromMicrosoftGraphMailFoldertomicrosoft.graph.mailSearchFolderforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.messagechanged fromMicrosoftGraphMessagetomicrosoft.graph.messageforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.outlookItemchanged fromMicrosoftGraphOutlookItemtomicrosoft.graph.outlookItemforallOf[subschema #1: entity]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.referenceAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #2: attachment]/request propertyrequest-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.attachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.fileAttachmentforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.fileAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.fileAttachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.itemAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailFolderchanged fromMicrosoftGraphMailFoldertomicrosoft.graph.mailFolderforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.mailSearchFolderchanged fromMicrosoftGraphMailFoldertomicrosoft.graph.mailSearchFolderforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.messagechanged fromMicrosoftGraphMessagetomicrosoft.graph.messageforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.outlookItemchanged fromMicrosoftGraphOutlookItemtomicrosoft.graph.outlookItemforallOf[subschema #1: entity]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ○
mapped value for discriminator key
#microsoft.graph.referenceAttachmentchanged fromMicrosoftGraphAttachmenttomicrosoft.graph.attachmentforallOf[subschema #2: attachment]/response property for the response status2XXresponse-property-discriminator-mapping-changed
- ●