Skip to main content

 

 

Coupa Success Portal

Attachments API

Actions

The Attachments API allows you to:

Verb Path Action Description
POST /api/contracts/:contract_id/attachments create Create attachment
POST /api/invoices/:invoice_id/attachments create Create attachment
POST /api/expense_reports/:expense_report_id/attachments create Create attachment
POST /api/purchase_orders/:purchase_order_id/attachments create Create attachment
POST /api/users/:user_id/attachments create Create attachment
POST /api/requisitions/:requisition_id/attachments create Create attachment
GET /api/contracts/:contract_id/attachments index Query attachments
GET /api/invoices/:invoice_id/attachments index Query attachments
GET /api/expense_reports/:expense_report_id/attachments index Query attachments
GET /api/purchase_orders/:purchase_order_id/attachments index Query attachments
GET /api/users/:user_id/attachments index Query attachments
GET /api/requisitions/:requisition_id/attachments index Query attachments
GET /api/contracts/:contract_id/attachments/:id show Show attachment
GET /api/invoices/:invoice_id/attachments/:id show Show attachment
GET /api/expense_reports/:expense_report_id/attachments/:id show Show attachment
GET /api/purchase_orders/:purchase_order_id/attachments/:id show Show attachment
GET /api/users/:user_id/attachments/:id show Show attachment
GET /api/requisitions/:requisition_id/attachments/:id show Show attachment
PATCH /api/contracts/:contract_id/attachments/:id update You cannot update attachments via the API
PUT /api/contracts/:contract_id/attachments/:id update You cannot update attachments via the API
PATCH /api/invoices/:invoice_id/attachments/:id update You cannot update attachments via the API
PUT /api/invoices/:invoice_id/attachments/:id update You cannot update attachments via the API
PATCH /api/expense_reports/:expense_report_id/attachments/:id update You cannot update attachments via the API
PUT /api/expense_reports/:expense_report_id/attachments/:id update You cannot update attachments via the API
PATCH /api/purchase_orders/:purchase_order_id/attachments/:id update You cannot update attachments via the API
PUT /api/purchase_orders/:purchase_order_id/attachments/:id update You cannot update attachments via the API
PATCH /api/users/:user_id/attachments/:id update You cannot update attachments via the API
PUT /api/users/:user_id/attachments/:id update You cannot update attachments via the API
PATCH /api/requisitions/:requisition_id/attachments/:id update You cannot update attachments via the API
PUT /api/requisitions/:requisition_id/attachments/:id update You cannot update attachments via the API

Elements

The following elements are available for the Attachments API:

Element Description Required Field? Unique? Allowable Value Api_In Field? Api_Out Field? Data Type
created-at Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ         yes datetime
file-url URL to attached file       yes   string
id Coupa unique identifier   yes     yes integer
intent intent       yes yes string(40)
linked-to link to specific feature       yes   string(255)
text text       yes   text
type type yes     yes yes string(255)
updated-at Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ         yes datetime
url url       yes   string(255)

Example

 The following example post creates an attachment of the file, Standard_Terms_Conditions.pdf, for the contract 12345.

curl -X POST \
  https://<INSTANCE>/api/requisitions/12345/attachments \
  -H "Accept: application/xml" \
  -H "content-type: multipart/form-data" \
  -H "x-coupa-api-key: <API KEY>" \
  -F "attachment[file]=@/Users/IntegrationAdmin/Contracts/Standard_Terms_Conditions.pdf" \
  -F "attachment[type]=file"
  • Was this article helpful?