Update Supplier Contact
This endpoint updates the name, description, email, or archive status of a supplier contact.
Endpoint
Section titled “Endpoint”PUT /v1/supplier-contacts/supplier-contacts/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”supplier-contacts:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Supplier contact ID. |
Request Body
Section titled “Request Body”Send only the fields you want to change. Omitted fields keep their current values. You must send a JSON body, even if it is {}. You cannot move a contact to another supplier.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Contact name. |
description | string | null | No | Contact description. Send null to clear it. |
email | string | No | Contact email address. The format is not checked. |
isArchived | boolean | No | Archive (true) or restore (false) the contact. |
Example Request Body
Section titled “Example Request Body”{ "name": "Updated Supplier Contact Name", "description": "Updated supplier contact description", "email": "updated@example.com", "isArchived": false}Example Request
Section titled “Example Request”curl -X PUT "https://api.crewsum.com/v1/supplier-contacts/supplier-contacts/suppliercontact-vwx123yza4567890" \ -H "x-api-key: $CREWSUM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Supplier Contact Name", "description": "Updated supplier contact description", "email": "updated@example.com", "isArchived": false }'const response = await fetch( "https://api.crewsum.com/v1/supplier-contacts/supplier-contacts/suppliercontact-vwx123yza4567890", { method: "PUT", headers: { "x-api-key": process.env.CREWSUM_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Updated Supplier Contact Name", description: "Updated supplier contact description", email: "updated@example.com", isArchived: false, }), },);const result = await response.json();PUT /v1/supplier-contacts/supplier-contacts/suppliercontact-vwx123yza4567890 HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Content-Type: application/json
{ "name": "Updated Supplier Contact Name", "description": "Updated supplier contact description", "email": "updated@example.com", "isArchived": false}Response
Section titled “Response”On success, the API returns HTTP 200 OK.
Example Response
Section titled “Example Response”{ "message": "Successfully updated supplier contact"}Behavior
Section titled “Behavior”- Every successful call sets
updatedAtto the current time. - The API does not check that the contact exists. An unknown ID still returns
200and nothing changes. - Deleted contacts can still be updated. This endpoint cannot restore a deleted contact.
- The request body is not validated against a schema. Wrong types are stored as sent or cause a
500. - After the update, Crewsum sends the
supplier-contacts.updatedwebhook event. The payload is{ "contacts": [{ "supplier": <supplier>, "supplierContact": <contact> }] }. For an unknown ID, the event is still sent, with an emptycontactsarray.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | The ID path segment was empty (for example, a trailing slash). Message: Supplier Contact ID not specified. |
500 | Crewsum could not update the contact. Message: Error updating supplier contact. If no request body is sent, the API returns a 500 with a generic error body instead. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” supplier-contacts.updated View webhook event details.