Skip to content

Create Supplier Contact

This endpoint creates a contact for a supplier and returns the generated supplier contact ID.

POST /v1/supplier-contacts/supplier-contacts

Include your API key in the x-api-key header. See Authentication.

supplier-contacts:write
FieldTypeRequiredDescription
supplierIdstringYesID of a supplier in your account. If no supplier in your account has this ID, the API returns 400 and creates nothing. If the field is missing, the API returns 500.
namestringYesContact name. If it is missing, the API returns 500.
emailstringYesContact email address. If it is missing, the API returns 500. The format is not checked.
descriptionstringNoContact description. Stored as null when omitted.
{
"supplierId": "supplier-stu123vwx4567890",
"name": "Supplier Contact Name",
"email": "placeholder@example.com",
"description": "A brief description of the supplier contact"
}
Terminal window
curl -X POST "https://api.crewsum.com/v1/supplier-contacts/supplier-contacts" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"supplierId": "supplier-stu123vwx4567890",
"name": "Supplier Contact Name",
"email": "placeholder@example.com",
"description": "A brief description of the supplier contact"
}'

On success, the API returns HTTP 200 OK. This endpoint does not return 201.

The response message currently contains the misspelling Sucessfully. Do not match on the message text.

{
"message": "Sucessfully created supplier contact: suppliercontact-vwx123yza4567890",
"data": {
"supplierContactId": "suppliercontact-vwx123yza4567890"
}
}
  • The API generates the contact ID in the format suppliercontact-<16 hex characters>.
  • New contacts are active (isArchived: false) and have updatedAt: null.
  • The request body is not validated against a schema. Wrong types are stored as sent or cause a 500.
  • After the contact is created, Crewsum sends the supplier-contacts.created webhook event. The payload is { "contacts": [{ "supplier": <supplier>, "supplierContact": <contact> }] }.
StatusMeaning
400No supplier in your account has this supplierId. Nothing is created. Message: Supplier not found.
500Crewsum could not create the contact, for example because a required field was missing. Message: Error doing thing. 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.