๐Ÿ“ก API Documentation

๐Ÿ” Authentication

Each user has a unique API Key to authenticate requests.

Include your API key in the request header like this:

token: YOUR_API_KEY

Replace YOUR_API_KEY.

๐Ÿ“ฅ Get Messages

Retrieve messages for a specific phone number.

Request
MethodPOST
URL
https://smsinbox.online/api/messages
Headers
token: YOUR_API_KEY
Body (JSON){ "number": "12025550181" }
Response
{
	  "success": true,
	  "messages": [
		{
		  "time": 1748403027,
		  "sender": "Telegram",
		  "content": "Login code: 998877"
		}
	  ]
	}

โž• Request New Number

Request a new temporary phone number to use.

Request
MethodPOST
URL
https://smsinbox.online/api/request-number
Headers
token: YOUR_API_KEY
Body (JSON) { "country": "US" } optional, ISO country code
Response
{
	  "success": true,
	  "number": "+12025550182",
	  "msg": "New number assigned successfully"
	}

๐Ÿ“ž Get All Your Numbers

Retrieve all temporary numbers assigned to your account.

Request
MethodGET
URL
https://smsinbox.online/api/my-numbers
Headers
token: YOUR_API_KEY
Response
{
	  "success": true,
	  "numbers": [
		"+12025550181",
		"+12025550182",
		"+12025550183"
	  ]
}

๐Ÿงช Test Your Key

Verify your API key validity.

Request
MethodGET
URL
https://smsinbox.online/api/validate-key
Headers
token: YOUR_API_KEY
Response
{
	  "success": true,
	  "user": {
		"name": "test",
		"email": "[email protected]",
		"verified": "1"
	  }
	}

๐Ÿ’ป Code Examples

PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "token: YOUR_API_KEY",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["number" => "+12025550181"]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests

url = "https://smsinbox.online/api/messages"
headers = {
    "token": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {"number": "+12025550181"}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
Node.js (axios)
const axios = require('axios');

axios.post('https://smsinbox.online/api/messages', 
  { number: '+12025550181' }, 
  { headers: { 
      token: 'YOUR_API_KEY', 
      'Content-Type': 'application/json' 
    } 
  }
)
.then(res => {
  console.log(res.data);
})
.catch(err => {
  console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");

        var content = new StringContent("{\"number\": \"+12025550181\"}", Encoding.UTF8, "application/json");
        var response = await client.PostAsync("https://smsinbox.online/api/messages", content);
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Go (net/http)
package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://smsinbox.online/api/messages"
    jsonData := []byte(`{"number": "+12025550181"}`)

    req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    if err != nil {
        panic(err)
    }

    req.Header.Set("token", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}

PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/request-number");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "token: YOUR_API_KEY",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["country" => "US"]));  // optional
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests

url = "https://smsinbox.online/api/request-number"
headers = {
    "token": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {"country": "US"}  # optional

response = requests.post(url, headers=headers, json=payload)
print(response.json())
Node.js (axios)
const axios = require('axios');

axios.post('https://smsinbox.online/api/request-number', 
  { country: 'US' },  // optional
  { headers: { 
      token: 'YOUR_API_KEY', 
      'Content-Type': 'application/json' 
    } 
  }
)
.then(res => {
  console.log(res.data);
})
.catch(err => {
  console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");

        var content = new StringContent("{\"country\": \"US\"}", Encoding.UTF8, "application/json");
        var response = await client.PostAsync("https://smsinbox.online/api/request-number", content);
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Go (net/http)
package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://smsinbox.online/api/request-number"
    jsonData := []byte(`{"country": "US"}`)

    req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    if err != nil {
        panic(err)
    }

    req.Header.Set("token", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}

PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/my-numbers");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "token: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests

url = "https://smsinbox.online/api/my-numbers"
headers = {
    "token": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
Node.js (axios)
const axios = require('axios');

axios.get('https://smsinbox.online/api/my-numbers', {
  headers: { token: 'YOUR_API_KEY' }
})
.then(res => {
  console.log(res.data);
})
.catch(err => {
  console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");

        var response = await client.GetAsync("https://smsinbox.online/api/my-numbers");
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Go (net/http)
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://smsinbox.online/api/my-numbers"

    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        panic(err)
    }

    req.Header.Set("token", "YOUR_API_KEY")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}

PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/validate-key");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "token: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests

url = "https://smsinbox.online/api/validate-key"
headers = {
    "token": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
Node.js (axios)
const axios = require('axios');

axios.get('https://smsinbox.online/api/validate-key', {
  headers: { token: 'YOUR_API_KEY' }
})
.then(res => {
  console.log(res.data);
})
.catch(err => {
  console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");

        var response = await client.GetAsync("https://smsinbox.online/api/validate-key");
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Go (net/http)
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://smsinbox.online/api/validate-key"

    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        panic(err)
    }

    req.Header.Set("token", "YOUR_API_KEY")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}