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

# Create Note

> Create Note

Create Note

```http theme={null}
POST https://services.leadconnectorhq.com/calendars/appointments/{appointmentId}/notes
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="appointmentId" type="string" required>
  Appointment ID
</ParamField>

## Body

<ParamField body="userId" type="string" default="GCs5KuzPqTls7vWclkEV" />

<ParamField body="body" type="string" required default="lorem ipsum">
  Note body
</ParamField>

## Respuestas

<Accordion title="201 - Successful response">
  <ResponseField name="note" type="object">
    <Expandable title="propiedades">
      <ResponseField name="id" type="string" default="HGPcayliwcdoUFzvbTok" />

      <ResponseField name="body" type="string" default="lorem ipsum" />

      <ResponseField name="userId" type="string" default="TUcmRxWrjqzJS8EjkxNK" />

      <ResponseField name="dateAdded" type="string" default="2021-07-08T12:02:11.285Z" />

      <ResponseField name="contactId" type="string" default="TUcmRxWrjqzJS8EjkxNK" />

      <ResponseField name="createdBy" type="object">
        <Expandable title="propiedades">
          <ResponseField name="id" type="string" default="TUcmRxWr" />

          <ResponseField name="name" type="string" default="John Doe" />
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  ```json theme={null}
  {
    "note": {
      "id": "HGPcayliwcdoUFzvbTok",
      "body": "lorem ipsum",
      "userId": "TUcmRxWrjqzJS8EjkxNK",
      "dateAdded": "2021-07-08T12:02:11.285Z",
      "contactId": "TUcmRxWrjqzJS8EjkxNK",
      "createdBy": {
        "id": "TUcmRxWr",
        "name": "John Doe"
      }
    }
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/calendars/appointments/YOUR_appointmentId/notes' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "userId": "GCs5KuzPqTls7vWclkEV",
    "body": "lorem ipsum"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/calendars/appointments/YOUR_appointmentId/notes', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"userId": "GCs5KuzPqTls7vWclkEV", "body": "lorem ipsum"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/calendars/appointments/YOUR_appointmentId/notes',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"userId": "GCs5KuzPqTls7vWclkEV", "body": "lorem ipsum"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/calendars/appointments/YOUR_appointmentId/notes');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'userId': 'GCs5KuzPqTls7vWclkEV', 'body': 'lorem ipsum'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
