Skip to content

curl Examples

SELECT

bash
curl -X POST https://celdrax.com/api/mydb/users \
  -H "Authorization: Bearer cxk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "verb": "select",
    "filters": { "active": true },
    "limit": 10
  }'

SELECT — specific columns

bash
curl -X POST https://celdrax.com/api/mydb/products \
  -H "Authorization: Bearer cxk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "verb": "select",
    "columns": ["id", "name", "price"],
    "orderBy": "price DESC",
    "limit": 5
  }'

INSERT

bash
curl -X POST https://celdrax.com/api/mydb/users \
  -H "Authorization: Bearer cxk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "verb": "insert",
    "data": {
      "email": "alice@example.com",
      "name": "Alice",
      "active": true
    }
  }'

UPDATE

bash
curl -X POST https://celdrax.com/api/mydb/users \
  -H "Authorization: Bearer cxk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "verb": "update",
    "data":    { "active": false },
    "filters": { "id": 42 }
  }'

DELETE

bash
curl -X POST https://celdrax.com/api/mydb/sessions \
  -H "Authorization: Bearer cxk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "verb": "delete",
    "filters": { "user_id": 42 }
  }'

Saving the token in an env variable

bash
export CELDRAX_TOKEN="cxk_your_token_here"

curl -X POST https://celdrax.com/api/mydb/users \
  -H "Authorization: Bearer $CELDRAX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "verb": "select", "limit": 5 }'