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

# PostFlow IDs

> How PostFlow identifies resources across the API

Every object in the PostFlow API has a unique ID. PostFlow uses a system called "Snowflake ID" created by Twitter.

These IDs are **64-bit unsigned integers**. Some programming languages (JavaScript) cannot accurately represent 64-bit integers.

<Danger>
  You must **ALWAYS** use strings for PostFlow IDs in your code.
</Danger>

## String vs integer in Javascript

In JavaScript, integers are limited to 53 bits. This causes precision loss with large IDs:

```javascript theme={null}
// This loses precision!
const id = 10765432100123456789;
console.log(id.toString()); // "10765432100123458000" — wrong!

// Use strings instead
const id = "10765432100123456789";
console.log(id); // "10765432100123456789" — correct!
```

## Comparing IDs

Examples of how you can compare PostFlow IDs:

<CodeGroup>
  ```javascript javascript theme={null}
  // Use BigInt

  if (BigInt(post1.id) > BigInt(post2.id)) {
      console.log("post1 is newer");
  }
  ```

  ```python python theme={null}
  # Python handles large integers natively

  if post1.id > post2.id:
      print("post1 is newer")
  ```

  ```php php theme={null}
  # PHP is safe with 64-bit integers

  if (post1->id > post2->id) {
      dd("post1 is newer");
  }
  ```
</CodeGroup>
