API Requests

Learn how to make an API request

Make an API Request

You will need an auth_token from a user (see Authentication) to make requests to Verida endpoints.

API requests must include the auth_tokenin the Authorization header as a Bearer token.

const API_ENDPOINT = "https://api.verida.ai/api/rest/v1/auth";
// Obtain token from localstorage (or your own database)
const authToken = localStorage.getItem("veridaAuthToken") || "";

// Example: search/universal endpoint
$.get({
    url: `${API_ENDPOINT}/search/universal?keywords=meeting+agenda`,
    headers: {
        "Authorization": `Bearer ${authToken}`,
        "Content-Type": "application/json"
    },
    success: (response) => {
        console.log(response);
        // Handle the response data
    }
});

Important: Ensure you store and handle the auth_token securely. Unauthorized access to this token could compromise your application and user data.

See the Data APIs or API Reference to learn more about all the available endpoints

Last updated