Create Endpoints

After registering SIMs, you need to create a virtual representation of the device associated with the SIM. In the emnify REST API, this is called an endpoint.

You can create one or multiple endpoints using the Create an Endpoint API call. In this call, you must:

Optionally, you can also:

  • Assign and activate a SIM
  • Set tags
  • Designate the IMEI and enable IMEI lock
  • Designate the IP address and space

Alternatively, you can create devices via the emnify Portal. For step-by-step instructions, see Create a device in the emnify Documentation.

Individual endpoint

To create a new request in Postman, click +New in the upper left corner. Name the request Endpoint creation and add it to a new collection called Endpoints.

Then follow these steps to set up your request:

  1. Select the POST HTTP method.
  2. Set the request URL as https://cdn.emnify.net/api/v1/endpoint
  3. Navigate to the Headers tab. Insert Content-Type and Authorization as Keys and add the respective Values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.
  4. Go to the Body tab and select raw. Make sure the format is set to JSON. Then, specify the endpoint details.

To get your endpoint online immediately, set the endpoint status to Enabled and activate the SIM card:

{
    "name": "ENDPOINT_NAME",
    "status": {
        "id": 0
    },
    "service_profile": {
        "id": SERVICE_PROFILE_ID
    },
    "tariff_profile": {
        "id": TARIFF_PROFILE_ID
    },
    "sim": {
        "id": SIM_ID,
        "activate": true
    }
}

The activate property defaults to true, so you can also omit it. Keep in mind that a monthly cost is charged for each activated SIM card, even if the endpoint status is set to Disabled.

If you don’t plan on using the endpoint right away, set the endpoint status to Disabled and don’t activate the SIM:

{
    "name": "ENDPOINT_NAME",
    "status": {
        "id": 1
    },
    "service_profile": {
        "id": SERVICE_PROFILE_ID
    },
    "tariff_profile": {
        "id": TARIFF_PROFILE_ID
    },
    "sim": {
        "id": SIM_ID,
        "activate": false
    }
}

To complete the request, click Send. A 200 OK response status indicates the successful creation of the endpoint.

Multiple endpoints

Prepare your data

The most efficient way to create multiple endpoints via the emnify REST API is to have your data prepared in a comma-separated values (CSV) file.

One way to generate a CSV file is to create a table in Excel that includes the necessary endpoint details. After you create your file, do the following:

  1. In the first row, insert the required properties as columns: endpoint_name, sim_id, service_profile, tariff_profile. If any SIMs shouldn’t be activated immediately, include a sim_activate column.
  2. Fill in the corresponding data for your endpoints. Each row should represent one endpoint.
  3. Once complete, save it as a CSV file (.csv).

Run the API in bulk with Postman

If you haven’t already, set up your Endpoint creation request using the process outlined in the preceding “Individual endpoint” section. Then, follow these steps:

  1. Click Runner in the lower right corner.
  2. Choose how to run your collection and set your Run configuration:
    • Iterations: Number of devices you want to create (also the number of rows from your CSV file).
    • Delay: Time between calls. Best practice is 1000 ms regardless of how many devices you’re creating.
    • Data: Upload your CSV file with the Data File Type set to text/csv.
  3. Adjust any other settings as necessary, then click Start Run.