# Create Data Request Event Create an event that will be added to the audit trail for a data request. For example, if you are building an integration where you email a link to your user, you can create an event to track that action. > See the [Data Requests](../data_requests.md) documentation for more information. {% method -%} ### HTTP Request `POST https://api.docspring.com/api/v1/data_requests//events` ### Authentication You must send an `Authorization` header with the value `Basic` followed by base 64 encoded `token_id:token_secret`. For example: `Authorization: Basic dG9rZW5faWQ6dG9rZW5fc2VjcmV0Cg==` > See the [Authentication](authentication.md) documentation for more information. ### Example Response ```json { "status": "success", "event": { "id": "dre_000000000000000000001", "data_request_id": "drq_000000000000000000001", "event_type": "send_request", "occurred_at": "2024-01-01T00:00:00Z", "message_type": "email", "message_recipient": "test@example.com" } } ``` ### Example Code {% sample lang="javascript" -%} ```javascript var DocSpring = require('docspring') var config = new DocSpring.Configuration() config.apiTokenId = 'DOCSPRING_TOKEN_ID' config.apiTokenSecret = 'DOCSPRING_TOKEN_SECRET' client = new DocSpring.Client(config) client.createDataRequestEvent( 'DATA_REQUEST_ID', { event_type: 'send_request', occurred_at: '2024-01-01T00:00:00Z', message_type: 'email', message_recipient: 'test@example.com', }, function (error, token) { if (error) throw error console.log(token) } ) ``` {% sample lang="ruby" -%} ```ruby require 'docspring' DocSpring.configure do |c| c.username = ENV['DOCSPRING_TOKEN_ID'] c.password = ENV['DOCSPRING_TOKEN_SECRET'] end docspring = DocSpring::Client.new response = docspring.create_data_request_event( 'DATA_REQUEST_ID', "event_type": "send_request", "occurred_at": "2024-01-01T00:00:00Z", "message_type": "email", "message_recipient": "test@example.com" ) puts response ``` {% endmethod %}