--- title: Attachment API description: The Attachment API provides endpoints that allow you to upload and query file attachments.Deletes a specified attachment.Deletes all attributes for an attachment.Deletes a specified attribute from an attachment.Returns the metadata for multiple attachments.Returns the metadata for the attachment file with a specific sys\_id value.Retrieves all attributes for an attachment.Retrieves a specified attribute from an attachment.Returns the binary file attachment with a specific sys\_id value.Renames an attachment.Adds an attribute to a specified attachment.Uploads a specified binary file as an attachment to a specified record.Uploads a multipart file attachment.Updates the value of an existing attribute for an attachment. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/rest-apis/c\_AttachmentAPI.html release: australia product: REST APIs classification: rest-apis topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 31 breadcrumb: [REST API reference, API reference, API implementation and reference] --- # Attachment API The Attachment API provides endpoints that allow you to upload and query file attachments. You can upload or retrieve a single file with each request. The Attachment API respects any system limitations on uploaded files, such as maximum file size and allowed attachment types. You can control these settings using the properties **com.glide.attachment.max\_size**, 1024MB by default, and **glide.attachment.extensions**. **Note:** The Attachment API accepts all Content-Type values \(\*/\*\). Specify the file content type when uploading an attachment. The content type is stored with file metadata allowing other tools to correctly identify and parse the file. The following video provides more information on the Attachment API: ## Attachment API role requirements To create attachments, the user record used to authenticate the HTTP request with ServiceNow must have any roles required to create Attachment \[sys\_attachment\] records. It must also have any roles required to read and write records on the target table, such as the itil role to add attachments to incident records. By default there is no single role allowing a user to add attachments. You can create a role to explicitly allow adding attachments, then assign this role to the user account being used to make the request. **Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md) ## Attachment - DELETE /now/attachment/\{sys\_id\} Deletes a specified attachment. ### URL format Versioned URL: `/api/now/v1/attachment/{sys_id}` Default URL: `/api/now/attachment/{sys_id}` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
| Name | Description |
|---|---|
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| attribute\_key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| Name | Description |
|---|---|
| sysparm\_limit | Limit to be applied on pagination. **Note:** Unusually large `sysparm_limit` values can impact system performance. Data type: String Default: 1000 |
| sysparm\_offset | Number of records to exclude from the query. Use this parameter to get more records than specified in **sysparm\_limit** parameter. For example, if **sysparm\_limit** is set to 500, but there are additional records you want to query, you can specify a **sysparm\_offset** parameter value of 500 to get the second set of records.Data type: String Default: 0 |
| sysparm\_query | Encoded query. Queries for the Attachment API are relative to the Attachments \[sys\_attachment\] table.For example: **\(sysparm\_query=file\_name=attachment.doc\)** The encoded query provides support for order by. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in sysparm\_query. For example, `sysparm_query=ORDERBYfile_name^ORDERBYDESCtable_Name` orders the results in ascending order by name first, then in descending order by table name. Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| result | Array of objects containing a key-value pair for each attribute.Data type: Array ``` "result": [ { "key": "example_key", "value": "example_value" } ] ``` |
| result.key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| result.value | Attribute value.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Value |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| attribute\_key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| result | Object containing the key-value pair for the attribute.Data type: Object ``` "result": { "key": "String", "value": "String" } ``` |
| result.key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| result.value | Attribute value.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Value |
| Header | Description |
|---|---|
| Accept | Data format of the response body. For example, use `image/jpeg` or `image/png` to accept JPEG or PNG image files exclusively. To allow all image types, specify `image/*`; to allow any file type, specify `*/*`.Default: \*/\* |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Table: Attachment \[sys\_attachment\] Data type: String |
| Name | Description |
|---|---|
| file\_name | Required. New name for the attachment.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Content-Type | Data format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| error | Error information. This parameter is only returned if the request failed.Data type: Object ``` "error": { "detail": "String", "message": "String" } ``` |
| error.detail | Additional details about why the request failed.Data type: String |
| error.message | Error message containing the reason the request failed.Data type: String |
| status | Status of the API request. This parameter is only returned if the request failed so the only possible value is `failure`.Data type: String |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| Name | Description |
|---|---|
| key | Required. Key to use for the attribute.Data type: String |
| value | Required. Value to use for the attribute.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Content-Type | Data format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| result | Object containing the key-value pair for the attribute.Data type: Object ``` "result": { "key": "String", "value": "String" } ``` |
| result.key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| result.value | Attribute value.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Value |
| Name | Description |
|---|---|
| creation\_time | Creation date and time of the attachment. Use this parameter to capture attachment creation times when the Now Mobile app is offline and the attachment is uploaded to a record at a later time. Data type: String Default: The current date and time. |
| encryption\_context | Sys\_id of an encryption context record. Specify this parameter to allow only users with the specified encryption context to access the attachment. For additional information on encryption context records, see [Field Encryption](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/field-encryption.md).Data type: String Default: File is encrypted using encryption context accessible to the user, otherwise the attached file is not encrypted with any encryption context. |
| file\_name | Required. Name to give the attachment. Data type: String |
| table\_name | Required. Name of the table to attach the file to.Data type: String |
| table\_sys\_id | Required. Sys\_id of the record in the table specified in **table\_name** that you want to attach the file to. Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Content-Type | Content type of the file to attach, such as image/jpeg or \*/\*. This header is mandatory to post file attachments. |
| Element | Description |
|---|---|
| result | Metadata of the requested attachment.Data type: Object ``` "result": { "average_image_color": "String", "compressed": "String", "content_type": "String", "created_by_name": "String", "download_link": "String", "file_name": "String", "image_height": "String", "image_width": "String", "size_bytes": "String", "size_compressed": "String", "sys_created_by": "String", "sys_created_on": "String", "sys_id": "String", "sys_mod_count": "String", "sys_tags": "String", "sys_updated_by": "String", "sys_updated_on": "String", "table_name": "String", "table_sys_id": "String", "updated_by_name": "String" } ``` |
| result.average\_image\_color | If the attachment is an image, the sum of all colors.Data type: String Unit: RGB or number of pixels. |
| result.compressed | Flag that indicates whether the attachment file has been compressed.Possible values: - true: File has been compressed. - false: File has not been compressed. Data type: String |
| result.content\_type | Content-type of the associated attachment file, such as image or jpeg or application/x-shockwave-flash.Data type: String |
| result.created\_by\_name | Full name of entity that originally created the attachment file.Data type: String |
| result.download\_link | Download URL of the attachment on the ServiceNow instance.Data type: String |
| result.file\_name | File name of the attachment.Data type: String |
| result.image\_height | If an image file, the height of the image.Data type: String Unit: Pixels |
| result.image\_width | If an image file, the width of the image.Data type: String Unit: Pixels |
| result.size\_bytes | Size of the attachment.Data type: String Unit: Bytes |
| result.size\_compressed | Size of the compressed attachment file. If the file is not compressed, empty.Data type: String Unit: Bytes |
| result.sys\_created\_by | Entity that originally created the attachment file.Data type: String |
| result.sys\_created\_on | Date and time that the attachment file was initially saved to the instance.Data type: String |
| result.sys\_id | Sys\_id of the attachment file.Data type: String |
| result.sys\_mod\_count | Number of times the attachment file has been modified \(uploaded to the instance\).Data type: String |
| result.sys\_tags | Any system tags associated with the attachment file.Data type: String |
| result.sys\_updated\_by | Entity that last updated the attachment file.Data type: String |
| result.sys\_updated\_on | Date and time that the attachment file was last updated.Data type: String |
| result.table\_name | Name of the table to which the attachment is associated.Data type: String |
| result.table\_sys\_id | Sys\_id of the table associated with the attachment.Data type: String |
| result.updated\_by\_name | Full name of entity that last updated the attachment file.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Content-Type | Content type of the request. Set this value to multipart/form-data when using the multipart POST method. |
| Element | Description |
|---|---|
| result | Metadata of the requested attachment.Data type: Object ``` "result": { "average_image_color": "String", "compressed": "String", "content_type": "String", "created_by_name": "String", "download_link": "String", "file_name": "String", "image_height": "String", "image_width": "String", "size_bytes": "String", "size_compressed": "String", "sys_created_by": "String", "sys_created_on": "String", "sys_id": "String", "sys_mod_count": "String", "sys_tags": "String", "sys_updated_by": "String", "sys_updated_on": "String", "table_name": "String", "table_sys_id": "String", "updated_by_name": "String" } ``` |
| result.average\_image\_color | If the attachment is an image, the sum of all colors.Data type: String Unit: RGB or number of pixels. |
| result.compressed | Flag that indicates whether the attachment file has been compressed.Possible values: - true: File has been compressed. - false: File has not been compressed. Data type: String |
| result.content\_type | Content-type of the associated attachment file, such as image or jpeg or application/x-shockwave-flash.Data type: String |
| result.created\_by\_name | Full name of entity that originally created the attachment file.Data type: String |
| result.download\_link | Download URL of the attachment on the ServiceNow instance.Data type: String |
| result.file\_name | File name of the attachment.Data type: String |
| result.image\_height | If an image file, the height of the image.Data type: String Unit: Pixels |
| result.image\_width | If an image file, the width of the image.Data type: String Unit: Pixels |
| result.size\_bytes | Size of the attachment.Data type: String Unit: Bytes |
| result.size\_compressed | Size of the compressed attachment file. If the file is not compressed, empty.Data type: String Unit: Bytes |
| result.sys\_created\_by | Entity that originally created the attachment file.Data type: String |
| result.sys\_created\_on | Date and time that the attachment file was initially saved to the instance.Data type: String |
| result.sys\_id | Sys\_id of the attachment file.Data type: String |
| result.sys\_mod\_count | Number of times the attachment file has been modified \(uploaded to the instance\).Data type: String |
| result.sys\_tags | Any system tags associated with the attachment file.Data type: String |
| result.sys\_updated\_by | Entity that last updated the attachment file.Data type: String |
| result.sys\_updated\_on | Date and time that the attachment file was last updated.Data type: String |
| result.table\_name | Name of the table to which the attachment is associated.Data type: String |
| result.table\_sys\_id | Sys\_id of the table associated with the attachment.Data type: String |
| result.updated\_by\_name | Full name of entity that last updated the attachment file.Data type: String |
| Value | Description |
|---|---|
| Content-Type | Content-Type of the file, included in the message body for multipart uploads.**Note:** The Content-Type must be defined within the file portion of the POST message, not within the form data. See the sample POST multipart message for an example of a multipart message. Data type: String |
| table\_name | Name of the table to which you want to attach the file.Data type: String |
| table\_sys\_id | Sys\_id of the record on the specified table to which you want to attach the file.Data type: String |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| sys\_id | Sys\_id of the attachment.Data type: String Table: Attachment \[sys\_attachment\] |
| attribute\_key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| Name | Description |
|---|---|
| value | Required. New value for the attribute.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Content-Type | Data format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| result | Object containing the key-value pair for the attribute.Data type: Object ``` "result": { "key": "String", "value": "String" } ``` |
| result.key | Attribute key.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Key |
| result.value | Attribute value.Data type: String Table: Attachment Attributes \[sys\_attachment\_attribute\] Column: Value |