myCRMSIM

myCRMSIM API 1.0

Get Started
​
No token
Get started

Quickstart

From zero to your first successful API call in about five minutes. Every request below is copy-pasteable — swap in your own credentials as you go.

Before you start

App credentials — a client_id + client_secret. Request your app in myCRMSIM under Integrations → Custom Integration; once it is approved, the card shows them (the secret only once, so store it safely).
A myCRMSIM user — someone to install your app and consent to its scopes.
A callback URL — the redirect_uri registered on your app, where the authorization code will be delivered.

1. Install your app

Redirect the user's browser to the install URL. They sign in (if needed), review the scopes your app requests, and click Install.

https://app.mycrmsim.com/integrations/install/<CLIENT_ID>?redirect_uri=<YOUR_CALLBACK>&state=<RANDOM>

On consent, the browser is redirected to your callback with a single-use ?code= query parameter. Grab it — it expires quickly.

2. Exchange the code for tokens

curl -X POST https://backend.mysmsgateway.app/api/v1/third_party_integrations/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "authorization_code",
    "code": "<CODE_FROM_CALLBACK>",
    "client_id": "<YOUR_CLIENT_ID>",
    "client_secret": "<YOUR_CLIENT_SECRET>",
    "redirect_uri": "<YOUR_CALLBACK>"
  }'
{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token_type": "Bearer",
    "expires_in": 86400,
    "scopes": ["contacts.read", "contacts.write", "messages.write"]
  }
}

Store both tokens keyed by the installing user. The access token lasts 1 day; use the refresh token (365 days) to get a new pair when you see a 401.

3. Make your first call

/integration/me is a wiring test — it verifies your token and shows the installer and granted scopes.

curl https://backend.mysmsgateway.app/api/v1/integration/me \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
{
  "success": true,
  "data": {
    "integration": { "id": 12, "name": "Your App" },
    "user": { "id": 42, "name": "Gary", "email": "gary@example.com" },
    "scopes": ["contacts.read", "contacts.write", "messages.write"]
  }
}

A 200 here means auth is fully working. Everything else is just endpoints.

4. Read some data

curl "https://backend.mysmsgateway.app/api/v1/ext/contacts?limit=5" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

Requires the contacts.read scope. If you get a 403, the token wasn't granted that scope — re-install with it included.

5. Send your first message

Requires messages.write and a device assigned to the workspace (app.mycrmsim.com → Devices). Attachments: max 1 per message, up to 5 MB.

curl -X POST https://backend.mysmsgateway.app/api/v1/ext/messages \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 7,
    "phone": "+61412345678",
    "channel": "default",
    "message": "Hello from the myCRMSIM API!"
  }'

A 200 means the message is queued for delivery — poll GET /ext/messages/{id} to follow its status. Message sends are rate-limited (30 per 15 minutes per workspace) — see .

If something fails

401 — token expired or invalid. Refresh it (grant_type refresh_token).
403 — token missing a scope. Re-install the app with the scope included.
429 — rate limited. Back off and retry — see the Rate limits page.
404 — the resource exists but belongs to another installer, or doesn't exist.

Next steps

— the full flow, refresh, and revocation.
— what each scope unlocks.
— budgets and 429 handling.
API changelog — what shipped and what changed.