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

# Account Activated

> Webhook event fired when an account is successfully activated in the system

# Account Activated

<Info>
  **Event Name:** `account_activated`
</Info>

<Note>
  This event signifies that the account is now ready for operational use and transactions can be processed.
</Note>

## Event Payload

The webhook payload contains the following structure:

<CodeGroup>
  ```json Example Payload theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "event": "account_activated",
    "timestamp": "2025-06-19T16:04:13.123Z",
    "data": {
      "accountId": "550e8400-e29b-41d4-a716-446655440000"
    }
  }
  ```
</CodeGroup>

### Payload Fields

<ParamField path="id" type="string" required>
  Unique identifier for this webhook event
</ParamField>

<ParamField path="event" type="string" required>
  Event type - always `account_activated` for this webhook
</ParamField>

<ParamField path="timestamp" type="string" required>
  ISO 8601 timestamp indicating when the event occurred
</ParamField>

<ParamField path="data.accountId" type="string" required>
  Unique identifier of the account that was activated
</ParamField>

## Expected Responses

<CardGroup cols={3}>
  <Card title="Success Response" icon="circle-check" color="#16a34a">
    **HTTP 200 OK**

    The webhook was processed successfully.
  </Card>

  <Card title="Client Error" icon="triangle-exclamation" color="#dc2626">
    **HTTP 4xx Status**

    Client-side error. Will not be retried.
  </Card>

  <Card title="Server Error" icon="circle-xmark" color="#ea580c">
    **HTTP 5xx Status**

    Server-side error. Will be retried with exponential backoff.
  </Card>
</CardGroup>

## Implementation Example

<CodeGroup>
  ```javascript Node.js theme={null}
  app.post('/webhooks/ralio', (req, res) => {
    const { event, data } = req.body;
    
    if (event === 'account_activated') {
      const { accountId } = data;
      
      // Process account activation
      console.log(`Account ${accountId} has been activated`);
      
      // Update your internal systems
      await updateAccountStatus(accountId, 'ACTIVE');
      
      // Respond with success
      res.status(200).json({ received: true });
    }
  });
  ```

  ```python Python theme={null}
  @app.route('/webhooks/ralio', methods=['POST'])
  def handle_webhook():
      payload = request.get_json()
      
      if payload['event'] == 'account_activated':
          account_id = payload['data']['accountId']
          
          # Process account activation
          print(f"Account {account_id} has been activated")
          
          # Update your internal systems
          update_account_status(account_id, 'ACTIVE')
          
          # Respond with success
          return jsonify({'received': True}), 200
  ```

  ```go Go theme={null}
  func handleWebhook(w http.ResponseWriter, r *http.Request) {
      var payload struct {
          Event string `json:"event"`
          Data  struct {
              AccountID string `json:"accountId"`
          } `json:"data"`
      }
      
      if err := json.NewDecoder(r.Body).Decode(&payload); err != nil {
          http.Error(w, "Invalid JSON", http.StatusBadRequest)
          return
      }
      
      if payload.Event == "account_activated" {
          // Process account activation
          log.Printf("Account %s has been activated", payload.Data.AccountID)
          
          // Update your internal systems
          err := updateAccountStatus(payload.Data.AccountID, "ACTIVE")
          if err != nil {
              http.Error(w, "Internal error", http.StatusInternalServerError)
              return
          }
          
          // Respond with success
          w.Header().Set("Content-Type", "application/json")
          w.WriteHeader(http.StatusOK)
          json.NewEncoder(w).Encode(map[string]bool{"received": true})
      }
  }
  ```
</CodeGroup>
