Skip to content
Console

Make your first request

This guide uses the installation token from Create an app and a credential. Call the API from a server. Browsers can only call it from origins configured for the Gateway.

Terminal window
export INSIDE_GATEWAY_TOKEN="igw_live_..."
export GATEWAY="https://api.inside.chat"

Send the token in the Authorization header on every request. Never put it in a URL.

  1. Check who you are and what you can do.

    Terminal window
    curl -s "$GATEWAY/api/v1/context" -H "Authorization: Bearer $INSIDE_GATEWAY_TOKEN"

    The response lists the organization, application and installation, the granted scopes and data access flags, any restrictions, when the credential expires, and the guides available to agents.

  2. List your websites. This needs the website_read scope.

    Terminal window
    curl -s "$GATEWAY/api/v1/websites" -H "Authorization: Bearer $INSIDE_GATEWAY_TOKEN"
    { "websites": [{ "website_id": "web_4927_123" }] }
  3. See which operations you can use on one website.

    Terminal window
    curl -s "$GATEWAY/api/v1/capabilities?website_id=web_4927_123" \
    -H "Authorization: Bearer $INSIDE_GATEWAY_TOKEN"

    operations lists every operation the credential can call on that website right now, with its required scopes and data access.

  4. Read your first page of conversations. This needs conversation_read.

    Terminal window
    curl -s "$GATEWAY/api/v1/conversations?website_id=web_4927_123&limit=25" \
    -H "Authorization: Bearer $INSIDE_GATEWAY_TOKEN"

    Pass next_cursor from the response as cursor to read the next page. A null next_cursor means there are no more pages.

Errors use problem details with a stable code and a request_id:

{
"type": "about:blank",
"title": "Request could not be completed",
"status": 404,
"code": "not_found",
"request_id": "..."
}
  • 401 means the token is missing, expired or revoked.
  • 404 means the website or resource isn’t granted, or doesn’t exist. The two look the same on purpose.
  • 429 means you reached a quota. Wait for the seconds in Retry-After.

See errors for every status and code.