Skip to content

Make Your First Request

This guide calls List Clients to read the first page of clients in your Crewsum account.

You need an API key with the clients:read scope. See Create an API Key.

  1. Store your API key in an environment variable, so that it does not appear in your code or shell history:

    Terminal window
    export CREWSUM_API_KEY="<your-api-key>"
  2. Send a GET request to /v1/clients/clients with the key in the x-api-key header. This example asks for the first 5 clients, sorted by name.

    Terminal window
    curl "https://api.crewsum.com/v1/clients/clients?page=0&pageSize=5&sortCol=clientName&sortDir=asc" \
    -H "x-api-key: $CREWSUM_API_KEY"
  3. Check the response. A successful request returns HTTP 200 OK and a JSON body like this:

    {
    "message": "Successfully fetched clients",
    "data": {
    "clients": [
    {
    "id": "client-4b7f7fe08b294c1b",
    "name": "Harbor Health Systems",
    "description": "Hospital network, IT modernization",
    "isArchived": false,
    "createdAt": "2026-10-04T18:49:04.904Z",
    "updatedAt": null,
    "isDeleted": false,
    "customFields": {}
    },
    {
    "id": "client-1a0c5d2e9b7f4a3c",
    "name": "Northwind Logistics",
    "description": "Regional freight and warehousing",
    "isArchived": false,
    "createdAt": "2026-10-04T18:49:04.897Z",
    "updatedAt": null,
    "isDeleted": false,
    "customFields": {}
    }
    ],
    "count": 2
    }
    }
    • data.clients holds the clients on this page.
    • data.count is the total number of clients that match the request, across all pages.

    If your account has no clients yet, clients is an empty array and count is 0.

What you seeLikely cause
500 with "The x-api-key header missing or in an incorrect format"The x-api-key header is missing. Check that the environment variable is set.
500 with "The provided api key was not found" or "...could not be validated"The key is wrong, incomplete, or deleted.
500 with "Insufficient scopes, this endpoint requires the following scopes: clients:read"The key does not have the clients:read scope.
500 with a subscription messageYour Crewsum account does not have an active subscription.
429You sent more than 1,000 requests in one minute. Wait for the time in the retry-after header.

Errors describes every error response.