ClientSphereDocs
Guides

Quickstart

Create an API key and make your first authenticated request to the ClientSphere API.

This walks through one request end to end. It should take a couple of minutes.

1. Create an API key

In your workspace, go to Settings → API Keys and create a key.

You choose whether the key is a test or live key at creation, and that decision is fixed for the life of the key. Test keys are prefixed sk_test_ and read and write sandbox data; live keys are prefixed sk_live_ and touch production data. See Test and live data.

The key is shown once. Store it somewhere your application can read it as a secret — never in client-side code or a public repository.

2. Make a request

Every endpoint is under /api/v1. List the accounts in your workspace:

curl https://clientsphere.io/api/v1/accounts \
  -H "Authorization: Bearer sk_test_your_key_here"

A successful response looks like this — a data array plus a meta object, never a bare array:

{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "Halcyon Foods",
      "status": "active",
      "industry": "Food & Beverage"
    }
  ],
  "meta": {
    "pagination": { "page": 1, "limit": 20, "totalCount": 1, "totalPages": 1 }
  }
}

3. Create something

Most write endpoints take the resource's fields directly and return the created record with its generated id:

curl -X POST https://clientsphere.io/api/v1/accounts \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Northstar Labs", "status": "prospect" }'

That responds 201 with the new account. A 400 means the body failed validation, and the response tells you which fields — see Errors.

Next

  • Authentication — the second way to send a key, and what a key is permitted to do
  • Pagination — walking a list longer than one page
  • The API reference — every endpoint, with a request you can send from the page

On this page