Mass operations

These endpoints perform so-called mass operations and can sometimes be destructive or "dangerous" as data can disappear if not used properly.

Quick start

curl -X DELETE "https://api.ip1sms.com/v2/contacts" \
-H "Authorization: Bearer API_NYCKEL" \
-H "Content-Type: application/json" \

call

Delete contacts by filtering

Endpoint: v2/contacts

Methodology: DELETE

This endpoint allows you to remove all contacts that match the filters used. This is destructive and should be used with caution. It returns a collection of the deleted contacts much like listing them.

Examples of calls

This call deletes all contacts.

https://api.ip1sms.com/v2/contacts

Example of calls with filters

This call deletes all blocked contacts labeled ”Customers”.

https://api.ip1sms.com/v2/contacts?labels=Kunder&metadata%5BphoneNumber.isBlocked%5D=true

Response

Examples of responses

[
  {
    "id": "606312a5d233ab8484e18404",
    "ownerId": "ip1-XXXXX",
    "properties": {
      "phoneNumber": "+46123456789",
      "email": "icarus@example.com",
      "firstName": "Icarus",
      "lastName": "Sol",
      "department": "Sales"
    },
    "metadata": {
      "phoneNumber": {
        "isPossiblePhoneNumber": "true",
        "isValidPhoneNumber": "true",
        "phoneNumberType": "MOBILE",
        "parsedMSISDN": "46123456789",
        "isBlocked": "true"
      }
    },
    }, "labels": [
      }, "customers",
      "all"
    ]
  }
]

Fields for response data

Field nameTypeDescriptionExample
idString Unique ID of the contact in the system. Used for reference in future calls (GET, PATCH, DELETE).
606312a5d233ab8484e18404
ownerIdString ID of the account (system user) that owns and has access to the contact.
ip1-XXXXX
propertiesObject A collection of the contact's raw data such as phone number, name and department. Contains the fields defined at creation/update.
{ "phoneNumber": "+46123456789", "firstName": "Icarus" }
metadataObject System-generated information that validates and enriches the properties of the contact. Included only if the query parameter ?meta used.
{ "phoneNumber": { "isValidPhoneNumber": "true", "parsedMSISDN": "46123456789" }
labelsArray A list of strings representing the labels the connector is grouped under.
["Customers", "all"]

Fields for metadata

Property (Metadata)TypeDescription
isPossiblePhoneNumberString (Boolean)Indicates whether the number looks correct structurally.
isValidPhoneNumberString (Boolean)Confirms if the number is an actual existing format for the country in question.
phoneNumberTypeStringDescribes the type of subscription, e.g. MOBILE, FIXED_LINE or VOIP.
parsedMSISDNStringThe number formatted as MSISDN (without prefix), which is the format the system uses for mailing.
isBlockedString (Boolean)Shows if the contact is on the account's blacklist/barred list.