# Notification URL Verification

To ensure endpoint availability, Aurinko performs a validation handshake when a subscription is created.<br>

1. **The Verification Request**\
   When you call the <mark style="color:red;">POST</mark> <mark style="color:red;"></mark><mark style="color:red;">`/v1/subscriptions`</mark> endpoint, Aurinko immediately sends a POST request to your provided notificationUrl. \
   \
   **Request Details:**

   * **Method:** <mark style="color:red;">POST</mark>
   * **Query Parameter:** <mark style="color:red;">validationToken</mark> (a random string generated by Aurinko)

   \
   **Example Request:**

   ```
   Content-Type: text/plain; charset=utf-8
   POST https://{notificationUrl}?validationToken={challenge}
   ```

2. **Your Server’s Response**\
   Verify request see Authentication. Your endpoint must respond to this POST request to prove it is active and authorized to receive notifications.

* **Status Code:** <mark style="color:red;">200 OK</mark>
* **Content-Type:** <mark style="color:red;">text/plain</mark>
* **Response Body:** Must contain only the value of the [<mark style="color:red;">validationToken</mark>](#user-content-fn-1)[^1] parameter received in the request.\
  \
  **Example Response:**

  ```
  HTTP/1.1 200 OK Content-Type: text/plain
  679732f7-8775-4340-a33d-713217277682
  ```

3. **Critical Requirements**

* **Timeout:** Your server must respond within 30 seconds. If the request times out or returns an error (e.g., 4xx or 5xx), the subscription creation will fail.
* **Plain Text:** Ensure your framework does not wrap the token in JSON or HTML. It must be a raw string response.\
  \
  **Subscription Workflow Summary**
  1. **Register:** Your app calls <mark style="color:red;">POST</mark> <mark style="color:red;"></mark><mark style="color:red;">`/v1/subscriptions`</mark>.
  2. **Verify:** Aurinko calls your URL via <mark style="color:red;">POST</mark> with a <mark style="color:red;">validationToken</mark>.
  3. **Confirm:** Your server returns the token.
  4. **Activate:** Aurinko returns a <mark style="color:red;">200 Success</mark> to your original registration call and begins sending <mark style="color:red;">POST</mark> notifications.

[^1]:
