User is unauthorized to write to table: Incident, when trying to upload an attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2021 01:40 PM
Hi,
I'm trying to use SNOW's Rest API to upload attachments to Incidents.
curl --location --request POST 'https://[...].service-now.com/now/attachment/file?table_name=incident&table_sys_id=[...]&file_name=[...]' \
--header 'Accept: application/json' \
--header 'Authorization: Basic [...]' \
--header 'Content-Type: [...]' \
--data-binary '[...]'
When I use a user with an admin role, the attachment is uploaded successfully.
When I use a none admin user, I'm getting the next error:
403 Forbidden - User not authorized. User is unauthorized to write to table: Incident
The same none admin user can successfully create and update Incidents using the Rest API. It only fails when trying to upload an attachment.
This user can upload attachments with no issues when using SNOW application in the browser.
I've tried adding to this user a few relevant Roles like:
incident_manager, itil, rest_service, & sn_incident_write.
I've tried creating a new Role and then a few new ACLs that require this role.
ACL with create & write operations on the Incident and sys_attachment table.
I've assigned the new roles to this user but it didn't help.
Also tried to add the roles to:
System Properties -> Security -> List of roles (comma-separated) that can create attachments.
Nothing is helping.
Any idea?
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2021 09:28 AM
This issue is still not resolved. No matter what I try, I'm getting 'User is unauthorized to write to table: Incident' unless I add the admin role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 01:13 AM
Hi Arnonla,
Did you get any Resolution for the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2023 07:36 AM
I'm having this exact issue. Can you please post your solution? I can not see your solution in this thread.
Thank you,
Patrick Shea

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2023 06:13 PM
I suggest opting for a scripted API approach to incorporate attachments into records rather than relying on the attachment API. This approach provides greater flexibility for managing attachments and controlling access based on your custom scripted API design.
here is great articles by Ankur.
If my response helped you anyways please consider marking this response as helpful / correct answer.
Thank you,
Nitin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 10:04 AM
Do you have role snc_read_only added to your user? If so remove it. Please let me know it this was it.