> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Profile subscription

> Used to get subscription statuses from user profiles.

<br>

<p>This endpoint will return subscription status changes for user profiles, for example email and SMS. This does not include subscription changes for devices.</p>

<p>Further information on user profiles, device profiles and attributes can be found in the guide on user data.</p>

<br>

<p><strong>Note:</strong> Logging of profile subscription changes is turned off by default and this API method will return empty result sets. If you believe you need access to this data, please contact us.</p>

<p>The response includes an integer-boolean <code>status</code> value to indicate whether the subscription was added or removed, and the integer-boolean <code>update_is_external</code> value, which indicates whether the status has been updated externally or not; when set to <code>1</code>, the permission was updated via file import or external API import; when set to <code>0</code>, the update occurred via SDK, a preference center link included in an email/SMS, or by manually editing the profile from the platform.</p>

## OpenAPI

````json POST /list/profile-subscription
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/list/profile-subscription": {
      "post": {
        "summary": "Profile subscription",
        "description": "Used to get subscription statuses from user profiles.\n\n<br>\n\n<p>This endpoint will return subscription status changes for user profiles, for example email and SMS. This does not include subscription changes for devices.</p>\n\n<p>Further information on user profiles, device profiles and attributes can be found in the guide on user data.</p>\n\n<br>\n\n<p><strong>Note:</strong> Logging of profile subscription changes is turned off by default and this API method will return empty result sets. If you believe you need access to this data, please contact us.</p>\n\n<p>The response includes an integer-boolean <code>status</code> value to indicate whether the subscription was added or removed, and the integer-boolean <code>update_is_external</code> value, which indicates whether the status has been updated externally or not; when set to <code>1</code>, the permission was updated via file import or external API import; when set to <code>0</code>, the update occurred via SDK, a preference center link included in an email/SMS, or by manually editing the profile from the platform.</p>",
        "operationId": "user-profile-subscription",
        "deprecated": "false",
        "requestBody": {
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "order": {
                    "type": "array",
                    "description": "Order the results in either ascending or descending order based on any of the attributes, eg. `[\"update_time\"]` or `[\"update_time DESC\"]`",
                    "items": {
                      "type": "string"
                    }
                  },
                  "select": {
                    "type": "array",
                    "description": "Select what attributes to return, eg. `[\"channel\", \"mobile_number\", \"email\", \"profile_id\", \"status\", \"update_time\", \"user_id\"]`",
                    "items": {
                      "type": "string"
                    }
                  },
                  "condition": {
                    "type": "string",
                    "format": "json",
                    "description": "Filter the user profiles based on some criteria, eg. `[ [\"user_id\", \"=\", 1234] ]` or `[ [\"update_time\", \">\", 123123] ]`"
                  },
                  "limit": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Used with *offset* for pagination, eg. `\"limit\": 50, \"offset\": 0` returns a max of 50 results starting at position 0"
                  },
                  "offset": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Used with *limit* for pagination"
                  }
                }
              },
              "examples": {
                "Get a single user profile's subscription status": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "condition": [
                      [
                        "user_id",
                        "=",
                        "USER_ID"
                      ]
                    ]
                  }
                },
                "Get all profiles updated since a certain time": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "condition": [
                      [
                        "update_time",
                        ">",
                        "123123"
                      ]
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "true",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "200",
                      "default": "0"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "project_id": {
                            "type": "string",
                            "example": "PROJECT_ID"
                          },
                          "profile_id": {
                            "type": "string",
                            "example": "11eb0ca1064e53d188bc7061c72c7ac00"
                          },
                          "channel": {
                            "type": "string",
                            "example": "email"
                          },
                          "status": {
                            "type": "integer",
                            "example": "1",
                            "default": "0"
                          },
                          "update_time": {
                            "type": "integer",
                            "example": "1629197947",
                            "default": "0"
                          },
                          "update_is_external": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "user_id": {
                            "type": "string",
                            "example": "1234"
                          },
                          "email": {
                            "type": "string",
                            "example": "info@xtremepush.com"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "data": [
                        {
                          "project_id": "PROJECT_ID",
                          "profile_id": "11eb0ca1064e53d188bc7061c72c7ac00",
                          "channel": "email",
                          "status": "1",
                          "update_time": "1629197947",
                          "update_is_external": "0",
                          "user_id": "1234",
                          "email": "info@xtremepush.com"
                        },
                        {
                          "project_id": "PROJECT_ID",
                          "profile_id": "11eb0ca1064e53d188bc7061c72c7ac00",
                          "channel": "sms",
                          "status": "0",
                          "update_time": "1630588310",
                          "update_is_external": "1",
                          "user_id": "1234",
                          "mobile_number": "353123456789"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "400",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "General error information"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "General error information",
                      "errors": [
                        {
                          "text": [
                            "Detailed information about the specific error"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "User Profile Methods"
        ]
      }
    }
  }
}
````

