Get User Information
curl --request GET \
--url https://api.wordsmith.ai/api/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wordsmith.ai/api/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wordsmith.ai/api/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wordsmith.ai/api/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wordsmith.ai/api/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wordsmith.ai/api/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wordsmith.ai/api/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "987fcdeb-51a2-43d1-9e8f-7b6c5a4d3e2f",
"user_name": "John Doe",
"user_email": "john@lawfirm.com",
"customer_name": "Example Law Firm LLC"
}
User
Get User Information
Retrieve information about the authenticated user and their organization
GET
/
api
/
v1
/
me
Get User Information
curl --request GET \
--url https://api.wordsmith.ai/api/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wordsmith.ai/api/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wordsmith.ai/api/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wordsmith.ai/api/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wordsmith.ai/api/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wordsmith.ai/api/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wordsmith.ai/api/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "987fcdeb-51a2-43d1-9e8f-7b6c5a4d3e2f",
"user_name": "John Doe",
"user_email": "john@lawfirm.com",
"customer_name": "Example Law Firm LLC"
}
Retrieves information about the currently authenticated user and their associated customer organization.
Authentication
This endpoint requires a valid API key in the Authorization header.curl -X GET "https://api.wordsmith.ai/api/v1/me" \
-H "Authorization: Bearer sk-ws-api1-your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch("https://api.wordsmith.ai/api/v1/me", {
method: "GET",
headers: {
Authorization: "Bearer sk-ws-api1-your_api_key_here",
"Content-Type": "application/json",
},
});
const userData = await response.json();
import requests
headers = {
"Authorization": "Bearer sk-ws-api1-your_api_key_here",
"Content-Type": "application/json"
}
response = requests.get("https://api.wordsmith.ai/api/v1/me", headers=headers)
user_data = response.json()
Response
string
The unique identifier for the user
string
The unique identifier for the customer organization
string
The display name of the user (may be null)
string
The email address of the user
string
The name of the customer organization
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "987fcdeb-51a2-43d1-9e8f-7b6c5a4d3e2f",
"user_name": "John Doe",
"user_email": "john@lawfirm.com",
"customer_name": "Example Law Firm LLC"
}
Error Responses
{
"error": "Invalid API key",
"status": 401
}
{
"error": "Rate limit exceeded",
"status": 429
}
Use Cases
- Authentication verification: Confirm that your API key is working correctly
- User context: Get information about the current user for personalization
- Organization identification: Determine which organization the user belongs to
⌘I