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

# Quickstart

# Quickstart

Get up and running with the Revelation 14 API in under 5 minutes.

## Step 1: Authentication

First, you'll need to authenticate with the API to get an access token.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/auth/login \
    -H "Content-Type: application/json" \
    -H "apikey: your_supabase_anon_key" \
    -d '{
      "email": "your@email.com",
      "password": "your_password"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/auth/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'apikey': 'your_supabase_anon_key'
    },
    body: JSON.stringify({
      email: 'your@email.com',
      password: 'your_password'
    })
  });

  const data = await response.json();
  const accessToken = data.data.accessToken;
  ```

  ```dart Flutter/Dart theme={null}
  final response = await http.post(
    Uri.parse('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/auth/login'),
    headers: {
      'Content-Type': 'application/json',
      'apikey': 'your_supabase_anon_key',
    },
    body: jsonEncode({
      'email': 'your@email.com',
      'password': 'your_password',
    }),
  );

  final data = jsonDecode(response.body);
  final accessToken = data['data']['accessToken'];
  ```
</CodeGroup>

## Step 2: Make Your First API Call

Now use your access token to create a note:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create \
    -H "Authorization: Bearer your_access_token" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "My First Note",
      "content": "This is my first note created via the API!",
      "status": "DRAFT"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'My First Note',
      content: 'This is my first note created via the API!',
      status: 'DRAFT'
    })
  });

  const note = await response.json();
  ```

  ```dart Flutter/Dart theme={null}
  final response = await http.post(
    Uri.parse('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-create'),
    headers: {
      'Authorization': 'Bearer $accessToken',
      'Content-Type': 'application/json',
    },
    body: jsonEncode({
      'title': 'My First Note',
      'content': 'This is my first note created via the API!',
      'status': 'DRAFT',
    }),
  );

  final note = jsonDecode(response.body);
  ```
</CodeGroup>

## Step 3: Fetch Your Notes

Retrieve your notes with proper user filtering:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=10" \
    -H "Authorization: Bearer your_access_token"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=10', {
    headers: {
      'Authorization': `Bearer ${accessToken}`
    }
  });

  const data = await response.json();
  const notes = data.data.notes;
  ```

  ```dart Flutter/Dart theme={null}
  final response = await http.get(
    Uri.parse('https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/notes-fetch?limit=10'),
    headers: {
      'Authorization': 'Bearer $accessToken',
    },
  );

  final data = jsonDecode(response.body);
  final notes = data['data']['notes'];
  ```
</CodeGroup>

## Expected Response

```json theme={null}
{
  "message": "Notes fetched successfully",
  "data": {
    "notes": [
      {
        "id": "abc123...",
        "title": "My First Note",
        "content": "This is my first note created via the API!",
        "status": "DRAFT",
        "createdBy": "user_id",
        "createdAt": "2025-10-14T09:33:33.348Z",
        "updatedAt": "2025-10-14T09:33:33.348Z"
      }
    ],
    "pagination": {
      "total": 1,
      "limit": 10,
      "offset": 0,
      "hasMore": false
    },
    "userId": "user_id"
  },
  "success": true
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication Guide" icon="key" href="/authentication">
    Learn about JWT tokens, user roles, and security
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference">
    Explore all available endpoints and parameters
  </Card>
</CardGroup>

<Note>
  All API endpoints require valid authentication. Make sure to include your access token in the Authorization header.
</Note>
