Skip to content

Create a client

The Fstop API includes an endpoint that allows client applications to create new clients in the database.

In this guide, you’ll make a POST request to the /api/clients/ endpoint to create a new client.

Before you make a POST request, ensure that you have an access token. For instructions on requesting an access token, see Getting started with the Fstop API.

  1. Open a terminal and run the following command:

    create_client.sh
    curl -X POST http://localhost:8000/api/clients/ \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "first_name": "Alice",
    "last_name": "Johnson",
    "city": "Cincinnati",
    "state": "OH",
    "zip_code": "45202",
    "email": "alice.johnson@example.com",
    "phone_number": "+12161239999"
    }'

    The API returns a 201 CREATED and the details of the newly created client:

    create_client_response.json
    {
    "id": "550e8400-e29b-41d4-a716-446655440002",
    "first_name": "Alice",
    "last_name": "Johnson",
    "city": "Cincinnati",
    "state": "OH",
    "zip_code": "45202",
    "email": "alice.johnson@example.com",
    "phone_number": "+12161239999",
    "created_at": "2026-05-21T10:10:00Z"
    }
  2. Using the Python SDK:

    create_client.py
    from fstop import Fstop
    with Fstop(jwt_auth="YOUR_ACCESS_TOKEN") as f_client:
    created_client = f_client.clients.create_client(
    first_name="Alice",
    last_name="Johnson",
    city="Cincinnati",
    state="OH",
    zip_code="45202",
    email="alice.johnson@example.com",
    phone_number="+12161239999"
    )
    print(f"Client created with ID: {created_client.id}")

You can use the returned client data in your application. The id field uniquely identifies the client and can be used to create projects and bookings associated with this client.

See POST /api/clients/ for a full list of request parameters and response schemas.