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

# Generate Token

> Generates an authentication token for a specific user by their user ID.

<Note>
  This endpoint does **not** require the `token` header. It generates a token using the user ID directly.
</Note>

## Path Parameters

<ParamField path="userId" type="string" required>
  The user ID to generate a token for.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable result message.
</ResponseField>

<ResponseField name="token" type="string">
  The generated authentication token.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.linkedcamp.com/users/60f7a1b2c3d4e5f6a7b8c9d0
  ```

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

  response = requests.get(
      "https://api.linkedcamp.com/users/60f7a1b2c3d4e5f6a7b8c9d0"
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.linkedcamp.com/users/60f7a1b2c3d4e5f6a7b8c9d0"
  );
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Token generated successfully!",
    "token": "U2FsdGVkX1..."
  }
  ```
</ResponseExample>
