ONSIM API

Welcome to the ONSIM API

BASE URL
https://api.onsimapp.com

Account - Cease Account

Cease Account. WARNING:: Please use with caution this will irrevocably cease the SIM and Account - it can not be reversed

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

iccid

required, string

SIM ICCID

DELETE
/account
1
EXAMPLE BODY
{
  "iccid": "8944530000000012345"
}

Account - Get Info

Get account information, services and bundle

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

mpn

required

mpn of account you want to retrieve info for

GET
/account/:mpn
1

Account - Update Bundle

Use this method to update the bundle associated to the Account use either BASE (no data) or UNLIMITED (data)

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

mpn

required

mpn of account you want to update

bundle

required

Bundle SKU

POST
/account/:mpn/bundle/:bundle
1

Account - eSIM

Returns the eSIM activation code and status for the supplied i_account, MPN or ICCID. Additionally allows eSIM activation code to be refreshed if not currently installed. The eSIM activation code can be used to generate a QR code for installtion on an eSIM compatible device.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

i_account

optional, string, default:

Your accounts/subscribers unique ID

mpn

optional, string, default:

Enter any of your SIM's numbers mobile or landline in e164 (i.e 44777...)

iccid

optional, string, default:

Your 19 digit SIM ID

refresh_code

optional, integer enum, default: 0

If set to 1 will refresh the activation code if eSIM has not yet been installed

Possible Enum Values

01
POST
/account/esim
1
EXAMPLE BODY
{
  "mpn": "447777777777",
  "refresh_code": 1
}

Account - Generate QR

Pass a valid eSIM activation code in order to generate a QR Image. Note: Images are presigned S3 URLs with an expiry of 24 hours

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

esim_code

required, string

eSIM Activation Code

POST
/account/esim/generate
1
EXAMPLE BODY
{
  "esim_code": "LPA:XXXXXX"
}

Account - Update Mobile Settings

Update Mobile Settings for Account

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

mpn

required

mpn of account you are updating

Request Body

mpn

optional, string

Accounts new mpn

pbx_user

optional, string

Accounts new SIP address/username

pbx_password

optional, string

Accounts new SIP password

POST
/account/pbxinfo/:mpn
1
EXAMPLE BODY
{
  "pbx_user": "USER12345"
}

Account - SIM Swap

Update the SIM (perform a SIM Swap) used by an Account

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

mpn

required, string

Accounts mobile phone number

new_iccid

required, string

New ICCID for physical SIM or if set to eSIM it will switch to the next available eSIM.

POST
/account/sim-swap
1
EXAMPLE BODY
{
  "mpn": "447777777777",
  "new_iccid": "eSIM"
}

Numbers - List all numbers

Get a list of reseller numbers filtered by state

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

state

required

State of mpn - either 'ACTIVE' or 'RESERVED'

GET
/numbers/:state
1

Numbers - Delete a number

Deletes a number. NOTE: you can only delete numbers that are in a 'RESERVED' state (i.e not on an active account)

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

mpn

required

mpn to delete

DELETE
/numbers/:mpn
1

Numbers - Add a number

Adds a number

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

mpn

required

mpn to add

POST
/numbers/:mpn
1

Reseller - Provision Account

Provison a new SIM.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

mpn

required, string

Number to be used as the accounts primary mobile number (used for SMS, iMessage, etc)

iccid

optional, string

19 digit ICCID of physcial SIM (remove the final digit from printed version). If ICCID is not supplied the next available eSIM will be used.

POST
/reseller/provision
1
EXAMPLE BODY
{
  "mpn": "447777777777"
}

Reseller - List Subscribers

Returns a list of existing Subscribers for the Reseller.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

state

required, string

Subscriber Status/State

POST
/reseller/subscribers
1
EXAMPLE BODY
{
  "state": "PROVISIONED"
}

SMS - Terminate SMS

Delivers a SMS message to an ONSIM subscriber - please make sure you have enabled SMS Gateway for this subscriber.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

id

required, string, default:

Your unique reference for the SMS Message

from

required, string, default:

+e164 number of sender (i.e +44777...)

to

required, string, default:

+e164 number of ONSIM Subscriber (i.e +44777...)

message

required, string, default:

Body of SMS encoded in UTF-8

POST
/sms/terminate
1
EXAMPLE BODY
{
  "id": "39edf9a4-7e2d-4126-af69-5246da735278",
  "from": "+447777777777",
  "to": "+447888888888",
  "message": "Hello ONSIM Subscriber!"
}