Skip to content

Create Client

This endpoint creates a client and returns the generated client ID.

POST /v1/clients/clients

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

clients: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
namestringYesThe client name. When omitted, the request fails with 500.
descriptionstring | nullNoA description for the client. Defaults to null.
isArchivedbooleanNoCreates the client in an archived state when true. Defaults to false.
customFieldsRecord<string, string>NoCustom key-value metadata for the client. Defaults to {}. Values are not validated, so send strings.
{
"name": "Client Name",
"description": "A brief description of the client",
"isArchived": false,
"customFields": {
"region": "west",
"accountManager": "Jordan Lee"
}
}
Terminal window
curl -X POST "https://api.crewsum.com/v1/clients/clients" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Client Name",
"description": "A brief description of the client",
"isArchived": false,
"customFields": {
"region": "west",
"accountManager": "Jordan Lee"
}
}'

On success, the API returns HTTP 201 Created.

{
"message": "Successfully created client: client-ghi123jkl4567890",
"data": {
"clientId": "client-ghi123jkl4567890"
}
}
  • The API generates the client ID in the format client-<16 hex characters>.
  • When description, isArchived, or customFields is omitted, the API uses null, false, or {}.
  • The new client has updatedAt: null until it is first updated.
  • After the client is created, Crewsum attempts to send the clients.created webhook event. A webhook failure does not change the response.
StatusMeaning
500{"message": "Error creating client"}. Crewsum could not create the client. 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.