Skip to content

Create End Customer

This endpoint creates an end customer and returns the generated end customer ID.

POST /v1/end-customers/end-customers

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

end-customers:write

The server does not validate the request body against a schema. A missing required field or a value of the wrong type is not rejected with 400. See the notes in each row.

FieldTypeRequiredDescription
namestringYesEnd customer name. When omitted, the request fails with 500.
descriptionstring | nullNoEnd customer description. Defaults to null.
clientIdstring | nullNoClient to link the end customer to. Defaults to null. A client that does not exist in your account, or is deleted, returns 400.
emailstring | nullNoEnd customer email. Defaults to null. The format is not checked.
phoneNumberstring | nullNoEnd customer phone number. Defaults to null.
addressstring | nullNoEnd customer address. Defaults to null.
notesstring | nullNoInternal notes. Defaults to null.
isArchivedbooleanNoCreates the end customer in an archived state when true. Defaults to false.
{
"name": "End Customer Name",
"clientId": "client-ghi123jkl4567890",
"email": "buyer@example.com",
"phoneNumber": "555-0100",
"address": "123 Main St"
}
Terminal window
curl -X POST "https://api.crewsum.com/v1/end-customers/end-customers" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "End Customer Name",
"clientId": "client-ghi123jkl4567890",
"email": "buyer@example.com",
"phoneNumber": "555-0100",
"address": "123 Main St"
}'

On success, the API returns HTTP 201 Created.

{
"message": "Successfully created end customer",
"data": {
"endCustomerId": "endcustomer-abc123def4567890"
}
}
  • The API generates the end customer ID in the format endcustomer-<16 hex characters>.
  • Omitted optional fields are stored as null. isArchived defaults to false.
  • The new end customer has updatedAt: null until it is first updated.
  • After the end customer is created, Crewsum attempts to send the end-customers.created webhook event. A webhook failure does not change the response.
StatusMeaning
400{"message": "Client not found"}. No client with this clientId exists in your account, or the client is deleted. Nothing is created.
500{"message": "Error creating end customer"}. Crewsum could not create the end customer. This is also the response when name is missing or a field has a value the database rejects.
500The request has no JSON body. The response uses the standard server error shape.

Authentication and scope failures are described in Errors.