Skip to content

Quickstart

  1. Get an API key.

    Open your project in the console. The key starts with cr_live_. Export it so the examples below can use it:

    export CLEARANCE_REST_API_KEY=cr_live_...
  2. Make a request.

    List the numbers attached to your project. This one returns immediately and changes nothing, so it is a good way to check that your key works.

    curl https://api.clearance.rest/numbers/list \
    -H "X-API-Key: $CLEARANCE_REST_API_KEY"

    A wrong or missing key returns 401.

  3. Wait for something.

    Rent a temporary number, then hold a request open until an SMS arrives on it. See Hero SMS numbers for the full flow.

    curl -X POST https://api.clearance.rest/numbers/providers/herosms/rent \
    -H "X-API-Key: $CLEARANCE_REST_API_KEY" \
    -H "content-type: application/json" \
    -d '{ "service": "tg", "country": 6 }'
    curl -G https://api.clearance.rest/numbers/sms/wait \
    -H "X-API-Key: $CLEARANCE_REST_API_KEY" \
    -H "X-Service-Timeout: 120000" \
    --data-urlencode "number=+6281234567890" \
    --data-urlencode "code_regex=\d{4,6}"

Renting a Hero SMS number spends balance. Release the number when you are done: if no SMS arrived, the rental is cancelled and refunded.