logo
Index
API Reference
Account - Cease Account
Account - Get Info
Account - Update Bundle
Account - Recording
Account - eSIM
Account - Generate QR
Account - Update Mobile Settings
Account - SIM Swap
Numbers - List all numbers
Numbers - Delete a number
Numbers - Add a number
Reseller - List Groups
Reseller - Add Group
Reseller - List Product Catalogue
Reseller - Provision Account (own UC)
Reseller - Provision Account (ONSIM UC)
Reseller - List Subscribers
SIMs - List all sims
SMS - Terminate SMS
Porting - List All Ports
Porting - Lookup Port
Porting - Port in UK MPN
Porting - Request PAC
powered by zuplo

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 - Recording

Enable or disable call and SMS recording for the specified account. ⚠️ Use with caution, especially for users in regulated industries. Disabling recording will immediately stop all data capture, and any unrecorded events cannot be recovered retroactively.

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

Request Body

voice_recording

required, string enum, default: ON

Use a value of ON or OFF to enable or disable Voice Recording

Possible Enum Values

ON

OFF

sms_recording

required, string enum, default: ON

Use a value of ON or OFF to enable or disable SMS Recording

Possible Enum Values

ON

OFF

POST
/account/:mpn/recording
1
EXAMPLE BODY
{
  "voice_recording": "ON",
  "sms_recording": "ON"
}

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

first_name

optional, string

Accounts new First Name

last_name

optional, string

Accounts new Last Name

email

optional, string

Accounts new Email Address

mobile_data

optional, string enum, default: ON

Use a value of ON or OFF to enable or disable Mobile Data

Possible Enum Values

ON

OFF

mobile_voice

optional, string enum, default: ON

Use a value of ON or OFF to enable or disable Mobile Voice

Possible Enum Values

ON

OFF

mobile_sms

optional, string enum, default: ON

Use a value of ON or OFF to enable or disable Mobile SMS

Possible Enum Values

ON

OFF

mobile_hotspot

optional, string enum, default: OFF

Use a value of ON or OFF to enable or disable Mobile Hotspot/Tethering of mobile data

Possible Enum Values

ON

OFF

POST
/account/pbxinfo/:mpn
1
EXAMPLE BODY
{
  "mpn": "447777777777",
  "pbx_password": "PA$$W0RD!",
  "last_name": "Smith",
  "mobile_sms": "ON"
}

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 - List Groups

Get a list of all reseller groups

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.

GET
/reseller/groups
1

Reseller - Add Group

Add a new Group/Customer

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

name

required, string

Group Name. ((Must be unique, length 3-45 charachters ('a-z' 'A-Z' '0-9' '_' '-'), MUST start with an alphanumeric character, MUST contain at least one Alphabetical character & No spaces or other characters))

address_line_1

required, string

Line 1 of customer address

address_line_2

optional, string

Line 2 of customer address

city

optional, string

Customer City

country

optional, string

Customer Country

post_code

optional, string

Customer Post Code

home_location

required, string

a list of three character country codes(ISO-3166) for which the Group's service is primarily homed, comma separated when more than one location : current values limited to "GBR" or "USA" or a list of the two

description

optional, string

Description of the customer/group

POST
/reseller/groups
1
EXAMPLE BODY
{
  "name": "ExampleCustomer",
  "address_line_1": "Example Building",
  "address_line_2": "18 Example Street",
  "city": "Example City",
  "country": "Example Country",
  "post_code": "SW1A 0AA",
  "home_location": "GBR",
  "description": "Example Group for testing API"
}

Reseller - List Product Catalogue

Return a list of available bundles and product SKU's for provisioning ONSIM services

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.

GET
/reseller/catalogue
1

Reseller - Provision Account (own UC)

Provison a new SIM when using your own PBX.

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.

pbx_user

optional, string

Accounts SIP address/username - if not included in request it will default to 'ONSIM[ICCID]'

pbx_password

optional, string

Accounts new SIP password - if not included in request we will create one and return this in the response

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

Reseller - Provision Account (ONSIM UC)

Provison a new account and SIM on ONSIM.

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.

group_name

required, string

Customer Group ID

home_location

required, string enum

Home Location of USER (GBR, USA, etc)

Possible Enum Values

GBR

USA

first_name

required, string

Accounts First Name

last_name

required, string

Accounts Last Name

email

required, string

Accounts Email Address

product

required, number

ID of the product to provision

mobile_data

required, string enum

Data Bundle to be applied to the subscriber

Possible Enum Values

BACKGROUND-ONLY

2GB

4GB

10GB

20GB

UNLIMITED

POST
/reseller/provision-onsim
1
EXAMPLE BODY
{
  "mpn": "447777777777",
  "iccid": "8944530000000012345",
  "group_name": "CUSTOMER_A",
  "home_location": "USA",
  "first_name": "John",
  "last_name": "Smith",
  "email": "j.smith@example.com",
  "product": 18,
  "mobile_data": "2GB"
}

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 enum

Subscriber status/state. Must be 'PROVISIONED'.

Possible Enum Values

PROVISIONED

is_recorded

optional, boolean

Return the recording state of all subscribers

group

optional, string

Optionally filter by group

POST
/reseller/subscribers
1
EXAMPLE BODY
{
  "state": "PROVISIONED",
  "is_recorded": true,
  "group": "CUSTOMERA"
}

SIMs - List all sims

Get a list of reseller sims filtered by state and Type

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 SIM - either 'ACTIVE' or 'RESERVED'

type

required

Type of SIM - either 'ALL', 'eSIM' or 'pSIM'

GET
/sims/:state/:type
1

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!"
}

Porting - List All Ports

Returns a list of ports filter by status. Valid state types = [ALL, INITIAL, IN PROGRESS, FAILED, COMPLETE, CLOSED]

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 to filter results

GET
/port/all/:state
1

Porting - Lookup Port

Lookup the details of an ACTIVE Port with the supplied ID

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

id

required

ID of the port to query

GET
/port/:id
1

Porting - Port in UK MPN

Request PORT IN of UK MPN using a PAC obtained from another network. ⚠️ IMPORTANT:: The Number being replaced (the number currently in use on the target SIM) will be irrevocably removed from the system. If you need to keep both numbers please contact support.

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

number

required, string

The Current MPN on the SIM which will be replaced by the number being ported in - this number will be irrevocably lost

PAC

required, string

PAC code from current provider

portinNumber

required, string

The MPN being ported in that will replace the number on the SIM

portinDate

required, string

The requested port in date - please note, this must be a minimum of 24 hours in the future, is not guaranteed and must be formatted YYYYMMDD. We would also strongly suggest not selecting weekend dates. Note: Ports can complete at any time on the day of porting.

POST
/port/port-in
1
EXAMPLE BODY
{
  "number": "447777777771",
  "PAC": "ABC12345",
  "portinNumber": "447777777772",
  "portinDate": "20190129"
}

Porting - Request PAC

Request PAC Code to Export a UK Mobile Number from the ONSIM network. PAC's are valid for 30 days and must be supplied to your new network provider. ⚠️ IMPORTANT:: porting a number does not terminate a subscriber or your contractual obligations.

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 you wish to port and obtain a PAC Code

POST
/port/pac/:mpn
1