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

# Create Note

> Create a new note record for annotations or comments

<Note>
  This endpoint requires authentication with `notes:write` permission.
</Note>

### Request Parameters

<ParamField body="title" type="string" required>
  The title or subject of the note
</ParamField>

<ParamField body="body" type="string" required>
  The main content or body of the note
</ParamField>

<ParamField body="created_by" type="string">
  ID or name of the user creating the note (auto-filled if not provided)
</ParamField>

<ParamField body="associated_id" type="string">
  Optional ID of the resource this note is associated with (e.g., order ID)
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique identifier for the created note
</ResponseField>

<ResponseField name="title" type="string">
  The title of the note
</ResponseField>

<ResponseField name="body" type="string">
  The content of the note
</ResponseField>

<ResponseField name="created_date" type="string">
  Timestamp when the note was created
</ResponseField>

<ResponseField name="last_modified_date" type="string">
  Timestamp when the note was last updated
</ResponseField>

<ResponseField name="created_by" type="string">
  User who created the note
</ResponseField>

<ResponseField name="last_modified_by" type="string">
  User who last modified the note
</ResponseField>

### Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/notes' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <token>' \
  --data-raw '{
      "title": "Important Update",
      "body": "Customer requested expedited shipping",
      "associated_id": "order_123"
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.stateset.com/v1/notes', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
      title: 'Important Update',
      body: 'Customer requested expedited shipping',
      associated_id: 'order_123'
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.stateset.com/v1/notes',
      headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_API_KEY'
      },
      json={
          'title': 'Important Update',
          'body': 'Customer requested expedited shipping',
          'associated_id': 'order_123'
      }
  )
  ```
</RequestExample>

### Response Example

<ResponseExample>
  ```json Success Response theme={null}
  {
    "id": "note_001",
    "title": "Important Update",
    "body": "Customer requested expedited shipping",
    "created_date": "2024-01-01T12:00:00Z",
    "last_modified_date": "2024-01-01T12:00:00Z",
    "created_by": "user_123",
    "last_modified_by": "user_123"
  }
  ```

  ```json Error Response theme={null}
  {
    "success": false,
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Missing required field: title"
    }
  }
  ```
</ResponseExample>
