Skip to content
Get started

Create a sim swap event subscription for a phone number

POST/simswap/subscriptions

Create a sim swap event subscription for a phone number

Header ParametersExpand Collapse
"x-correlator": optional string
Body ParametersJSONExpand Collapse
config: SimSwapConfig { subscriptionDetail, subscriptionExpireTime, subscriptionMaxEvents }

Implementation-specific configuration parameters needed by the subscription manager for acquiring events. In CAMARA we have predefined attributes like subscriptionExpireTime or subscriptionMaxEvents to limit subscription lifetime. Event type attributes must be defined in subscriptionDetail

subscriptionDetail: object { phoneNumber }

The detail of the requested event subscription

phoneNumber: optional string

A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with ’+’.

subscriptionExpireTime: optional string

The subscription expiration time (in date-time format) requested by the API consumer. It must follow RFC 3339 and must have time zone.

formatdate-time
subscriptionMaxEvents: optional number

Identifies the maximum number of event reports to be generated (>=1) requested by the API consumer - Once this number is reached, the subscription ends.

minimum1
protocol: SimSwapProtocol

Identifier of a delivery protocol. Only HTTP is allowed for now

One of the following:
"HTTP"
"MQTT3"
"MQTT5"
"AMQP"
"NATS"
"KAFKA"
sink: string

The address to which events shall be delivered using the selected protocol.

formaturi

Camara Event types eligible for subscription:

  • org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line.
sinkCredential: optional object { credentialType }

A sink credential provides authentication or authorization information necessary to enable delivery of events to a target.

credentialType: "PLAIN" or "ACCESSTOKEN" or "REFRESHTOKEN"

The type of the credential. With the current API version the type MUST be set to ACCESSTOKEN.

One of the following:
"PLAIN"
"ACCESSTOKEN"
"REFRESHTOKEN"
ReturnsExpand Collapse
SimSwapSubscription object { id, config, protocol, 5 more }

Represents a event-type subscription.

id: string

The unique identifier of the subscription in the scope of the subscription manager. When this information is contained within an event notification, this concept SHALL be referred as subscriptionId as per Commonalities Event Notification Model.

config: SimSwapConfig { subscriptionDetail, subscriptionExpireTime, subscriptionMaxEvents }

Implementation-specific configuration parameters needed by the subscription manager for acquiring events. In CAMARA we have predefined attributes like subscriptionExpireTime or subscriptionMaxEvents to limit subscription lifetime. Event type attributes must be defined in subscriptionDetail

subscriptionDetail: object { phoneNumber }

The detail of the requested event subscription

phoneNumber: optional string

A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with ’+’.

subscriptionExpireTime: optional string

The subscription expiration time (in date-time format) requested by the API consumer. It must follow RFC 3339 and must have time zone.

formatdate-time
subscriptionMaxEvents: optional number

Identifies the maximum number of event reports to be generated (>=1) requested by the API consumer - Once this number is reached, the subscription ends.

minimum1
protocol: SimSwapProtocol

Identifier of a delivery protocol. Only HTTP is allowed for now

One of the following:
"HTTP"
"MQTT3"
"MQTT5"
"AMQP"
"NATS"
"KAFKA"
sink: string

The address to which events shall be delivered using the selected protocol.

formaturi

Camara Event types eligible for subscription:

  • org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line. Note: for the Commonalities meta-release v0.4 we enforce to have only event type per subscription then for following meta-release use of array MUST be decided at API project level.
expiresAt: optional string

Date when the event subscription will expire. Only provided when subscriptionExpireTime is indicated by API client or Telco Operator has specific policy about that. It must follow RFC 3339 and must have time zone.

formatdate-time
startsAt: optional string

Date when the event subscription will begin/began It must follow RFC 3339 and must have time zone.

formatdate-time
status: optional "ACTIVATION_REQUESTED" or "ACTIVE" or "EXPIRED" or 2 more

Current status of the subscription - Management of Subscription State engine is not mandatory for now. Note not all statuses may be considered to be implemented. Details:

  • ACTIVATION_REQUESTED: Subscription creation (POST) is triggered but subscription creation process is not finished yet.
  • ACTIVE: Subscription creation process is completed. Subscription is fully operative.
  • INACTIVE: Subscription is temporarily inactive, but its workflow logic is not deleted.
  • EXPIRED: Subscription is ended (no longer active). This status applies when subscription is ended due to SUBSCRIPTION_EXPIRED event.
  • DELETED: Subscription is ended as deleted (no longer active). This status applies when subscription information is kept (i.e. subscription workflow is no longer active but its metainformation is kept).
One of the following:
"ACTIVATION_REQUESTED"
"ACTIVE"
"EXPIRED"
"INACTIVE"
"DELETED"

Create a sim swap event subscription for a phone number

curl https://api.example.com/camara/simswap/subscriptions \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CAMARA_BEARER_TOKEN" \
    -d '{
          "config": {
            "subscriptionDetail": {
              "phoneNumber": "+123456789"
            },
            "subscriptionExpireTime": "2025-01-17T13:18:23.682Z",
            "subscriptionMaxEvents": 10
          },
          "protocol": "HTTP",
          "sink": "https://endpoint.example.com/sink",
          "types": [
            "org.camaraproject.sim-swap-subscriptions.v0.swapped"
          ]
        }'
{
  "protocol": "HTTP",
  "sink": "https://endpoint.example.com/sink",
  "types": [
    "org.camaraproject.sim-swap-subscriptions.v0.swapped"
  ],
  "config": {
    "subscriptionDetail": {
      "phoneNumber": "+123456789"
    },
    "subscriptionExpireTime": "2025-01-17T13:18:23.682Z"
  },
  "id": "1119920371",
  "startsAt": "2024-06-07T16:10:15.302Z",
  "expiresAt": "2024-06-07T16:10:15.302Z",
  "status": "ACTIVATION_REQUESTED"
}
{
  "protocol": "HTTP",
  "sink": "https://endpoint.example.com/sink",
  "types": [
    "org.camaraproject.sim-swap-subscriptions.v0.swapped"
  ],
  "config": {
    "subscriptionDetail": {},
    "subscriptionExpireTime": "2025-01-17T13:18:23.682Z"
  },
  "id": "1119920371",
  "startsAt": "2024-06-07T16:10:15.302Z",
  "expiresAt": "2024-06-07T16:10:15.302Z",
  "status": "ACTIVATION_REQUESTED"
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param."
}
{
  "status": 400,
  "code": "OUT_OF_RANGE",
  "message": "Client specified an invalid range."
}
{
  "status": 400,
  "code": "INVALID_PROTOCOL",
  "message": "Only HTTP is supported"
}
{
  "status": 400,
  "code": "INVALID_CREDENTIAL",
  "message": "Only Access token is supported"
}
{
  "status": 400,
  "code": "INVALID_TOKEN",
  "message": "Only bearer token is supported"
}
{
  "status": 400,
  "code": "INVALID_SINK",
  "message": "sink not valid for the specified protocol"
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials. A new authentication is required."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 409,
  "code": "ABORTED",
  "message": "Concurrency conflict."
}
{
  "status": 409,
  "code": "ALREADY_EXISTS",
  "message": "The resource that a client tried to create already exists."
}
{
  "status": 422,
  "code": "SERVICE_NOT_APPLICABLE",
  "message": "The service is not available for the provided identifier."
}
{
  "status": 422,
  "code": "MISSING_IDENTIFIER",
  "message": "The device cannot be identified."
}
{
  "status": 422,
  "code": "UNNECESSARY_IDENTIFIER",
  "message": "The device is already identified by the access token."
}
{
  "status": 429,
  "code": "QUOTA_EXCEEDED",
  "message": "Out of resource quota."
}
{
  "status": 429,
  "code": "TOO_MANY_REQUESTS",
  "message": "Rate limit reached."
}
Returns Examples
{
  "protocol": "HTTP",
  "sink": "https://endpoint.example.com/sink",
  "types": [
    "org.camaraproject.sim-swap-subscriptions.v0.swapped"
  ],
  "config": {
    "subscriptionDetail": {
      "phoneNumber": "+123456789"
    },
    "subscriptionExpireTime": "2025-01-17T13:18:23.682Z"
  },
  "id": "1119920371",
  "startsAt": "2024-06-07T16:10:15.302Z",
  "expiresAt": "2024-06-07T16:10:15.302Z",
  "status": "ACTIVATION_REQUESTED"
}
{
  "protocol": "HTTP",
  "sink": "https://endpoint.example.com/sink",
  "types": [
    "org.camaraproject.sim-swap-subscriptions.v0.swapped"
  ],
  "config": {
    "subscriptionDetail": {},
    "subscriptionExpireTime": "2025-01-17T13:18:23.682Z"
  },
  "id": "1119920371",
  "startsAt": "2024-06-07T16:10:15.302Z",
  "expiresAt": "2024-06-07T16:10:15.302Z",
  "status": "ACTIVATION_REQUESTED"
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param."
}
{
  "status": 400,
  "code": "OUT_OF_RANGE",
  "message": "Client specified an invalid range."
}
{
  "status": 400,
  "code": "INVALID_PROTOCOL",
  "message": "Only HTTP is supported"
}
{
  "status": 400,
  "code": "INVALID_CREDENTIAL",
  "message": "Only Access token is supported"
}
{
  "status": 400,
  "code": "INVALID_TOKEN",
  "message": "Only bearer token is supported"
}
{
  "status": 400,
  "code": "INVALID_SINK",
  "message": "sink not valid for the specified protocol"
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials. A new authentication is required."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 409,
  "code": "ABORTED",
  "message": "Concurrency conflict."
}
{
  "status": 409,
  "code": "ALREADY_EXISTS",
  "message": "The resource that a client tried to create already exists."
}
{
  "status": 422,
  "code": "SERVICE_NOT_APPLICABLE",
  "message": "The service is not available for the provided identifier."
}
{
  "status": 422,
  "code": "MISSING_IDENTIFIER",
  "message": "The device cannot be identified."
}
{
  "status": 422,
  "code": "UNNECESSARY_IDENTIFIER",
  "message": "The device is already identified by the access token."
}
{
  "status": 429,
  "code": "QUOTA_EXCEEDED",
  "message": "Out of resource quota."
}
{
  "status": 429,
  "code": "TOO_MANY_REQUESTS",
  "message": "Rate limit reached."
}