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

# Me

> API endpoints for current user operations

## Get Current User Info

<api-endpoint method="GET" path="/me" />

Get the current user information.

### Response

<ResponseField name="id" type="string">
  The user's unique identifier
</ResponseField>

<ResponseField name="email" type="string">
  The user's email address
</ResponseField>

<ResponseField name="first_name" type="string">
  The user's first name
</ResponseField>

<ResponseField name="last_name" type="string">
  The user's last name
</ResponseField>

<ResponseField name="created_at" type="string">
  When the user was created (ISO 8601 format)
</ResponseField>

<ResponseField name="updated_at" type="string">
  When the user was last updated (ISO 8601 format)
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.plaisolutions.com/me' \
  --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.plaisolutions.com/me', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    }
  });

  const user = await response.json();
  console.log(user);
  ```

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

  url = "https://api.plaisolutions.com/me"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.get(url, headers=headers)
  user = response.json()
  print(user)
  ```
</CodeGroup>

***

## Update Profile

<api-endpoint method="PATCH" path="/me" />

Update the current user's profile information.

### Request Body

<ParamField body="first_name" type="string" optional>
  Updated first name
</ParamField>

<ParamField body="last_name" type="string" optional>
  Updated last name
</ParamField>

<ParamField body="email" type="string" optional>
  Updated email address
</ParamField>

### Response

Returns the updated user object with the same structure as the GET `/me` endpoint.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request PATCH 'https://api.plaisolutions.com/me' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "first_name": "John",
    "last_name": "Doe"
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.plaisolutions.com/me', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      first_name: "John",
      last_name: "Doe"
    })
  });

  const updatedUser = await response.json();
  console.log(updatedUser);
  ```

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

  url = "https://api.plaisolutions.com/me"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json"
  }
  data = {
      "first_name": "John",
      "last_name": "Doe"
  }

  response = requests.patch(url, headers=headers, json=data)
  updated_user = response.json()
  print(updated_user)
  ```
</CodeGroup>

***

## List Current User Invitations

<api-endpoint method="GET" path="/me/invitations" />

List all invitations for the current user.

### Response

<ResponseField name="invitations" type="array">
  Array of invitation objects

  <Expandable title="Invitation Object">
    <ResponseField name="id" type="string">
      Invitation unique identifier
    </ResponseField>

    <ResponseField name="email" type="string">
      Email address the invitation was sent to
    </ResponseField>

    <ResponseField name="organization_id" type="string">
      ID of the organization for this invitation
    </ResponseField>

    <ResponseField name="project_id" type="string">
      ID of the project for this invitation (if applicable)
    </ResponseField>

    <ResponseField name="organization_role" type="string">
      Role in the organization (OWNER, ADMIN, MEMBER, VIEWER)
    </ResponseField>

    <ResponseField name="project_role" type="string">
      Role in the project (OWNER, ADMIN, MEMBER, VIEWER)
    </ResponseField>

    <ResponseField name="created_at" type="string">
      When the invitation was created (ISO 8601 format)
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      When the invitation was last updated (ISO 8601 format)
    </ResponseField>

    <ResponseField name="organization" type="object">
      Organization details
    </ResponseField>

    <ResponseField name="project" type="object">
      Project details (if applicable)
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.plaisolutions.com/me/invitations' \
  --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.plaisolutions.com/me/invitations', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    }
  });

  const invitations = await response.json();
  console.log(invitations);
  ```

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

  url = "https://api.plaisolutions.com/me/invitations"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.get(url, headers=headers)
  invitations = response.json()
  print(invitations)
  ```
</CodeGroup>

***

## Get Current User Invitation

<api-endpoint method="GET" path="/me/invitations/{invitation_id}" />

Get a specific invitation for the current user.

### Path Parameters

<ParamField path="invitation_id" type="string" required>
  The unique identifier of the invitation
</ParamField>

### Response

Returns a single invitation object with the same structure as described in the list invitations endpoint.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.plaisolutions.com/me/invitations/inv_123' \
  --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript JavaScript theme={null}
  const invitationId = 'inv_123';
  const response = await fetch(`https://api.plaisolutions.com/me/invitations/${invitationId}`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    }
  });

  const invitation = await response.json();
  console.log(invitation);
  ```

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

  invitation_id = "inv_123"
  url = f"https://api.plaisolutions.com/me/invitations/{invitation_id}"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.get(url, headers=headers)
  invitation = response.json()
  print(invitation)
  ```
</CodeGroup>

***

## Reply to Invitation

<api-endpoint method="POST" path="/me/invitations/{invitation_id}/reply" />

Reply to an invitation by accepting or declining it.

### Path Parameters

<ParamField path="invitation_id" type="string" required>
  The unique identifier of the invitation
</ParamField>

### Request Body

<ParamField body="accept" type="boolean" required>
  Whether to accept (`true`) or decline (`false`) the invitation
</ParamField>

### Response

<ResponseField name="organization" type="object" optional>
  Organization details if invitation was accepted, otherwise null
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.plaisolutions.com/me/invitations/inv_123/reply' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "accept": true
  }'
  ```

  ```javascript JavaScript theme={null}
  const invitationId = 'inv_123';
  const response = await fetch(`https://api.plaisolutions.com/me/invitations/${invitationId}/reply`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      accept: true
    })
  });

  const result = await response.json();
  console.log(result);
  ```

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

  invitation_id = "inv_123"
  url = f"https://api.plaisolutions.com/me/invitations/{invitation_id}/reply"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json"
  }
  data = {
      "accept": True
  }

  response = requests.post(url, headers=headers, json=data)
  result = response.json()
  print(result)
  ```
</CodeGroup>
