Skip to main content

Quick Start

This guide will help you make your first Semaswift API call in under 5 minutes.

Prerequisites

  • A Semaswift account (sign up at semaswift.com)
  • Your API credentials (JWT token or Personal Access Token)
  • A tool for making HTTP requests (curl, Postman, or your favorite HTTP client)

Step 1: Get Your API Token

Option A: Login to Get JWT Token

curl -X POST https://api.semaswift.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@example.com",
"password": "your-password"
}'

Response:

{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600,
"user": {
"id": "usr_123456",
"email": "your-email@example.com",
"name": "Your Name"
}
}

Option B: Use a Personal Access Token

Generate a PAT from your dashboard at Settings > API Keys.

Step 2: Make Your First API Call

Use your token to fetch your user profile:

curl https://api.semaswift.com/api/v1/auth/me \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"id": "usr_123456",
"email": "your-email@example.com",
"name": "Your Name",
"organization_id": "org_789",
"roles": ["admin"],
"created_at": "2024-01-15T10:30:00Z"
}

Step 3: Explore the API

Now that you're authenticated, try some common operations:

List Users in Your Organization

curl https://api.semaswift.com/api/v1/users \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Create a Support Ticket

curl -X POST https://api.semaswift.com/api/v1/tickets \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subject": "Test Ticket",
"description": "This is a test ticket created via API",
"priority": "medium"
}'

List Available Call Queues

curl https://api.semaswift.com/api/v2/voice/queues \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Using Different Languages

curl https://api.semaswift.com/api/v1/auth/me \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Base URLs

EnvironmentBase URL
Productionhttps://api.semaswift.com
Sandboxhttps://sandbox.semaswift.com
Local Developmenthttp://localhost:3000

Next Steps