Skip to Content

Edit Tags

PUT/tagsInventory & Account ManagementOpenAPI

Add or remove tags for one SIM or for SIMs in bulk.

Auth Scope
urn:grt:gemm
Content-Type
application/json
Base URL
https://gemmapi2.granitenet.com/v2/api/gemm/v1

Uses and Requirements

Edit Tags API Response Behavior

The Edit Tags API responds synchronously or asynchronously, depending on the number of SIMs in the request:

RequestResponse
Exactly 1 SIMSynchronous. The tags are updated immediately and the response contains the result.
2 to 1000 SIMsAsynchronous. The response contains only a transactionID. One callback is sent for each SIM, all with the same transactionID.

Tag rules

  • Each SIM must have at least one tag in addTags or removeTags.
  • Each tag can be up to 100 characters and may contain only letters, numbers, spaces, colon (:), underscore (_), hyphen (-), at (@) and period (.).
  • Each list can contain up to 10 tags, and tags in a list must be unique (case-insensitive).
  • The same tag cannot appear in both addTags and removeTags.
  • Single SIM only: a tag being added must not already exist on the SIM, and a tag being removed must already exist on the SIM.
  • Single SIM only: a SIM can have at most 10 tags after the changes are applied.
  • These two checks are not run for requests with two or more SIMs, so a bulk request is not rejected with 400 for them.

Note

All SIMs are validated before any tag is changed, for both single and bulk requests. If any SIM fails validation, the whole request is rejected with HTTP 400 and no tags are changed.

HTTP Status Codes

StatusWhen
200Single SIM: the tags were updated and the response contains the result. Two or more SIMs: the request was accepted, the response contains a transactionID and the result for each SIM is sent in a callback.
400The request failed validation: no SIMs or more than 1,000, a SIM identifier is missing or has the wrong format, a SIM has no addTags or removeTags, a tag is invalid or repeated, the same tag is in addTags and removeTags, a SIM is not found, is not on your account or is still in Requested status, for a single SIM a tag to add already exists, a tag to remove does not exist or the SIM would have more than 10 tags, the macnum header is missing or malformed, or the body is not valid JSON. Two or more SIMs: the response lists each SIM with its error.
401The bearer token is missing, invalid or expired, or you do not have access to the account in the macnum header.
403The Write Tags feature is not enabled for your user, your token does not have a role allowed to call this endpoint, or (single SIM) the SIM belongs to an account you do not have access to or is not under the account in the macnum header.
429Too many requests were sent in a short period. Wait briefly and retry.
500An unexpected server error occurred.
503The system is under scheduled maintenance. Retry after the maintenance window.
504A dependent service did not respond in time. Retry the request.

Available For

  • ATT
  • Granite Wireless - VzW
  • T-Mobile
  • Verizon
  • Granite Multi Carrier SIM
  • Verizon eSIM
  • SIM360

Headers

HeaderValue
AuthorizationBearer access-token
Content-Typeapplication/json
macnumMacnum of the top level account for your organization.

Request Body Parameters

ParameterTypeRequiredDescription
simsarray of simInfo objectsYesNOTE: You can submit one or more SIMs in a request, up to a maximum of 1,000.
simInfoobjectYesSIM information.
iccidstringYes19-20 digits.
tagItemobjectYesContainer for tag operations, including addTags and removeTags.
addTagsarray of stringsConditionalList of tags to add to the SIM, for example ["Test_Tag"].
removeTagsarray of stringsConditionalList of tags to remove from the SIM, for example ["UserTag"].

Request Examples

Responses

Sync Success Response (200 OK)

Sync Response Fields

ParameterTypeDescription
transactionIDstringA unique string saved for tracking purposes.
resultobjectResult status object.
statusstringResult status: success or failure.
messagestringResult message.

Immediate Success Response (200 OK)

Response Fields

ParameterTypeDescription
transactionIDstringA unique string that associates the request with the results sent in callbacks.
Mobility sends a separate callback for each SIM in the request, indicating whether the operation succeeded for that SIM. All callbacks have the same transactionID.

Callback Success Response

Callback Response Fields

ParameterTypeDescription
requestTypestringName of the requested action. For Edit Tags, the value is EditTags.
transactionIDstringA unique string that associates the request with the results sent in callbacks. Mobility sends a separate callback for each SIM in the request, indicating whether the operation succeeded for that SIM. All callbacks have the same transactionID.
simInfoobjectSIM information.
iccidstring19-20 digits.
msisdnstring10 digits.
resultobjectResult status object.
statusstringResult status: success or failure.
messagestringResult message.
errorsobjectList of errors.
errorCodestringError code.
errorMessagestringError message.
callbackCountintegerThe number of times this callback message has been sent.
maxCallbackThresholdintegerThe maximum number of times this callback message will be sent if it is not correctly acknowledged.

Failure Responses

Immediate Error Message

Error Response Fields

ParameterTypeDescription
resultobjectResult status object.
statusstringResult status: success or failure.
errorsobjectList of errors.
errorCodestringError code.
errorMessagestringError message.

Sync Failure Response: Single SIM (500)

When the tag update for a single SIM fails, the HTTP 500 response has the same shape as the sync success response, with no errors list.

Immediate Validation Error: Two or More SIMs (400)

When a request with two or more SIMs fails validation, the HTTP 400 response lists each SIM with its error.

Example Failure Callback: Bulk SIMs

Code Examples

Last updated on